473,322 Members | 1,501 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

php 5.2 $submit action no working...

On all of my webpage which require a submit action, the forms just reload as if nothing happened. I wrote a simple test code and I still can't get the form to work. I know they just stopped working within the last couple weeks since the update to php 5.2 Any help? Here is a sample test.. it doesn't work!!

Expand|Select|Wrap|Line Numbers
  1. <html>
  2.  
  3. <body>
  4.  
  5. <?php
  6.  
  7.  
  8.  
  9. if ($submit) {
  10.  
  11.   // process form
  12.     echo 'ok';
  13.   while (list($name, $value) = each($HTTP_POST_VARS)) {
  14.  
  15.     echo "$name = $value<br>\n";
  16.  
  17.   }
  18.  
  19. } else{
  20.  
  21.   // display form
  22.  
  23.   ?>
  24.  
  25.   <form method="post" action="<?php echo $PHP_SELF?>">
  26.  
  27.   First name:<input type="Text" name="first"><br>
  28.  
  29.   Last name:<input type="Text" name="last"><br>
  30.  
  31.   Address:<input type="Text" name="address"><br>
  32.  
  33.   Position:<input type="Text" name="position"><br>
  34.  
  35.   <input type="Submit" name="submit" value="Enter information">
  36.  
  37.   </form>
  38.  
  39.   <?php
  40.  
  41.  
  42.  
  43. } // end if
  44.  
  45.  
  46.  
  47. ?>
  48.  
  49.  
  50.  
  51. </body>
thanks,

alex
Feb 27 '07 #1
2 1329
arizal
25
Hi Miyagikarate,

I think what you need to do is replace ($submit) by
[PHP]

if ( $_POST['submit'] == "Enter information" ) {

......
}

[/PHP]

I am not sure but you can give it a try. Good Luck
Feb 27 '07 #2
thanks. That worked...

I dont know why it used to work in a different version on Php but now that i made that change it works.

thanks again,

Alex
Feb 27 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Bruce Duncan | last post by:
I can't seem to figure our why this doesn't work. I don't get any errors, it just doesn't submit. Can anyone shed some light. <?PHP $var1 = "http://localhost/php/index.php"; $varx = "bruce";...
2
by: Phillip Windell | last post by:
This is really an HTML question I think, but it probably won't take much effort to answer (unless I'm answering or course). The HTML is all ASP generated and the ASP generates exactly what I want...
2
by: DB | last post by:
Hi All Having stared at this all morning and altered various things with no effect other then to exasperate the problem i'm wondering if anyone could take a look at the code below and see why on...
3
by: sancha | last post by:
Hi, i am in a bit of a delima here. I need to submit an action through javascript so i used document.forms.action='/search.do?&submitaction=Add Minus' document.forms.submit(); since i am...
4
by: houstoncity2004 | last post by:
Hi, I need help to JavaScript. I am new to this, and am trying to the page online ASAP. I have two submit buttons on one form, and each button will have to do different things. I named both...
2
by: Hongyu | last post by:
I am trying to implement a simple JavaScript of redirecting my window to a new URL upon clicking a submit button. This is an easy task except when I have to put an input type='submit' in front of...
1
by: kkuniya | last post by:
Situation : - A form (method : POST, action : itself, onsubmit : alert 'Submit' ) - Got 2 submit button ( 'Save' , 'View') - Got navigation 1|2|3|4 What I want to do : - Once clicked on the...
13
by: deko | last post by:
I have a basic feedback form with a submit button. After the "send" button is clicked, I want the user to be redirected to a different page that says "Your message has been sent." How do I do...
3
by: kavithadevan | last post by:
Hi, Here i have pasted 2 scripts first one is design and next one is country.php in the below code is working nicely. ----------------------design.php------ <form name="form1" method="post"...
31
by: ajos | last post by:
hi frnds, i have a form,which has 2 input text boxes, the values are entering the text boxes,when i leave the 2 text boxes blank and hit submit a java script gives the message that the 2 fields are...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.