
brownbrod
Members-
Posts
23 -
Joined
-
Last visited
Everything posted by brownbrod
-
Thank you!! That's what was wrong!!! I greatly appreciate your help. Have a wonderful day!!!
-
Yes, I have this first: session_start(); $_SESSION['name'] = $_POST['name']; $_SESSION['cslogin'] = $_POST['cslogin']; $_SESSION['domain'] = $_POST['domain']; $_SESSION['project'] = $_POST['project']; $_SESSION['ODM'] = $_POST['ODM']; $_SESSION['hwphase'] = $_POST['hwphase']; $_SESSION['ppmid'] = $_POST['ppmid']; $_SESSION['survey'] = $_POST['survey']; $_SESSION['month'] = $_POST['month']; Then it is directed to this: session_start(); $_SESSION['name'] = $_POST['name']; $_SESSION['cslogin'] = $_POST['cslogin']; $_SESSION['domain'] = $_POST['domain']; $_SESSION['project'] = $_POST['project']; $_SESSION['ODM'] = $_POST['ODM']; $_SESSION['hwphase'] = $_POST['hwphase']; $_SESSION['ppmid'] = $_POST['ppmid']; $_SESSION['survey'] = $_POST['survey']; $_SESSION['month'] = $_POST['month']; $_SESSION['Q1'] = $_POST['Q1']; $_SESSION['comment1'] = $_POST['comment1']; The for the question 2 start I have this: session_start(); $name = $_SESSION['name']; $cslogin = $_SESSION['cslogin']; $domain = $_SESSION['domain']; $project = $_SESSION['project']; $ODM = $_SESSION['ODM']; $hwphase = $_SESSION['hwphase']; $ppmid = $_SESSION['ppmid']; $survey = $_SESSION['survey']; $month = $_SESSION['month']; $Q1 = $_SESSION['Q1']; $comment1 = $_SESSION['comment1']; So I should eliminate question 2 start and leave it as is?
-
The next page after the POST data page is this: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>Question 2</title> </head> <body> <?php session_start(); $name = $_SESSION['name']; $cslogin = $_SESSION['cslogin']; $domain = $_SESSION['domain']; $project = $_SESSION['project']; $ODM = $_SESSION['ODM']; $hwphase = $_SESSION['hwphase']; $ppmid = $_SESSION['ppmid']; $survey = $_SESSION['survey']; $month = $_SESSION['month']; $Q1 = $_SESSION['Q1']; $comment1 = $_SESSION['comment1']; ?> Name: <?php echo $_SESSION['name'];?><br> Q1: <?php echo $_SESSION['Q1'];?><br> Comments: <?php echo $_SESSION['comment1'];?><br> Is this where I am loosing the data? How would I re-send the POST data? I greatly appreciate it. Thanks
-
What I am doing is pulling the name and login stored in one table and trying to copy it to another along with additional information I need to collect. Is there a way to do this?
-
Hi, I am doing a survey and need a little guidance. I have data being selected from one table and I am trying to store it in another. I have no problem selecting the data and displaying it, I just can't get it to continue on with the new survey. Here is the file showing the data collected: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>Question 1</title> </head> <body> <?php session_start(); $_SESSION['name'] = $_POST['name']; $_SESSION['cslogin'] = $_POST['cslogin']; $_SESSION['domain'] = $_POST['domain']; $_SESSION['project'] = $_POST['project']; $_SESSION['ODM'] = $_POST['ODM']; $_SESSION['hwphase'] = $_POST['hwphase']; $_SESSION['ppmid'] = $_POST['ppmid']; $_SESSION['survey'] = $_POST['survey']; $_SESSION['month'] = $_POST['month']; ?> Name: <?php echo $_POST['name'];?><br> CS Login: <?php echo $_POST['cslogin'];?><br> Domain: <?php echo $_POST['domain'];?><br> Project: <?php echo $_POST['project'];?><br> ODM: <?php echo $_POST['ODM'];?><br> HW Phase: <?php echo $_POST['hwphase'];?><br> PPM ID: <?php echo $_POST['ppmid'];?><br> Survey: <?php echo $_POST['survey'];?><br> Month: <?php echo $_POST['month'];?><br> Everything from table 1 is displayed above. No problem. Here is the next page after this. Question #1 has already been answered: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>Question 2</title> </head> <body> <?php session_start(); $name = $_SESSION['name']; $cslogin = $_SESSION['cslogin']; $domain = $_SESSION['domain']; $project = $_SESSION['project']; $ODM = $_SESSION['ODM']; $hwphase = $_SESSION['hwphase']; $ppmid = $_SESSION['ppmid']; $survey = $_SESSION['survey']; $month = $_SESSION['month']; $Q1 = $_SESSION['Q1']; $comment1 = $_SESSION['comment1']; ?> Name: <?php echo $_SESSION['name'];?><br> Q1: <?php echo $_SESSION['Q1'];?><br> Comments: <?php echo $_SESSION['comment1'];?><br> It displays question 1 and comments with no problem. This is where the "name - month" is lost. How would I have name - month continue on to be store in a new table? I greatly appreciate your help. Thanks!! Note: based on the question for #1, the user is redirected to question 2 or question 3. Here is the file that is between Q1 and Q2 <?php session_start(); $_SESSION['name'] = $_POST['name']; $_SESSION['cslogin'] = $_POST['cslogin']; $_SESSION['domain'] = $_POST['domain']; $_SESSION['project'] = $_POST['project']; $_SESSION['ODM'] = $_POST['ODM']; $_SESSION['hwphase'] = $_POST['hwphase']; $_SESSION['ppmid'] = $_POST['ppmid']; $_SESSION['survey'] = $_POST['survey']; $_SESSION['month'] = $_POST['month']; $_SESSION['Q1'] = $_POST['Q1']; $_SESSION['comment1'] = $_POST['comment1']; switch ($_POST['Q1']) { case "No": $url = "filename"; break; case "Yes": $url = "http://odmQ3_a.php"; break; case "Supplier Assessment is ongoing and issues still being worked": $url = "odmQ3_a.php"; } header("Location: $url"); ?>
-
I have a update query that should be updating the timestamp when a "month" field is changed. I have the following code: $month_update->bindParam(':timestamp', strtotime (date("Y-m-d H:i:s")), PDO::PARAM_INT); The result that is returned is 1403198033. I need it to look like this 2014-03-26 07:09:06. I know I am missing something and I would greatly appreciate your help. Thank you so much!
-
As always!! Thank you for your help. You are awesome!!
-
One more question. Using this formula can I update two fields in one submit? For example: //update firstname, since it was updated. $firstname_update = $dbh->prepare('UPDATE contacts SET ' . 'first=:first WHERE ' . 'id=:id '); $firstname_update->bindParam(':firstname', $_POST['first']); $firstname_update->bindParam(':id', $_POST['id'], PDO::PARAM_INT); $firstname_update->execute(); //update lastname, since it was updated. $lastname_update = $dbh->prepare('UPDATE contacts SET ' . last=:lastWHERE ' . 'id=:id '); $lastname_update->bindParam(':lastname, $_POST[last]); $lastname_update->bindParam(':id', $_POST['id'], PDO::PARAM_INT); $lastname_update->execute(); So when I click "SUBMIT" it updates both? This is just an example. I greatly appreciate your feedback. Thanks so much!!!
-
This is what I needed. Thanks for your guidance. I really appreciate it. Have a great day!
-
I need to update the Name using the "ID" that is associated with the name. So what I was wondering is can I view what is already in the "first" field before it is changed?
-
This worked perfectly. Now. is there a way to show what the old value is before you udpate it? What I have seen looks to be very complexed. For example: Let's say I am updating ID 5 and I want to make sure it belongs to Catherine ('first'). How would I do that? Thanks so much for your help.
-
I have created a form to update records using the ID primary key. I am unable to use the Drop Down menu to select the record to update. I believe I have everything else correct. I would greatly appreciate your feedback. Thanks, <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>New Page 1</title> </head> <body> <?php $connect=mysql_connect('us70tudbs001.zam.alcatel-lucent.com:3306','norab','norab') or die("Unable to Connect"); @mysql_select_db('rightfirst') or die("Could not open the db"); $query="SELECT * FROM contacts"; $result=mysql_query($query) or die("Query Failed : ".mysql_error()); $i=0; while($rows=mysql_fetch_array($result)) { $roll[$i]=$rows['id']; $i++; } $total_elmt=count($roll); ?> <form method="post" action=""> Select the ID No. to Update: <select name="sel"> <option>Select</option> <?php for($j=0;$j<$total_elmt;$j++) { ?></option><?php echo $roll[$j]; ?></option><?php } ?> </select><br /> First Name: <input name="first" type="text" /><br /> Last Name: <input name="last" type="text" /><br /> Phone: <input name="phone" type="text" /><br /> <input name="submit" type="submit" value="Updated"/><br /> <input name="reset" type="reset" value="Reset" /> </form> <?php if(isset($_POST['submit'])) { $value=$_POST['sel']; $first=$_POST['first']; $last=$_POST['last']; $phone=$_POST['phone']; $query2 = "UPDATE contacts SET first='$first',last='$last',phone='$phone' WHERE id='$value'"; $result2=mysql_query($query2) or die("Query Failed : ".mysql_error()); echo "Successfully Updated"; } ?> <p align=right><a href="view.php">VIEW RECORDS</a></p> </body> </html>
-
Hi. Just a quick question. I have the following: <input type="radio" name="q3" value="The Preliminary Reliability Prediction indicates that the Failure Rate Requirement can be achieved, there are no known blocking issues in the Prime’s DFR Dashboard, and the team has a plan to get to “green” on all DFR deliverables in the Prime’s DFR Dashboard " > When transferring to SQL I receive erros because of the special characters within the VALUE. I have seen a lot of PHP codes that has a "/" before the ">" . Example: <input type="radio" name="q3" value="Resources and funding to address all Reliability efforts (e.g. HALT/ALT testing) approved and in place" /> What does the "/" do? Does this allow for special characters? Is there an easy way to fix this error I receive or should I just remove the "" and () from the value? Thanks.
-
Hi. Just a quick question. If you browse the web, I see that there are several form validations out there but they required JAVASCRIPT. I have serveral forms with CHECKBOX for survey questions. Several of the questions only allow you to pick one box. This is my form for one of the questions: <form method="post" action="hasq3.php"> <table border="0" width="100%"> <tr> <td width="2%" height="30"> <input type="checkbox" name="q2" value="Quality Plan Does Not Exist" tabindex="1"></td> <td width="103%" height="30">Quality Plan Does Not Exist</td> </tr> <tr> <td width="2%" height="30"> <input type="checkbox" name="q2" value="Draft Quality Plan Exists" tabindex="2"></td> <td width="103%" height="30">Draft Quality Plan Exists</td> </tr> <tr> <td width="2%" height="30"> <input type="checkbox" name="q2" value="Draft Quality Plan Following HW Quality Plan Template" tabindex="3"></td> <td width="103%" height="30">Draft Quality Plan Following HW Quality Plan Template</td> </tr> </tr> <td width="71%"> <button type="submit">Next Page</button> </form> Is there a way to instruct the PHP to only select one checkbox? On another form I have an input box for "NAME". Is there a way to say that this field is required? If I use JAVA do I have to save the file as a .jsp file or can this be imbedded in the <Head></HEAD>. I am not familiar with JAVA. I greatly appreciate any help you can provide. Thanks,
-
Passing variables to multiple forms using URL
brownbrod replied to brownbrod's topic in PHP Coding Help
Firgured it out. Thanks for your help!! -
Passing variables to multiple forms using URL
brownbrod replied to brownbrod's topic in PHP Coding Help
Ok. If I change the code on the hasq2.php as follows: $_SESSION['month'] = $_POST['month']; $_SESSION['q1'] = $_POST['q1']; $_SESSION['comment1'] = $_POST['comment1']; I am able to see the "Month", Question 1" and Comment 1. But, all the other fields are lost. "Name, CSLogin, PPMID" and so on. How do I get the reamaining fields to carry on to the next question? This php is not reading the POSTed data from the previous form. $name = $_SESSION['name']; $cslogin = $_SESSION['cslogin']; $domain = $_SESSION['domain']; $project = $_SESSION['project']; $hwphase = $_SESSION['hwphase']; $ppmid = $_SESSION['ppmid']; $survey = $_SESSION['survey']; Should I do a $_SESSION['name'] = $_POST['name']; to reestablish it or will this just cause problems? I greatly appreciate your help. Thanks!! -
Passing variables to multiple forms using URL
brownbrod replied to brownbrod's topic in PHP Coding Help
Hi. Even if I change the field name to something different, I still get the word "Test" as a value. I just can't figure out what is wrong. I am setting the $_SESSION['comment1'] in the next page. Here is the code. Question 1 page: <tr> <td width="99%" height="30" colspan="2" style="font-family: Calibri; font-size: 14pt"> If the last checklist review is not completed or in redirect, please provide reason.<br> <input type=text size=100 NAME="comment1"></td> </td> Goes to <form method="post" action="hasq2.php"> Here is the code from hasq2.php <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>Wireless Hardware Quality Practice Assessment Survey - Question 2</title> </head> <body> <?php session_start(); $name = $_SESSION['name']; $cslogin = $_SESSION['cslogin']; $domain = $_SESSION['domain']; $project = $_SESSION['project']; $hwphase = $_SESSION['hwphase']; $ppmid = $_SESSION['ppmid']; $survey = $_SESSION['survey']; $month = $_SESSION['month']; $q1 = $_SESSION['q1']; $comment1 = $_SESSION['comment1']; echo 'Name: '.$name.'; Month: '.$month; ?> <br> <input type="text" size=100 name="name" value="<?php echo $name ?>"><br> <input type="text" size=100 name="cslogin" value="<?php echo $cslogin ?>"><br> <input type="text" size=100 name="domain" value="<?php echo $domain ?>"><br> <input type="text" size=100 name="project" value="<?php echo $project ?>"><br> <input type="text" size=100 name="hwphase" value="<?php echo $hwphase ?>"><br> <input type="text" size=100 name="ppmid" value="<?php echo $ppmid ?>"><br> <input type="text" size=100 name="survey" value="<?php echo $survey ?>"><br> <input type="text" size=100 name="month" value="<?php echo $month ?>"><br> <input type="text" size=100 name="q1" value="<?php echo $q1 ?>"><br> <input type="text" size=100 name="comment1" value="<?php echo $comment1 ?>"><br> </body> </html> I don't set the variable in the question 1 file. Should I set the variable there too? Thank you for your help. -
Passing variables to multiple forms using URL
brownbrod replied to brownbrod's topic in PHP Coding Help
Hi. One more issue and I hope I am done. I have a "comments" field in my form: <tr> <td width="99%" height="30" colspan="2" style="font-family: Calibri; font-size: 14pt"> If the last checklist review is not completed or in redirect, please provide reason.<br> <input type=text size=100 NAME="comment1"></td> </td> </tr> When I test the form, I put in the text box "This is a text of the comment field for section 1". My PHP data: <?php session_start(); $name = $_SESSION['name']; $cslogin = $_SESSION['cslogin']; $domain = $_SESSION['domain']; $project = $_SESSION['project']; $hwphase = $_SESSION['hwphase']; $ppmid = $_SESSION['ppmid']; $survey = $_SESSION['survey']; $month = $_SESSION['month']; $q1 = $_SESSION['q1']; $comment1 = $_SESSION['comment1']; echo 'Name: '.$name.'; Month: '.$month; ?> <br> <input type="text" size=100 name="name" value="<?php echo $name ?>"><br> <input type="text" size=100 name="cslogin" value="<?php echo $cslogin ?>"><br> <input type="text" size=100 name="domain" value="<?php echo $domain ?>"><br> <input type="text" size=100 name="project" value="<?php echo $project ?>"><br> <input type="text" size=100 name="hwphase" value="<?php echo $hwphase ?>"><br> <input type="text" size=100 name="ppmid" value="<?php echo $ppmid ?>"><br> <input type="text" size=100 name="survey" value="<?php echo $survey ?>"><br> <input type="text" size=100 name="month" value="<?php echo $month ?>"><br> <input type="text" size=100 name="q1" value="<?php echo $q1 ?>"><br> <input type="text" size=100 name="comment1" value="<?php echo $comment1?>"><br> For some reason it prints out only the word "test" for Comments. Everything else echo fine. Is there something I am missing? I greatly appreciate your help. Thanks!! -
Passing variables to multiple forms using URL
brownbrod replied to brownbrod's topic in PHP Coding Help
THANK YOU!!! Works great!!! -
Passing variables to multiple forms using URL
brownbrod replied to brownbrod's topic in PHP Coding Help
John. I would like to do the session_start route. But on my first form, I need to have the individuals select the route they are going to take from the drop down. With doing this, I was instructed to go this route: This is the form <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>Testing HAS Form theory</title> </head> <body> <form method="POST" action="formPHASE2.php"> First Name: <input type="text" name="first"><br> Last Name: <input type="text" name="last"><br> <select name="hwphase" id="hwphase"> <option selected>- - Select - -</option> <option value="HAS">HAS</option> <option value="HD">HD</option> <option value="HR">HR</option> <input type="submit" value="Go To Step 2"> </form> </body> </html> formPHASE2.php <?php $first = $_POST['first']; $last = $_POST['last']; switch ($_POST['hwphase']) { case "HAS": $url = "http://mobility.web.alcatel-lucent.com/~norab/test1/form2.php?first=$first&last=$last"; // Or this could be a relative path like: $url="has_survey.php"; break; case "HD": $url = "http://mobility.web.alcatel-lucent.com/~norab/test1/hd.php?first=$first&last=$last"; break; case "HR": $url = "http://mobility.web.alcatel-lucent.com/~norab/test1/hr.php?first=$first&last=$last"; } header("Location: $url"); ?> The form2.php looks like this: <html> <body> <?php session_start(); $_SESSION['first'] = $first; $_SESSION['last'] = $last; ?> <form method="post" action="form3.php"> Phone: <input type="text" name="phone"><br> Mobile: <input type="text" name="mobile"><br> <br> hidden <br> <input type="text" name="first" value="<?php echo $_GET['first']; ?>"><br> <input type="text" name="last" value="<?php echo $_GET['last']; ?>"><br> <br> <input type="submit" value="Go To Step 3"> </form> </body> </html> In keeping with the session_start process, what would you suggest for doing specific url for the drop down? Should I be doing the switch case? My multi forms are for a company survey and I have about 10 questions. Each form has to be on a separate page. I greatly appreciate your input. Thanks! -
Passing variables to multiple forms using URL
brownbrod replied to brownbrod's topic in PHP Coding Help
Thank you. You helped me a lot. Thank you!!! I greatly appreciate it!! -
Passing variables to multiple forms using URL
brownbrod replied to brownbrod's topic in PHP Coding Help
Josh. Thank you. That was a typo on my part. Yes, I just fixed those. But I am still not able to pull the "first" and "last" in to the hidden fields of the form2.php, form3.php and form4.php. This is where my issue is.. All I get is a blank textbox. I know I am missing something. -
Hi. I am new to PHP programming and I am trying to get a multi form web site to work. I was wondering if I could receive some help. My first .php file looks like this. <?php $connect=mysql_connect('server','userid','passwd') or die("Unable to Connect"); @mysql_select_db('table') or die("Could not open the db"); session_start(); $first = $_POST['first']; $last = $_POST['last']; switch ($_POST['hwphase']) { case "HAS": $url = "form2.php?$first=first&$last=last"; // Or this could be a relative path like: $url="has_survey.php"; break; case "HD": $url = "form3?$first=first&$last=last.php"; break; case "HR": $url = "form4?$first=first&$last=last.php"; } header("Location: $url"); ?> My problem is with the next .php file. I am unable to "get" the first and last name. This is what I have: <html> <body> <?php $connect=mysql_connect('server','userid','passwd') or die("Unable to Connect"); @mysql_select_db('table') or die("Could not open the db"); session_start(); $_SERVER['first'] = $_GET['first']; $_SERVER['last'] = $_GET['last']; ?> <form method="post" action="form3.php"> Phone: <input type="text" name="phone"><br> Mobile: <input type="text" name="mobile"><br> <br> hidden <br> <input type="text" name="first" value="<?php echo $_GET['first']; ?>"><br> <input type="text" name="last" value="<?php echo $_GET['last']; ?>"><br> <br> <input type="submit" value="Go To Step 3"> </form> </body> </html> I greatly appreciate your help.