PHP - 3 Step Passing Of Non-post $variables Between 2 Different Servers
I'm stuck at trying to figure out out to complete the 3 Step scripts to accomplish passing $variables between 2 different servers. Since there will actually be 12 Non-POST $variables involved in the SERVER #1 to SERVER #2 transfer , it doesn't appear that trying to put these all in a URL string and going the 'GET' route is practical.
I'm just using 3 short test variables in the examples. My eyeballs started rolling within I ran across something about 'CURL' that might be a necessary part of the solution?
The code I have been able to hammer out so far is below as STEP 1, STEP 2 and STEP 3.
STEP 1
<?php // submit.php // STEP 1 // On (LOCAL) SERVER #1 TO relay $variables to 'process.php' on (REMOTE) SERVER #2 // To submit $variables to directly another destination server script // NOTE: The $variable are NOT the result of Form Input !!! // For login Authenticaion ALL 3 must match db entries on SERVER #2 // NOTE: (Again) The $variables are NOT the result of Form Input !!! $userid = "adam"; $passwd = "eve"; $pscode = "peterpan"; // NOTE: (Again) The $variable are NOT the result of Form Input !!! // These $variables are needed for MySQL db INSERT on the destination URL server // For testing simplicity (actual data will be 12 $variables) $a = "apple"; $b = "banana"; $u = "1234567; // // Not sure if something called 'CURL' is needed here ??? // $submit_to_url = http://www.blahblah.com/process.php"; ?>STEP 2 <?php // processor.php // STEP 2 // ON SERVER #2 TO RECEIVE DATA DIRECTLY FROM SERVER #1 'submit.php' // To receive and process the $variables into a MySQL db on SERVER #2 // NOTE: The $variables are NOT the result of Form Input !!! // First validate $userid, $passwd & $pscode against `verify` table MySQL records require '/SERVER_2_securelocation_for_database_connection/secret_mysqli.php'; if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } // // Not sure if something called 'CURL' is needed here ??? // // These login $variables are from submit.php on SERVER #1 $userid $passwd $pscode $sql="SELECT `userid`, `passwd`, `pscode` FROM `verify` WHERE `userid` = '$userid'" AND `passwd` = '$passwd` AND `pscode` = '$pscode'; $result = mysqli_query($con,$sql); if (!mysqli_query($con,$sql)) { die('Error: ' . mysqli_error($con)); } // // Then some Authentication code if ALL 3 components match // // If Authentication = true then $passed = "YES" must sent // be sent back to the 'finalstep.php' script on SERVER #1 // If Authentication (or connection) = false ... $passed = "NO" $return_to_url = http://www.blahblah.com/finalstep.php"; // These $variables are from submit.php on SERVER #1 $a = "apple"; $b = "banana"; $u = "1234567"; $sql="INSERT INTO `data` (`a`, `b`, `u`) VALUES ('$a', '$b', '$u')"; if (!mysqli_query($con,$sql)) { die('Error: ' . mysqli_error($con)); } // If $SQL INSERT into `data` on SERVER #2 works ... // $status = "Pending" must be sent back to the 'finalstep.php' // script on SERVER #1 for MySQL db Table insertion // If $SQL INSERT into `data` = false, then $status = "Error" // NOTE: The '$u' $variable also needs send back to finalstep.php !!! $return_to_url = http://www.blahblah.com/finalstep.php"; mysqli_close($con); ?>STEP 3 <?php // finalstep.php // STEP 3 // ON SERVER #1 TO RECEIVE DATA DIRECTLY BACK FROM SERVER #2 process.php // To receive the $passed, $status and $u $variables for final step action // NOTE: The $variable are NOT the result of Form Input !!! require '/SERVER_1_securelocation_for_database_connection/secret_mysqli.php'; if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } // These $variables are from process.php on SERVER #2 $passed $status $u $sql="UPDATE `tracking` SET `passed` = '$passed', `status` = '$status' WHERE `uniqueid` = '$u' "; $result = mysqli_query($con,$sql); if (!mysqli_query($con,$sql)) { die('Error: ' . mysqli_error($con)); } mysqli_close($con); ?>Thanks very much for any assistance and guidance. -freakingOUT Similar TutorialsHi all, I've been trying to create a page whereby a user enters a few details which is then emailed, but I'm seriously stuck on one issue. First page - console type Second page - serial number Only two steps at the moment as I need to figure it out. I'm passing everything into a variable from a post(ed) form. It appears on the next page fine, as I've been testing, but the details entered on the first page don't show on the third, however, the details from the second page do! Here is the code I have: Code: [Select] <?php switch ($step) { case "1": ?> <table width="75%" align="center"> <tr> <td colspan="2" valign="top"> <form action="?step=2" method="post" id="consoletype">Please select your console type<br /></td></tr> <tr><td align="center" valign="top" width="50%"> <label>Xbox 360 Original (Beige or Black)<br /><img src="images/xbox360orig.gif" width="250" height="250"><br /><input class="button" type="radio" name="console" value="xboxorig" /></label></td> <td align="center" valign="top" width="50%"><label>Xbox 360 Slim<br /><img src="images/xbox360slim.gif" width="250" height="250"><br /><input type="radio" name="console" value="xboxslim" /></label></td> </tr> <tr> <td colspan="2"> <input type="submit" value="Next"> </form> </td> </tr> </table> <?php echo $code; include("footer.php"); echo $code2; include("compat.php"); echo $code3; case "2": $console = $_POST['console']; echo $console; ?> Please enter your Xbox 360 Serial Number:<br /> <form action="?step=3" method="post"> <input name="serialno" type="text" size="20" maxlength="20"> <input type="submit" value="Next"> </form> <?php echo $code; include("footer.php"); echo $code2; include("compat.php"); echo $code3; case "3": echo "<br />"; $serialno = $_POST['serialno']; echo $serialno; echo $console; echo $code; include("footer.php"); echo $code2; include("compat.php"); echo $code3; } ?> I do understand it's messy at the moment but I don't see much point beautifying everything until I can solve this problem! Cheers! I can add and delete data from my table. Now I need to be able to change one or more fields in an entry. So I want to retrieve a row from the db, display that data on a form where the user can change any field and then pass the changed data to an update.php program. I know how to go from form to php. But how do I pass the data from retrieve.php to a form so it will display? Do I use a URL and Get? Can I put the retrieve and form in the same program? i made a quick example of the problem im having. at step 5 i dont get the data for some reason. and its weird because when i resend the data it usually works by clicking refresh page. is very frustrating and makes no sense. please help Code: [Select] <?php if(!isset($_GET['step'])){ ?> <form method="post" action="form.php?step=2"> <input type="text" name="text" id="text"> <input type="submit"> </form> <?php } else if($_GET['step'] == 2){ ?> <form method="post" action="form.php?step=3"> <input type="hidden" name="text" id="text" value="<?php echo $_POST['text']; ?>"> <input type="text" name="text2" id="text2"> <input type="submit"> </form> <?php } else if($_GET['step'] == 3){ ?> <form method="post" action="form.php?step=4"> <input type="hidden" name="text" id="text" value="<?php echo $_POST['text']; ?>"> <input type="hidden" name="text2" id="text2" value="<?php echo $_POST['text2']; ?>"> <input type="text" name="text3" id="text3"> <input type="submit"> </form> <?php } else if($_GET['step'] == 4){ ?> <form method="post" action="form.php?step=5"> <input type="hidden" name="text" id="text" value="<?php echo $_POST['text']; ?>"> <input type="hidden" name="text2" id="text2" value="<?php echo $_POST['text2']; ?>"> <input type="hidden" name="text3" id="text3" value="<?php echo $_POST['text3']; ?>"> <input type="text" name="text4" id="text4"> <input type="submit"> </form> <?php } else if($_GET['step'] == 5){ echo $_POST['text']; echo $_POST['text2']; echo $_POST['text3']; echo $_POST['text4']; } ?> I have an hml page that uses option values and lets the user select values. the values are php pages which when they submit pass the chosen value to the next page I show a snip below. I wanted to have the form action grab the formVar passed to it- but I can't seem to get it going. I figure I just may not be putting the post in correctly- any help appreciated <head><title>page2</title></head> <body> <form action=="<?php $_POST['formVar']; ?>" method="POST"> www.mywebpage.co.uk/page22 Is it possible to produce a variable with the value = page22 using only the url above, I know that usually you would use get and post, but I was just curious to know if this had been done before. i want to pass the information getting from the form and after storing in to the variables to a new php file ..how to pass all the value getting from the form Hi First post here. Long time reader! I'm looking to gauge the general practices of dealing with variables between pages. I'd always pass my variables through the POST. Im normally always doing a post back and processing the data at the top of the page. I never liked the query string as it open to manipulation, but can see its use for a search results page and saving the url. I came from a ASP background and we would only use session variables for holding user login information as the windows server had a habit of restarting the pool and loosing the session. We didn't want this happening, for example, when doing an e-commerce transaction. We always felt the post was the most robust method. Now Im using php and all the great features it has. I was looking to see what the more experience php developers used and am I right sticking to the post method, or is utilising session a more modern way of doing things. I've a few years experience doing web dev, just thought I touch base on a few issues to make sure I'm still heading in the right direction. Thanks for any advice guys! Hi, I'm trying to pass a variable into a URL and apparently I'm doing it wrong this code is OK Code: [Select] $id = $3; echo '<a href="newPage.php?id=3"></a> If I use Code: [Select] $id = $_GET['id']; echo $id; on the newPage.php, I echo 3 whereas, if I do Code: [Select] $id = $3; echo '<a href="newPage.php?id="'.$id.'"></a> when echo out on the newPage.php it prints out nothing also, in current url look like this: Code: [Select] www.site.com/newPage.php?id= What am I doing wrong? Many thanks I normally don't work with PHP or rather I'm learning as I go..and this is pretty much my last barrier between completing this project. Anyway here are my two files: http://pastebin.com/aThU3akC - file i want to grab values from and pass to the file below http://pastebin.com/kTYHr99p - file that is suppose to display the values in $transmessage Basically I need the variables defined in the first file to be passed and usable in the second and I'm not sure why I can't Hello all, So I've picked up a PHP book in an attempt to learn it. The issue I'm having is preventing me from getting any further. They have me creating a simple order form, but the data is not passing from the HTML page to the PHP Processing file. I know there are other ways of doing this that I'm unaware of, but this code is verbatam to what we are isntructed to type within the book itself. Here is the code orderform.html: Code: [Select] <html> <body> <form action="processorder.php" method="post"> <table border="0"> <tr bgcolor="#cccccc"> <td width="150">Item</td> <td width="15">Quantity</td> </tr> <tr> <td>Tires</td> <td align="center"><input type="text" name="tireqty" size="3" maxlength="3"></td> </tr> <tr> <td>Oil</td> <td align="center"><input type="text" name="oilqty" size="3" maxlength="3"></td> </tr> <tr> <td>Spark Plugs</td> <td align="center"><input type="text" name="sparkqty" size="3" maxlength="3"></td> </tr> <tr> <td>How did you find Bob's?</td> <td><select name="find"> <option value = "a">I'm a regular customer</option> <option value = "b">TV advertising</option> <option value = "c">Phone directory</option> <option value = "d">Word of mouth</option> </select> </td> </tr> <tr> <td colspan="2" align="center"><input type="submit" value="Submit Order"></td> </tr> </table> </form> </body> </html> processorder.php: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Bobs Auto Parts - Order Results</title> </head> <body> <h1>Bobs Auto Parts</h1> <h2>Order Results</h2> <?php $tireqty = $_post['tireqty']; $oilqty = $_post['oilqty']; $sparkqty = $_post['sparkqty']; echo "<p>Order Processed at "; echo date('H:i, jS F Y'); echo "</p>"; echo '<p>Your order is as follows: </p>'; echo $tireqty.' tires<br />'; echo $oilqty.' bottles of oil<br />'; echo $sparkqty.' spark plugs<br />'; $totalqty = 0; $totalamount = 0.00; define('TIREPRICE', 100); define('OILPRICE', 10); define('SPARKPRICE', 4); ?> </body> </html> For some reason the values on the processing form dont show up. The only text thats displayed is : Bobs Auto Parts Order Results Order Processed at 17:07, 9th January 2011 Your order is as follows: tires <---- Should be showing the total quantity ordered bottles of oil <---- Should be showing the total quantity ordered spark plugs <---- Should be showing the total quantity ordered Is anyone able to let me know where the error is in this code? The writers website isnt any help.... Regards, sapper6fd I have the following code that outputs a url. It searches my MySQL database for the name of a given item within a theme: $relative = 'http://www.domain.com/wp-content/'; $url1= $relative . 'themes/arjuna-x/itemspec.php?type='; $url2='&item='; <a class="entry-thumbnails-link" href="<?php echo $url1.'Themes'.$url2.$rowThemes['Theme']; ?>"> The output is as follows: http://www.domain.com/wp-content/themes/arjuna-x/itemspec.php?type=Themes&item=(insert variable here) All is good up to this point. My problem however, is that some items (in this case: theme names) have apostrophes in them. For example: April Fool's. This results in breaking my php code. How can I get php to call these variables with apostrophes so that they don't break my php? I'm creating this URL to pass variables to use from one Page to another:
http://eg10basketbal...Borgman&team=16
My WP site is seeing the first variable but not the second. After some searching I've found this suggestion, but it's not working for me:
function add_query_vars_filter( $vars ) { $vars[] = "nameFull"; $vars[] = "team"; return $vars; } add_filter( 'query_vars', 'add_query_vars_filter' );I tried putting this in the wp-includes/functions.php file of the, but ended up with a fatal error. I have since added it to my theme's functions.php file. There isn't an error, but it doesn't yield recognition of my second variable. The code below is a form the gets information from a database and post it into the appropriate field. I am having a problem with the while loop. All the variables before the while loop work just great and echo out how they should. But everything after the while loop does not work. I know it has something to do with the while loop because when I take the while loop out everything works as it should. Can anyone please help me with this? <? $id = $_POST["id"]; $therapy = $_POST["therapy"]; db_connect(); $query=mysql_query("select * from student where student_id = $id") or die ("invalid query"); $row=mysql_fetch_array($query); print "<table width='330' border=0 align='center'> <form method='POST' action='table.php'> <td>*First Name:</td> <td>*Last Name:</td> <tr>"; ?> <td width="157"><input size="23" name="first_name" value="<?php echo "$row[first_name]"; ?>" /></td> <td width="138"><input type="text" size="23" name="surname" value="<?php echo "$row[surname]"; ?>" /></td> </tr> <tr> <td>Level:</td> <td>Therapy:</td> </tr> <tr> <td> <select name="program_level"> <option <?php if ($row[program_level]=='1') echo "selected=yes"; ?> value="1">O&A</option> <option <?php if ($row[program_level]=='2') echo "selected=yes"; ?> value="2">Student</option> <option <?php if ($row[program_level]=='3') echo "selected=yes"; ?> value="3">Supervisor</option> <option <?php if ($row[program_level]=='4') echo "selected=yes"; ?> value="4">Manager</option> <option <?php if ($row[program_level]=='5') echo "selected=yes"; ?> value="5">Director</option> <option <?php if ($row[program_level]=='6') echo "selected=yes"; ?> value="6">Graduate</option> </select> </td> <td> <!-- Auto drop down for therapist names--> <? $query2=mysql_query("select * from therapy_info;"); ?> <select name='therapy'> <? while ($row=mysql_fetch_assoc($query2)){ ?> <option value="<? echo "$row[therapy_name]"; ?>"> <? echo "$row[therapy_name]"; } ?> </option> </select> <!-- End Auto drop down for therapist names--> </td> </tr> <tr> <td>Active:<?php echo "$row[active]"; ?></td> </tr> <tr> <td><select name='active' value='$row[active]'> <option <?php if ($row[active]=='1') echo "selected=yes"; ?> value='1'>Active</option> <option <?php if ($row[active]=='0') echo "selected=yes"; ?> value='0'>Inactive</option> </select> </td> </tr> <?php print "<tr> <td><input type='submit' value='Change' name='button' /></td> <input type='hidden' name='id' value='$id' />"; ?> <input type='hidden' name='$hardcode_session' /> <? print "</tr> </form> </table>"; hai everybody....
1. can any one let me know how to pass a variable from view to controller in CodeIgniter...
2. if possible send me a complete login application...developed by using CodeIgniter....
Thanks & Regards,
Shankaar.
I'm a newbie here and to php and Javascript. So hello all. I am trying to get a portion of a file name passed from one file (first.php) which displays a MySql table. One of the fields is a link that is supposed to open a popup window (second.php) and begin playing a mp3 file with the flash media player. I have everything (almost) working. The table displays as it should, the link is fine. However, I can not get the popup to open with the dimensions I asked for. It opens in a full size new window. And the mp3 will not play. I get the message from the player "we are unable to connect...etc etc". The file name shows up in the status bar and in the URL window. In the file first.php, the table displays, the links appear to be active. when clicked the new window opens, the file names carry over but I can not get the file to play. The player loads (in file second.php) but I get the message from the player "we are unable to connect...etc etc". I suspect it is in the syntax. I have tried so many combinations I can't list them here and so far I have been unable to find anything on google, etc to answer this. After almost three days I have resorted to here. This may not even be the right place for me. Javascript may be my best bet for all I know. Can someone please look over what I have and at least point me in the right direction? Any help is greatly appreciated as this is my first attempt at a website. Thanks first.php Code: [Select] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script language="JavaScript"> <!-- Begin function popUp(URL) { playwindow=window.open(URL, 'name', 'toolbar=0,scrollbars=1,location=1,statusbar=1,menubar=0,resizable=1,width=350,height=250'); } // End --> </script> <script language="JavaScript"> <!-- function openPlayer(URL) { player = window.open('player10.php?','width=350,height=275') } // End --> </script> <?php $username="myusername"; $password="mypassword"; $database="mydb"; mysql_connect('mydb',$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $query="SELECT * FROM mytable"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); ?> </head> <body> <table border="1" cellspacing="2" cellpadding="2"> <tr> <th><font face="Arial, Helvetica, sans-serif">Listen</font></th> <th><font face="Arial, Helvetica, sans-serif">f2</font></th> <th><font face="Arial, Helvetica, sans-serif">f3</font></th> <th><font face="Arial, Helvetica, sans-serif">f4</font></th> <th><font face="Arial, Helvetica, sans-serif">f5</font></th> <th><font face="Arial, Helvetica, sans-serif">f6</font></th> </tr> <?php $i=0; while ($i < $num) { $f1=mysql_result($result,$i,"listen"); $f2=mysql_result($result,$i,"field2"); $f3=mysql_result($result,$i,"field3"); $f4=mysql_result($result,$i,"field4"); $f5=mysql_result($result,$i,"field5"); $f6=mysql_result($result,$i,"field6"); ?> <tr> <td><font face="Arial, Helvetica, sans-serif"><a href="javascript:openPlayer('player10.php?<?php echo $f1?>')">Listen</a></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f2; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f3; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f4; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f5; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f6; ?></font></td> </tr> <?php $i++; } ?> </body> </html> SECOND.PHP Code: [Select] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" > <meta http-equiv="X-UA-Compatible" content="IE=8" > <title>My Title </title> <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" > <script language="JavaScript" type="text/javascript"> <!-- // // Make sure there's some data // if (location.search) { // // Extract the name of the graphics file // var mp3_filename = location.search.substring(1) // // Write the <IMG> tag using the name of the graphics // file (you may need to adjust the SRC text) // document.write('<a href="http://mywebsite.com/+mp3_filename">') } // End --> </script> </head> <body> <object width="400" height="300"> <param name="movie" value="http://fpdownload.adobe.com/strobe/FlashMediaPlayback.swf"> </param> <param name="flashvars" value="src=http%3A%2F%2Fmywebsite.com%2Faudio%2F+mp3_filename"> </param> <param name="allowFullScreen" value="true"> </param> <param name="allowscriptaccess" value="always"> </param> <embed src="http://fpdownload.adobe.com/strobe/FlashMediaPlayback.swf" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="400" height="300" flashvars="src=http%3A%2F%2Fmywebsite.com%2Faudio%2F+mp3_filename"> </embed> </object> </body> </html> Hi, I'm trying to edit some database fields, I have text1, text2, text3, text4, text5, text6 etc.. They are displayed on the index.php page, with an edit link so the user can choose which set to edit // Extract details from database $sql = "SELECT * FROM data WHERE id=1"; $stmt = $db->prepare($sql); $stmt->execute(); $e = $stmt->fetch(); <h1><?php echo $e['text1']) ?></h1> <p><?php echo ($e['text2']); ?></p> <p><a href="edit.php">EDIT</a></p> <h1><?php echo $e['text3']) ?></h1> <p><?php echo ($e['text4']); ?></p> <p><a href="edit.php">EDIT</a></p> <h1><?php echo $e['text5']) ?></h1> <p><?php echo ($e['text6']); ?></p> <p><a href="edit.php">EDIT</a></p>
edit.php: // Extract details from database $sql = "SELECT * FROM data WHERE id=1"; $stmt = $db->prepare($sql); $stmt->execute(); $e = $stmt->fetch(); <form method="post" action="process.php" enctype="multipart/form-data"> <label>Page Title <input type="text" name="text1" maxlength="90" value="<?php echo $e['text1'] ?>" /> </label> <br> <label>Title Text</label> <textarea name="text2"><?php echo $e['text2'] ?></textarea> <input id="button" type="submit" name="submit" value="Save Changes" /> and then update them: process.php $sql = "UPDATE data SET text1=?, text2=? WHERE id=1 LIMIT 1"; $stmt = $db->prepare($sql); $stmt->execute( array( $_POST['text1'], $_POST['text2'] ) ); $stmt->closeCursor(); Question: How can I pass the form values dynamically from the index.php page so I don't have to hard code text1, text2 etc into the edit.php and process.php page and have a different update & process page for each set of data?
Thanks in advance. I have some function or method. Is there a better design patter to implement this?
function myFunction($a=null,$b=null,$c=null,$d=null,$e=null,$f=null,$g=null,$h=null) { //Do a bunch of stuff }Maybe the second function? function myNewFunction($data=array()) { $data=array_merge(array('a'=>null,'b'=>null,'c'=>null,'d'=>null,'e'=>null,'f'=>null,'g'=>null,'h'=>null),$array); //Do a bunch of stuff }Please provide decision making factors why you would use one approach over the other. Hi guys, I've been going crazy over this and I'm hoping someone can help me. I'm making a website for a friend and I'm stuck on sending the model over to the contact page (from one form to another on a different page using $_POST). Here is the website : www.ipgetter.com/test I have successfully posted the Make variable to the contact us page, but I can't get the model sent over (the select boxes have different names). Example: Code: [Select] <select class="form-dropdown" style="width:150px" id="input_2" name="q2_make"> <option selected="selected" value="Alfa Romeo"> Alfa Romeo </option> <option value="Aston Martin"> Aston Martin </option> <option value="Audi"> Audi </option> <option value="Bently"> Bently </option> <option value="BMW"> BMW </option> <option value="Chevrolet"> Chevrolet </option> <option value="Chrysler"> Chrysler </option> <option value="Citroen"> Citroen </option> <option value="Ferrari"> Ferrari </option> <option value="Fiat"> Fiat </option> <option value="Ford"> Ford </option> <option value="Honda"> Honda </option> <option value="Hyundai"> Hyundai </option> <option value="Infiniti"> Infiniti </option> <option value="Isuzi"> Isuzi </option> <option value="Jaguar"> Jaguar </option> <option value="Jeep"> Jeep </option> <option value="Kia"> Kia </option> <option value="Lamborghini"> Lamborghini </option> <option value="Land Rover"> Land Rover </option> <option value="Lexus"> Lexus </option> <option value="Lotus"> Lotus </option> <option value="Maserati"> Maserati </option> <option value="Mazda"> Mazda </option> <option value="Mclaren"> Mclaren </option> <option value="Mercedes-Benz"> Mercedes-Benz </option> <option value="MG"> MG </option> <option value="Mini"> Mini </option> <option value="Mitsubishi"> Mitsubishi </option> <option value="Nissan"> Nissan </option> <option value="Peugeot"> Peugeot </option> <option value="Porsche"> Porsche </option> <option value="Renault"> Renault </option> <option value="Rolls-Royce"> Rolls-Royce </option> <option value="Seat"> Seat </option> <option value="Skoda"> Skoda </option> <option value="Smart"> Smart </option> <option value="Ssangyong"> Ssangyong </option> <option value="Subaru"> Subaru </option> <option value="Suzuki"> Suzuki </option> <option value="Toyota"> Toyota </option> <option value="Vauxhall"> Vauxhall </option> <option value="Volkswagen"> Volkswagen </option> <option value="Volvo"> Volvo </option> <option value="Other"> Other </option> </select> That's the make, as for the model, the select boxes have different names so how am I supposed to capture the users selection and POST it? Code: [Select] <li class="form-line" id="id_3"> <label id="label_3" for="input_3"></label> <div id="cid_3" class="form-input"> <select class="form-dropdown" style="width:150px" id="input_3" name="q3_model"> <option selected="selected" value="147"> 147 </option> <option value="159"> 159 </option> <option value="8C"> 8C </option> <option value="Breva"> Breva </option> <option value="Giulietta"> Giulietta </option> <option value="Mito"> Mito </option> <option value="Other"> Other </option> </select> </div> </li> <li class="form-line" id="id_4"> <label id="label_4" for="input_4"></label> <div id="cid_4" class="form-input"> <select class="form-dropdown" style="width:150px" id="input_4" name="q4_model4"> <option selected="selected" value="Cygnet"> Cygnet </option> <option value="DB9"> DB9 </option> <option value="DBS"> DBS </option> <option value="Rapide"> Rapide </option> <option value="Vantage"> Vantage </option> <option value="Virage"> Virage </option> <option value="Other"> Other </option> </select> </div> </li> I want to post only the selected make/model depending on the user selection. So my question is, how can I send the users chosen model selection over to the contact page form where there is more than one different select box? These select boxes are conditional so when you select "other" as make or model make/model, you may type one in. I'd like to send that also. Any help is appreciated guys, thanks so much. Hey people, I know this is going back to basics but i'm just learning and want to make sure I do it all correctly. I want to pass variable's from one page to another. Now currently say I wanted to hold the users age and email address from his record in the database from page A and pass it to page B for it to be displayed back to him I would store each in their own session variable (so for the purpose of the explanation session_user_email=me@email.com and session_user_age=18. On page B I would then call the session and store it in a variable then destroy the session. Just out of curiosity is the the best way to pass the data? or should i use another method? i've read about session hijacking and i'm now worried about holding personal data within a session so i'm wondering what other people do?? Cheers |