Current location: Hot Scripts Forums » Programming Languages » PHP » $GLOBALS["PHP_SELF"] doesn't work - Why?


$GLOBALS["PHP_SELF"] doesn't work - Why?

Reply
  #1 (permalink)  
Old 07-15-03, 04:39 PM
kevin kevin is offline
Newbie Coder
 
Join Date: Jun 2003
Location: USA
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
$GLOBALS["PHP_SELF"] doesn't work - Why?

Hi !

I just think it will work on new PHP version (what version anyway?)

I've read the PHP book and it told me: if I named the form field like this

<input type=text name=email>

when I submit the form to go to next page then the value data of "email" filed will hold inside $email

I tried it on my server and it worked - I think PHP so easy to work with Form.

And now, I just finished my first Form Mail PHP program and tried to install it on my friends website (was hosted somewhere else) - The bad thing happen: my program doesn't work right.

I think the hosting company is runing the old PHP version - thats why $email can't hold the data.

What should I do now? Please help me

Thanks !
Kevin
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 07-15-03, 04:55 PM
Stefan's Avatar
Stefan Stefan is offline
Junior Code Guru
 
Join Date: Jun 2003
Location: Utrecht, The Netherlands
Posts: 599
Thanks: 0
Thanked 0 Times in 0 Posts
try using $_SERVER['PHP_SELF'] ... maybe that will work.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 07-15-03, 05:07 PM
kevin kevin is offline
Newbie Coder
 
Join Date: Jun 2003
Location: USA
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks

Thanks for quick respond! Yes, it works

Then how about $email thing? HOw to pass data when I submit the form -

Regards!
Kev
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 07-15-03, 06:48 PM
KeithMcL KeithMcL is offline
Newbie Coder
 
Join Date: Jul 2003
Location: Dublin, Ireland
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
In your script add the line:
Code:
$email = $_REQUEST['email'];
and try it again.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 07-16-03, 04:12 PM
Stefan's Avatar
Stefan Stefan is offline
Junior Code Guru
 
Join Date: Jun 2003
Location: Utrecht, The Netherlands
Posts: 599
Thanks: 0
Thanked 0 Times in 0 Posts
or you should preferably use $_GET['email'] or $_POST['email'] depending on the method of the form.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 07-16-03, 04:30 PM
KeithMcL KeithMcL is offline
Newbie Coder
 
Join Date: Jul 2003
Location: Dublin, Ireland
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
That's actually why I said $_REQUEST, because I didn't know the post method

Either should work.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #7 (permalink)  
Old 07-17-03, 06:21 AM
Stefan's Avatar
Stefan Stefan is offline
Junior Code Guru
 
Join Date: Jun 2003
Location: Utrecht, The Netherlands
Posts: 599
Thanks: 0
Thanked 0 Times in 0 Posts
yeha, I already thought that, but I thought I'd mention the other options as well as it enhances security by just a bit and makes the code easier to understand because you know where it came from
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #8 (permalink)  
Old 07-17-03, 08:48 AM
KeithMcL KeithMcL is offline
Newbie Coder
 
Join Date: Jul 2003
Location: Dublin, Ireland
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
True

Wonder if Kevin ever got it to work!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need data dump from OSCommerce done - paid work Coach Job Offers & Assistance 2 06-25-04 11:52 AM
Why doesn't this guestbook work? chairboy PHP 1 10-07-03 10:49 AM
(junior) C/C++ or delphi programmer looking for work Impy dude Job Offers & Assistance 0 10-02-03 12:02 PM
Site works in Mozilla but doesn't work in IE khibinite The Lounge 4 07-08-03 05:00 AM
Freelance work for Students ukidev General Advertisements 1 06-25-03 02:44 AM


All times are GMT -5. The time now is 07:09 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.