![]() |
|
Welcome to the Computer Webmaster Gaming Console Graphics Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| |||||||
| PHP PHP for some can be one of the hardest website programming codes, so do you need help on your PHP script, if it is php4, php5 or lower this is the place for you for any PHP help. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 | ||
| Hello Everyone I have a problem with my apache and php scripts. The form data is not being passed to the page it is submit to. I' ve tried the pages out on another machine and work with no problems. Any idea's what could be problem. I reinstalled both apache and php, but with luck. Thanks Eric | |||
| Advertisements |
| | #2 | ||
| web address for the server is 64.132.106.81/testpage/test3.php This is the source test3.php and test4.php <html> <head> <title>Listing 1-4</title> </head> <body> <!--<form action="test4.php" method="post"> --> <form action="test4.php" method="post"> Your Name: <INPUT TYPE="text" name="YourName"> <INPUT TYPE="submit" NAME="x" VALUE="COMPUTE"> <form> </body> </html> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE>Dixie global menu</TITLE> <META http-equiv=Content-Type content="text/html; charset=iso-8859-1"> <LINK href="css/dixie.css" rel=stylesheet> </HEAD> <BODY text=#000000 vLink=#000099 aLink=#0000ff link=#000099 bgColor=#999999 leftMargin=0 topMargin=0 marginheight="0" marginwidth="0"> <?php echo "<p>Welcome: $YourName <br>"; ?> </BODY> </HTML> Thanks for the help Eric Dillard RHCT "Andy Hassall" <andy@andyh.co.uk> wrote in message news:9935kvg4r7ab485tne404m6pnrfov6bm0v@4ax.com... > On Tue, 19 Aug 2003 16:35:52 -0400, "Eric Dillard" <eric@seisystems.com> wrote: > > >I have a problem with my apache and php scripts. The form data is not being > >passed to the page it is submit to. I' ve tried the pages out on another > >machine and work with no problems. Any idea's what could be problem. I > >reinstalled both apache and php, but with luck. > > Post a minimal, runnable piece of code that demonstrates your problem. > > Without being able to see your system, any advice is just a guess as you > haven't given enough information (although there's one guess that's more likely > than others: > http://www.andyh.uklinux.net/faq/com...rnal-variables) > > -- > Andy Hassall (andy@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk) > Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space) | |||
| | #3 | ||
| try: <?php $YourName = $HTTP_POST_VARS['YourName']; echo "<p>Welcome: $YourName <br>"; ?> do the same for all variables you pass over. You probably have register_globals switched off in php.ini (which is for the best). When submitting a form, the values are put into an array (HTTP_POST_VARS or HTTP_GET_VARS depending whether you have action=post or action=get in the form). You then access the values in the array as above. They will be stored with the name you set for the text field, i.e. <INPUT TYPE="text" name="YourName">. "Eric Dillard" <eric@seisystems.com> wrote in message news:3f4298e3$0$43849$39cecf19@news.twtelecom.net. .. web address for the server is 64.132.106.81/testpage/test3.php This is the source test3.php and test4.php <html> <head> <title>Listing 1-4</title> </head> <body> <!--<form action="test4.php" method="post"> --> <form action="test4.php" method="post"> Your Name: <INPUT TYPE="text" name="YourName"> <INPUT TYPE="submit" NAME="x" VALUE="COMPUTE"> <form> </body> </html> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE>Dixie global menu</TITLE> <META http-equiv=Content-Type content="text/html; charset=iso-8859-1"> <LINK href="css/dixie.css" rel=stylesheet> </HEAD> <BODY text=#000000 vLink=#000099 aLink=#0000ff link=#000099 bgColor=#999999 leftMargin=0 topMargin=0 marginheight="0" marginwidth="0"> <?php echo "<p>Welcome: $YourName <br>"; ?> </BODY> </HTML> Thanks for the help Eric Dillard RHCT "Andy Hassall" <andy@andyh.co.uk> wrote in message news:9935kvg4r7ab485tne404m6pnrfov6bm0v@4ax.com... > On Tue, 19 Aug 2003 16:35:52 -0400, "Eric Dillard" <eric@seisystems.com> wrote: > > >I have a problem with my apache and php scripts. The form data is not being > >passed to the page it is submit to. I' ve tried the pages out on another > >machine and work with no problems. Any idea's what could be problem. I > >reinstalled both apache and php, but with luck. > > Post a minimal, runnable piece of code that demonstrates your problem. > > Without being able to see your system, any advice is just a guess as you > haven't given enough information (although there's one guess that's more likely > than others: > http://www.andyh.uklinux.net/faq/com...rnal-variables) > > -- > Andy Hassall (andy@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk) > Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space) | |||
| | #4 | ||
| Thanks for the help. Eric Dillard "Andy Hassall" <andy@andyh.co.uk> wrote in message news:2b95kvs7f21bvp005pgu98g2r9a4duqdo0@4ax.com... > On Tue, 19 Aug 2003 17:38:24 -0400, "Eric Dillard" <eric@seisystems.com> wrote: > > >web address for the server is 64.132.106.81/testpage/test3.php > > Submitting the form goes to a phpinfo() output, clearly showing: > > register_globals > Off Off > > (Which is as it should be) > > >This is the source test3.php and test4.php > [snip] > ><?php > > echo "<p>Welcome: $YourName <br>"; > >?> > > See the URL listed in my previous message. You should use $_POST['YourName'], > not $YourName. > > Contents reproduced here for the sake of archives: > > External variables (forms, sessions and cookies) > I've just upgraded to PHP 4.2.0 or later, and I'm getting 'undefined variable' > warnings on all my pages. Why? > > You are relying on the register_globals configuration setting being on. It is > off by default in PHP 4.2.0 and later. > > Code of the following form will no longer work in the default configuration: > > <form method="GET"> > <input type="text" name="input1" /> > <input type="submit" /> > </form> > > <?php > if (isset($input1)) { > echo $input1; > } > ?> > > The variable $input1 will be undefined - global variables for each form input > element are no longer created by default for security reasons. This is > documented in the following pages: > > PHP 4.1.0 Release Announcement > http://www.php.net/release_4_1_0.php > > PHP 4.2.0 Release Announcement > http://www.php.net/release_4_2_0.php > > PHP Manual - External Variables > http://www.php.net/manual/en/languag...s.external.php > > Secure Programming In PHP article on zend.com > http://www.zend.com/zend/art/art-oertli.php > > The new mechanism using the superglobal variables $_GET, $_POST, $_SERVER, > $_SESSION, $_ENV and $_REQUEST is much preferred over the old global variable > method. > > <form method="GET"> > <input type="text" name="input1" /> > <input type="submit" /> > </form> > > <?php > if (isset($_GET['input1'])) { > echo $_GET['input1']; > } > ?> > > If you absolutely must use the old method, and you are aware of the security > risks this involves, you can restore the old behaviour with the > register_globals configuration option in php.ini. > > > -- > Andy Hassall (andy@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk) > Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space) | |||
| Featured Websites | ||||
|
![]() |
| Tags: being, data, form, page, posted, problem |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| error on POSTed form | Wm | PHP | 0 | 07-01-2007 5:10 PM |
| form data will not post | Nomen Nescio | PHP | 5 | 07-01-2007 5:06 PM |
| Catching form posted variable?? | Fishter | PHP | 1 | 07-01-2007 4:17 PM |
| sending form data as email using SMTP server ??? | James | PHP | 3 | 07-01-2007 3:32 PM |
| Dumping Form data to file | Charles E. Pelkey | PHP | 3 | 07-01-2007 3:15 PM |
| Featured Websites | ||||
|