PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old June 16th, 2004, 02:44 PM
LeXonRin LeXonRin is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 10 LeXonRin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy Can't view my variables?!?!?

Hi guys,

I have this problem where I make a text box on one page, and send it through the url, then try to view it on a php page but the variable doesn't come up. Anyone know what might be the problem?

Thanks

LeX

Reply With Quote
  #2  
Old June 16th, 2004, 05:43 PM
kode_monkey kode_monkey is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 367 kode_monkey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 21 sec
Reputation Power: 6
Off the top of my head I'd say this sounds like a register globals problem but without seeing some source code its hard to say. If you could post the problem code I'm sure someone can spot the error for you.

-KM-

Reply With Quote
  #3  
Old June 16th, 2004, 10:47 PM
LeXonRin LeXonRin is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 10 LeXonRin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Here's the code for the html file:
Code:
<html>
<head></head>
<body>
<form method=get action="text.php">
Who is your favourite author?
<input name="Author" type="text">
<br>
<br>
<input type=submit>
</form>
</body>
</html>


And heres the php page code:

Code:
<html>
<head></head>
<body>
Your favorite author is:
<?php
echo $Author;
?>
</body>
</html>


Anyone know the problem now?

LeX

Reply With Quote
  #4  
Old June 17th, 2004, 05:14 AM
kode_monkey kode_monkey is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 367 kode_monkey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 21 sec
Reputation Power: 6
Yeah, that will only work if you have register globals turned on. Basically what happens with register globals is anything in $_GET, $_POST etc is put into a variable with the same name. So for example you have, $_GET ['Author'] from your query string so with register globals you get a variable $Author. If you have it turned off then you need to use $_GET ['Author'] instead.

That said register globals should be turned off and you should be using $_GET, $_POST etc for security reasons. For more details have a look around these forumns or a google search and you'll find loads of threads and articles about why this is the case.

-KM-

Reply With Quote
  #5  
Old June 17th, 2004, 02:52 PM
LeXonRin LeXonRin is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 10 LeXonRin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thnx alot

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > Can't view my variables?!?!?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway