Form Processing

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
inkubus08
Forum Newbie
Posts: 3
Joined: Mon Feb 27, 2006 11:23 am

Form Processing

Post by inkubus08 »

Maybe i'm doing something wrong but with this example when the submit button is pressed name/value of the two buttons are not being passed with the post....the echo produces nothing...is there a way to make this scenerio work???any additional help would be wonderful...


<form method="POST" action="whatever this file name is">
<input type="button" value="TEMP" name="daaaa">
<input type="button" value="TEST" name="LOLOLOL">
<input type="submit" value="OMG">
</form>
<?php
$da = $_POST['daaaa'];
$lol = $_POST['LOLOLOL'];
echo $da.$lol;
?>


I need to have the value of each button available after the form has been submitted.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

buttons clicked (and/or default submits) are the only ones transmitted with standard submissions. Maybe hidden values? Or an entirely different way? What's the goal you want? What are you trying to achieve?
inkubus08
Forum Newbie
Posts: 3
Joined: Mon Feb 27, 2006 11:23 am

Post by inkubus08 »

If you go to http://ncaa.picktowin.net/bracket.html you can see an example of what I am doing. User clicks a button and then copies its value to another button.....when the form is complete I need the values of all of the buttons so that they can be inserted into a MySQL database.
User avatar
a94060
Forum Regular
Posts: 543
Joined: Fri Feb 10, 2006 4:53 pm

Post by a94060 »

can you jsut keep on passing the values on to each page?(i dont know if you are doing 1 physical script or multiple pages.)if you just kept on passing and then adding a new entry into your database. I think that would seem to work.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

The page you referenced is entirely controlled by Javascript.
User avatar
a94060
Forum Regular
Posts: 543
Joined: Fri Feb 10, 2006 4:53 pm

Post by a94060 »

sory if i hijacked thread but wat do u mean by it is controlled by JS? i see it as all HTML with no Java tags.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

a94060 wrote:sory if i hijacked thread but wat do u mean by it is controlled by JS? i see it as all HTML with no Java tags.
Not to be blunt, but did you look at the source code?

The first 150 or so lines is all javascript.. and is called based on events such as

Code: Select all

onClick="go(this.id,'1-15A',this.value);"/>
inkubus08
Forum Newbie
Posts: 3
Joined: Mon Feb 27, 2006 11:23 am

Post by inkubus08 »

http://ncaa.picktowin.net/bracket.html is just to show what i am trying to do...yes i use javascript to populate the other buttons on the form but once the form is complete i will use a php script to process the POST array to add the values into a MySQL database......ignore the fact that the link is to a .html file ....that was just to show what i am trying to do as far the form goes....i have seperate php files .... http://ncaa.picktowin.net/bracket.php is the same form in a php file that calls for itself when submitted.....the button values are not being passed with the POST....how if at all could pass the button values to php for processing...any help would be great
User avatar
a94060
Forum Regular
Posts: 543
Joined: Fri Feb 10, 2006 4:53 pm

Re: Form Processing

Post by a94060 »

inkubus08 wrote:Maybe i'm doing something wrong but with this example when the submit button is pressed name/value of the two buttons are not being passed with the post....the echo produces nothing...is there a way to make this scenerio work???any additional help would be wonderful...

Code: Select all

<form method="POST" action="whatever this file name is">
<input type="button" value="TEMP" name="daaaa">
<input type="button" value="TEST" name="LOLOLOL">
<input type="submit" value="OMG">
</form>
<?php
$da = $_POST['daaaa'];
$lol = $_POST['LOLOLOL'];
echo $da.$lol;
?>

I need to have the value of each button available after the form has been submitted.
Jcart
PostPosted: Mon Feb 27, 2006 1:45 pm Post subject:
a94060 wrote:
sory if i hijacked thread but wat do u mean by it is controlled by JS? i see it as all HTML with no Java tags.


Not to be blunt, but did you look at the source code?

The first 150 or so lines is all javascript.. and is called based on events such as

Code: Select all

onClick="go(this.id,'1-15A',this.value);"/>

i dont know where u see al this javascript because at the beginning of this thread thats the only code i see.


EDIT-i just checked the link:http://ncaa.picktowin.net/bracket.html and saw what you guys meant....
Last edited by a94060 on Mon Feb 27, 2006 2:16 pm, edited 1 time in total.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

User avatar
a94060
Forum Regular
Posts: 543
Joined: Fri Feb 10, 2006 4:53 pm

Post by a94060 »

yep,as i jus edited,i saw that...haha :( sorry for that.
Post Reply