snowdog
Members-
Posts
105 -
Joined
-
Last visited
Everything posted by snowdog
-
Update: I have completed my php code that ajax will access. I have read tutorials out the wazoo and think I have come up with my ajax call. I need to populate a new drop down with the returned code from the php file. Having a hard time understanding how to get the information out of the returned array and jsdon decoded no to loop through the information and create the drop downs I guess with javascript now? Here is the code so far: Jquery ajax function: <script id="source" language="javascript" type="text/javascript"> jQuery(function () { //----------------------------------------------------------------------- // 1) Send a http request with AJAX //----------------------------------------------------------------------- jQuery.ajax({ url: 'ajax/appointment_ajax_1.php', //the script to call to get data data: "dealer_id = " + jQuery('dealer_id').val(), //you can insert url argumnets here to pass to api.php //for example "id=5&parent=6" dataType: 'json', //data format success: function(data) //on recieve of reply { var first = data[0]; //get firstname var last = data[1]; //get lastname var id = data[2]; //get id //-------------------------------------------------------------------- // 2) Update Dealer's Staff Select Box //-------------------------------------------------------------------- jQuery('#output').html("<option name = 'name' value = "+id+">"+first+" "+last"</option>"); //Set option value and display } }); }); </script> And here is the php file: <?php //-------------------------------------------------------------------------- // php/ajax script for onchange from add appointments //-------------------------------------------------------------------------- session_start(); //-------------------------------------------------------------------------- // 1) Connect to mysql database //-------------------------------------------------------------------------- include("../include/db_connect.php"); //-------------------------------------------------------------------------- // 2) Query database for data //-------------------------------------------------------------------------- // Create container array $dealer_staff_array = array(); $franchise_id = $_SESSION['franchise_id']; $dealer_id = $_POST['dealer_id']; $SQL = "SELECT * FROM login WHERE franchise_id = '$franchise_id' and dealer_id = '$dealer_id' ORDER BY name ASC"; $result = mysql_query($SQL) or die(mysql_error()); while($row = mysql_fetch_array($result)) { //-------------------------------------------------------------------------- // 3) echo result as json string //-------------------------------------------------------------------------- $response = array( 'first' => $row['first'], 'last' => $row['last'], 'id' => $row['id'] ); array_push($dealer_staff_array, $response); } echo json_encode($response); ?> Any help would be appreciated. Thanks Snowdog
-
I have a dealers select box that when I select it, I then want to load the dealers staff names into the next select box. I have been reading and I have this as the progress in my head. on submit, the ajax needs to send over the dealer_id to a php file that will then do a database query to get the staff members of that dealer_id and send the name and staff_id back to the html page to populate the dealers_staff select box. Once that is done it needs to do it all over again to get the dealers_staff member's name, email address and contact numbers to ill in some text boxes. So I think I understand what has to happen just don't know what to do to make it happen now. Thanks Snowdog
-
so stupid, the second I had it as $nbsp; always something stupid I over look. Thanks Everyone.
-
108 while($run = mysql_fetch_array($result)) 109 { 110 111 echo("<tr><td> $run['vinNumber'] </td><td> $run['carYear'] $nbsp; $run['carModel'] </td><td><img src='franchises/franchise_id_{$franchise_id}/lotImages/dealer_id_{$dealer_id}/lot_id_{$run['id']}/wheelFL.jpeg'></td></tr>"); 112 113 }
-
Here is my error: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /var/www/vhosts/bookawrs.com/httpdocs/lot.php on line 111 Here is part of the code giving me the problems $SQL = "SELECT * FROM lot WHERE franchise_id = '$franchise_id' and dealer_id = '$dealer_id' ORDER BY id ASC"; $result = mysql_query($SQL) or die(mysql_error());[/size][/font][/color] [color=#000000][font='Times New Roman'][size=1]while($run = mysql_fetch_array($result)) {[/size][/font][/color] [color=#000000][font='Times New Roman'][size=1]echo("<tr><td> $run['vinNumber'] </td><td> $run['carYear'] $nbsp; $run['carModel'] </td><td><img src='franchises/franchise_id_{$franchise_id}/lotImages/dealer_id_{$dealer_id}/lot_id_{$run['id']}/wheelFL.jpeg'></td></tr>");[/size][/font][/color] [color=#000000][font='Times New Roman'][size=1]}
-
Help with concatination and proper code layout
snowdog replied to snowdog's topic in PHP Coding Help
yes and not understanding it -
I have to display 4 images in a table. The images are held in a directory structure that goes like this: franchises\franchise_id_1\lotImages\dealer_id_1\lot_id_1\wheelFL.jpeg Each 1 is actually a variable that comes from the database and depends on what dealer and franchise is logged in. Here is how I would write it: I can only assume it is not the proper way to do it. Any suggestions on the proper way to write something like this? <?php echo("<tr><td> $run['vinNumber'] </td><td> $run['carYear'] $nbsp; $run['carModel'] </td><td><img src='franchises/franchise_id_."$franchise_id"./lotImages/dealer_id_."$dealer_id"./lot_id."$run['id']".wheelFL.jpeg'></td></tr>"); ?>
-
I don't mind paying if it is good. I see it has a 30 day trial, will give it a shot thanks. I am self taught and need to update my coding skills now with the new release of php for sure. Thanks for all of your help. I will be posting another problem I am having as I cannot find the proper way to do this so check it out
-
Thanks scootstah, do you have any suggestions for a good one? I use cute ftp as I can edit and upload in the same program.
-
how is the data input into the database? Is someone inputting the data and hitting a submit button?
-
I cannot see the error for the life of me. I know it is going to be a simple one. Always is when I cant see it. Here is the error Parse error: syntax error, unexpected $end in /var/www/vhosts/bookawrs.com/httpdocs/lot.php on line 138 and the code <? include("include/db_connect.php"); session_start(); include("header.php"); include("search.php"); include("top_menu.php"); include("left_menu.php"); ?> <div class="maincontent"> <div class="breadcrumbs"> <a href="dashboard.html">Dashboard</a> <span>Table Styling</span> </div><!-- breadcrumbs --> <div class="left"> <h1 class="pageTitle">Table Styling</h1> <? if($_SESSION['dealer_id'] != 0) { if(isset($_SESSION['dealer_id'])){ { echo(" I AM HERE IN DEALER SECTION"); $dealer_id = $_SESSION['dealer_id']; } } else { // This is an Franchise, get the list of dealers $franchise_id = $_SESSION['franchise_id']; $SQL = "SELECT * FROM dealers WHERE franchise_id = $franchise_id ORDER BY name ASC"; $result = mysql_query($SQL) or die(mysql_error()); ?> <select> <option>Select Dealer</option> <? while($run = mysql_fetch_array($result)) { ?> <option value = "<?php echo $run['id'];?>"><?php echo $run['name'];?></option> <? } ?> </select> <? } ?> <div class="sTableOptions"> <h4>Cars on Lot</h4> </div><!--sTableOptions--> <table cellpadding="0" cellspacing="0" class="sTableHead" width="100%"> <colgroup> <col class="head1" width="25%" /> <col class="head0" width="25%" /> <col class="head1" width="15%" /> <col class="head0" width="10%" /> <col class="head1" width="10%" /> <col class="head0" width="15%" /> </colgroup> <tr> <td>Vin Numner</td> <td>Year Model</td> <td>Left Front</td> <td>Right Front</td> <td>Left Rear</td> <td>Righ Rear</td> </tr> </table> <div class="sTableWrapper"> <table cellpadding="0" cellspacing="0" class="sTable" width="100%"> <colgroup> <col class="con1" width="25%" /> <col class="con0" width="25%" /> <col class="con1" width="15%" /> <col class="con0" width="10%" /> <col class="con1" width="10%" /> <col class="con0" width="15%" /> </colgroup> <? // Get the cars that are on the lot from the dealer being called $SQL = "SELECT * FROM lot WHERE franchise_id = $franchise_id and dealer_id = $dealer_id ORDER BY date ASC"; $result = mysql_query($SQL) or die(mysql_error()); while($run = mysql_fetch_array($result)) { ?> <tr><td><?php echo $run['vinNumber'];?></td><td><?php echo $run['carYear'];?> $nbsp;<?php echo $run['carModel'];?></td><td><img src="">pic 1</td><td><img src="">pic 2</td><td><img src="">pic 3</td><td><img src="">pic 4</td></tr> <? } ?> </table> </div><!--sTableWrapper--> <br /> </div><!--left--> <br clear="all" /> </div><!--maincontent--> <? include("footer.php"); ?>
-
I want the submit button to disappear after it has been clicked. Guys are too impatient and it is inputting multiple database lines. Can I use javascript to make the button disappear on click? Snowdog
-
Stupid me, the , needs to be AND . Solved Snowdog
-
My eyes just don't see it. I am sure it is simple and stupid. Here is the code and error $query_check = "select * from spares where level = '$level', skill = '$skill', date = '$date', time = '$game_time', team = '$team_name', position = '$position', player_id = '$player_id'"; $result_check = mysql_query($query_check) or die('Query failed: ' . mysql_error()); Query failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' skill = 'b', date = '2013-02-24', time = '8:30', team = '8', position = 'f', pl' at line 1 Thanks Snowdog
-
I will try to explain this and make it simple. I am having a iphone app and I have been able to interact with it no problems until it comes down to the file upload now. I have never done file uploads from a form before. There could be anywhere from 1-4 pictures and it will be: 4 $_FILES in a photos[] array, with the file names: wheelFL.jpeg wheelFR.jpeg wheelRL.jpeg wheelRR.jpeg Here is the code I have written so far, the files need to be uploaded to a directory called franchises/1 // SEND API if ( isset($_POST["send"])) { $dealer = $_POST['dealer']; $vinNumber = $_POST['vinNumber']; $carMake = ['carMake']; $carModel = ['carModel']; $carYear = ['carYear']; $franchise_id = $_SESSION['franchise_id']; // INSERT THE INFO INTO THE LOT DATABASE $SQL = "INSERT INTO lot (franchise_id,dealer_id,vinNumber,carMake,carModel,carYear,created,modified) VALUES ('$franchise_id','$dealer_id','$vinNumber','$carMake','$carModel','$carYear',NOW(),NOW())"; $result = mysql_query($SQL) or die('Query failed: ' . mysql_error()); $lot_id = mysql_insert_id(); // UPLOAD THE PICTURES OF THE RIMS } I am feeling completely lost on the file upload thing here. Thanks for any help. Snowdog
-
Looks like to me there is an error in your nesting. You have double end braces. I nest differently then you do but I changed it over and you have a double end there in red and missing one below at bottom. I will add my nested code in also. }else{ $msg3 .= "Sorry, we could not register your account details, if this persists contact the webmaster. "; [color=#ff0000]} }[/color]else{ $msg3 .= "Sorry, we could not register your account details, if this persists contact the webmaster. "; } } } } <?php if($_POST["submitReg"]) { $validateArray = array("name" => "text", "email" => "email"); foreach($validateArray as $key => $value) { if($value == "text") { $key = htmlspecialchars(mysql_real_escape_string($_POST[$key])); } else { $key = mysql_real_escape_string($_POST[$key]); } if(empty($key)) { $msg3 = "Please fill in all fields of this form."; } } $regName = htmlspecialchars(mysql_real_escape_string($_POST["name"])); $regUsername = htmlspecialchars(mysql_real_escape_string($_POST["username"])); $regPassword = htmlspecialchars(mysql_real_escape_string($_POST["password"])); $regREpassword = htmlspecialchars(mysql_real_escape_string($_POST["rePassword"])); $email = mysql_real_escape_string($_POST["email"]); if(preg_match("^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+.[a-zA-Z0-9-.]+$", $_POST["email"]) === 0) { $msg3 .= "Please enter a valid email."; } else { if($regPassword != $regREpassword || $regREpassword != $regPassword) { $msg3 .= "The password fields didn't match."; } else { $check = select("*", "members", "username = '$regUsername'"); $assoc = mysql_fetch_assoc($check); if($regUsername == $assoc["username"]) { $msg3 .= "That username has been taken, pick another."; } else { $regPassword = sha1($regPassword); $id = uniqid(); $register = insert("members", "name, email, username, password, user_level, id, ban", "'$regName', '$email', '$regUsername', '$regPassword', 1, '$id', 0"); if($register) { $newsTitle = "New member registered!"; $cont = $regUsername." has just joined Fusion Forums!<br>"; $cont.= "Check out his/her profile:<br><br>"; $cont.= "View Profile"; $newsCont = $cont; $newMem = insert("news", "news_title, news_content, username", "'$newsTitle', '$newsCont', '$regUsername'"); if($newMem) { $to = $email; $subject = "Fusion Forums - Account Confirmation"; $message = "Hello! You have recently registered to Fusion Forum's.<br><br>"; $message.= "This is a confirmation email, below you will find your account details along with a Unique ID.<br><br>"; $message.= "In order to activate your account you must first enter the ID into the text field that follows the link at the end of this email. Your details are as follows:<br><br>"; $message.= "<table>"; $message.= "<tr>"; $message.= "<td><strong>Name:</strong></td>"; $message.= "<td></td>"; $message.= "<td>".$regName."</td>"; $message.= "</tr>"; $message.= "<tr>"; $message.= "<td><strong>Email:</strong></td>"; $message.= "<td></td>"; $message.= "<td>".$email."</td>"; $message.= "</tr>"; $message.= "<tr>"; $message.= "<td><strong>Username:</strong></td>"; $message.= "<td></td>"; $message.= "<td>".$regUsername."</td>"; $message.= "<tr>"; $message.= "<tr>"; $message.= "<td><strong>Unique ID:</strong></td>"; $message.= "<td></td>"; $message.= "<td>".$id."</td>"; $message.= "<tr>"; $message.= "</table><br><br>"; $message.= "Please follow this link in order to activate your account (opens in your default browser):<br>"; $message.= "<a href='http://www.janedealsart.co.uk/activate.php?id=".$id."'>Activate Account</a>"; $from = "noreply@janedealsart.co.uk"; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers.= "From: ".$from; mail($to, $subject, $message, $headers); $done = "You have successfully registered to Fusion Fourm's.<br>"; $done.= "We have sent you an email with a confirmation code on it,"; $done.= " when you go to confirm your account you will need this code in order to be able to access the forum's."; $msg2 .= $done; } else { $msg3 .= "Sorry, we could not register your account details, if this persists contact the webmaster. "; } else { $msg3 .= "Sorry, we could not register your account details, if this persists contact the webmaster. "; } } } } if($msg2) { echo '<div class="success">Success: '.$msg2.'</div>'; } else { if($msg3) { echo '<div class="error">Error: '.$msg3.'</div>'; } } echo '<form action="" method="POST">'; echo '<label>Full Name:</label>'; echo '<input type="text" class="field" name="name" />'; echo '<div class="clear"></div>'; echo '<label>Email:</label>'; echo '<input type="text" class="field" name="email" />'; echo '<div class="clear"></div>'; echo '<label>Username:</label>'; echo '<input type="text" class="field" name="username" />'; echo '<div class="clear"></div>'; echo '<label>Password:</label>'; echo '<input type="password" class="field" name="password" />'; echo '<div class="clear"></div>'; echo '<label>Again:</label>'; echo '<input type="password" class="field" name="rePassword" />'; echo '<div class="clear"></div>'; echo '<input type="submit" class="button" name="submitReg" value="Register" />'; echo '<div class="clear"></div>'; echo '</form>'; } ?>
-
I would like after the user picks the counrty of CAN or USA the appropriate list of provinces or states shows up. Can I do this using javascript by hidding both then on change show the right one? I am a newbie here with javascript. Here is my prov/state code <p> <label for="state">Franchise State</label> <select class="target" name="f_state_prov"> <option>Choose One</option> <option value="AL">Alabama</option> <option value="AK">Alaska</option> <option value="AZ">Arizona</option> <option value="AR">Arkansas</option> <option value="CA">California</option> <option value="CO">Colorado</option> <option value="CT">Connecticut</option> <option value="DE">Delaware</option> <option value="DC">Dist of Columbia</option> <option value="FL">Florida</option> <option value="GA">Georgia</option> <option value="HI">Hawaii</option> <option value="ID">Idaho</option> <option value="IL">Illinois</option> <option value="IN">Indiana</option> <option value="IA">Iowa</option> <option value="KS">Kansas</option> <option value="KY">Kentucky</option> <option value="LA">Louisiana</option> <option value="ME">Maine</option> <option value="MD">Maryland</option> <option value="MA">Massachusetts</option> <option value="MI">Michigan</option> <option value="MN">Minnesota</option> <option value="MS">Mississippi</option> <option value="MO">Missouri</option> <option value="MT">Montana</option> <option value="NE">Nebraska</option> <option value="NV">Nevada</option> <option value="NH">New Hampshire</option> <option value="NJ">New Jersey</option> <option value="NM">New Mexico</option> <option value="NY">New York</option> <option value="NC">North Carolina</option> <option value="ND">North Dakota</option> <option value="OH">Ohio</option> <option value="OK">Oklahoma</option> <option value="OR">Oregon</option> <option value="PA">Pennsylvania</option> <option value="RI">Rhode Island</option> <option value="SC">South Carolina</option> <option value="SD">South Dakota</option> <option value="TN">Tennessee</option> <option value="TX">Texas</option> <option value="UT">Utah</option> <option value="VT">Vermont</option> <option value="VA">Virginia</option> <option value="WA">Washington</option> <option value="WV">West Virginia</option> <option value="WI">Wisconsin</option> <option value="WY">Wyoming</option> </select> </p> <div id="other"> <p> <label for="province">Franchise Province</label> <select name="f_state_prov"> <option>Choose One</option> <option value="AB">Alberta</option> <option value="BC">British Columbia</option> <option value="MB">Manitoba</option> <option value="NB">New Brunswick</option> <option value="NF">New Foundland</option> <option value="NT">Northwest Territories</option> <option value="NS">Nova Scotia</option> <option value="NT">Nunavut</option> <option value="ON">Ontario</option> <option value="PI">Prince Edward Island</option> <option value="PQ">Quebec</option> <option value="SA">Saskatchewan</option> <option value="YT">Yukon Territory</option> </select> </p> </div> Thanks for the help everyone
-
Thank you very much, That worked
-
ok now have gotten further, The error was a comma instead of a semi colon after $i=0. Now I am getting this array(7) { ["dealer_id"]=> string(2) "16" ["first_name"]=> string(5) "James" ["last_name"]=> string( "Clausner" ["department"]=> string(1) "3" ["phone"]=> array(2) { [0]=> string(10) "4168887467" [1]=> string(12) "905-833-6888" } ["type"]=> array(2) { [0]=> string(1) "1" [1]=> string(1) "1" } ["email"]=> string(15) "james@james.com" } COUNT: 2 The array row is: 0 The array row is: 1 but as soon as I add in, get white screen var_dump($_POST); $array_count = count($_POST['phone']); echo("<br><br>COUNT: $array_count <br><br><br>"); for ($i = 0; $i < $array_count; $i++) { echo("The array row is: $i <br>"); echo(" $_POST['type'][$i] = $_POST['phone'][$i] <br>"); }
-
I have the right information coming through, the right count is there. But as soon as I uncomment the for loop it gives me the white screen of death. I can't find the stupid error. Here is the output array(7) { ["dealer_id"]=> string(2) "16" ["first_name"]=> string(5) "James" ["last_name"]=> string( "Clausner" ["department"]=> string(1) "3" ["phone"]=> array(3) { [0]=> string(10) "4168887467" [1]=> string(10) "9058336888" [2]=> string(10) "4164536935" } ["type"]=> array(3) { [0]=> string(1) "1" [1]=> string(1) "3" [2]=> string(1) "2" } ["email"]=> string(15) "james@james.com" } COUNT: 3 Here is the for loop code var_dump($_POST); $array_count = count($_POST['phone']); echo("<br><br>COUNT: $array_count "); for ($i = 0, $i < $array_count; $i++) { echo(" $i <br>"); } ?>
-
ok so the values are coming through properly now. I have eliminated everything out of the process page but the array loop and am getting no output . My guess is the area of problem is in the loop where I am trying to count the number of rows in the array. <?php include("include/db_connect.php"); SESSION_START(); for( $i = 0; $i < count($_POST['phone']); $i++ ) { echo(" $_POST['type'][$i] = $_POST['phone'][$i] <br>"); } //var_dump($_POST); ?>
-
Think I might have found it. I had Session_start() turned off on the input page and now I am getting this. array(7) { ["dealer_id"]=> string(2) "17" ["first_name"]=> string(5) "James" ["last_name"]=> string( "Clausner" ["department"]=> string(1) "3" ["phone"]=> array(1) { [0]=> string(10) "4164536935" } ["type"]=> array(1) { [0]=> string(1) "2" } ["email"]=> string(15) "james@james.com" }
-
Thanks White, I do have problems with arrays just can't grasp my head around them sometimes. Am going to scour the previous page and see if I can find it. Knowing me it is something very simple and stupid that I have missed.
-
Here is the output : array(0) { } and here is the code from previous page <?php include("include/header.php"); include("include/top_menu.php"); include("include/left_menu.php"); ?> <div class="maincontent"> <div class="breadcrumbs"> <a href="dashboard.html">Dashboard</a> <span>Add Staff</span> </div><!-- breadcrumbs --> <div class="left"> <h1 class="pageTitle">Add Staff</h1> <form action="process_add_staff.php" method="post"> <div class="form_default"> <fieldset> <legend>Add Staff</legend> <p> <label for="occupation">Choose Dealer</label> <select name="dealer_id"> <option>Choose Dealer</option> <?php // Load The dealers in for the franchisee include("include/db_connect.php"); //SESSION_START(); $franchise_id = $_SESSION['franchise_id']; // Query the database and get dealers $SQL = "SELECT * FROM dealers WHERE franchise_id = '$franchise_id' ORDER BY name ASC"; $result = mysql_query($SQL) or die(mysql_error()); while($run = mysql_fetch_array($result)) { ?><option value="<?php echo $run['id']; ?>"><?php echo $run["name"]; ?></option> <?php } ?> </select> </p> <p> <label for="name">First Name</label> <input type="text" name="first_name" class="sf" /> </p> <p> <label for="name">Last Name</label> <input type="text" name="last_name" class="sf" /> </p> <p> <label for="department">Department</label> <select name="department"> <option>Choose Department</option> <?php // Load The departments in // Query the database and get dealers $SQL = "SELECT * FROM departments WHERE franchise_id = '$franchise_id' ORDER BY department ASC"; $result = mysql_query($SQL) or die(mysql_error()); while($run = mysql_fetch_array($result)) { ?><option value="<?php echo $run['id']; ?>"><?php echo $run["department"]; ?></option> <?php } ?> </select> </p> <p class="number"> <label for="name">Phone Number</label> <input type="text" name="phone[]" class="sf" /> <select name="type[]"> <option value="1">Office</option> <option value="2">Cell</option> <option Value="3">Fax</option> </select> <a href="javascript:void();" class="add_phone">Add More</a> </p> <p> <label for="name">Phone Number</label> <input type="text" name="phone_1" class="sf" /> </p> <p> <label for="email">Email</label> <input type="text" name="email" class="sf" /> </p> <p> <button>Submit</button> </p> </fieldset> </div><!--form--> </form> <br /> </div><!--fullpage--> <br clear="all" /> </div><!--maincontent--> <?php include("include/footer.php"); ?>
-
Here is the code <?php // include("include/db_connect.php"); // SESSION_START(); //$dealer_name = $_REQUEST['d_name']; //$d_address = $_REQUEST['d_address']; //$d_city = $_REQUEST['d_city']; //$d_country = $_REQUEST['d_country']; //$d_state_prov = $_REQUEST['d_state_prov']; //$d_zip = ereg_replace("[^0-9a-zA-Z]","", $_REQUEST['d_zip']); //$d_phone_1 = ereg_replace("[^0-9]", "", $_REQUEST['d_phone_1']); //$d_email = $_REQUEST['d_email']; //$franchise_id = $_SESSION['franchise_id']; //$username = $d_email; //$password = $d_phone_1; //$website = $_REQUEST['website']; //$SQL = "INSERT INTO dealers (franchise_id, name, address, city, state, zip, country, website, created, modified) // VALUES ('$franchise_id','$dealer_name','$d_address','$d_city','$d_state_prov','$d_zip','$d_country','$website',NOW(),NOW())"; //$result = mysql_query($SQL) or die('Query failed: ' . mysql_error()); //$dealer_id = mysql_insert_id(); //$SQL = "INSERT INTO login (franchise_id,dealer_id,department_id,first,last,email,username,password,created,modified) // VALUES ('$franchise_id','$dealer_id','1','$first_name','$last_name','$d_email','$username','$password',NOW(),NOW())"; //$result = mysql_query($SQL) or die('Query failed: ' . mysql_error()); // Redirect back to add_staff.php //header('Location: add_staff.php?m=1') ; for( $i = 0; $i < count($_REQUEST['phone']); $i++ ) { echo(" $_REQUEST['type'][$i] = $_REQUEST['phone'][$i] <br>"); } ?>