|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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- |
|
#3
|
|||
|
|||
|
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 |
|
#4
|
|||
|
|||
|
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- |
|
#5
|
|||
|
|||
|
Thnx alot
![]() |
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > Can't view my variables?!?!? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|