Jump to content

webref.eu

Members
  • Posts

    210
  • Joined

  • Last visited

Everything posted by webref.eu

  1. Someone on the forum kindly gave me the below code for a Review Rating select dropdown which prints out 1 to 10 in a select box and remembers the rating if the form gets posted back. I would like to modify this to make sure that the user has actually given a rating. I am thinking of making the dropdown display an initial value of Please Select, which I have shown under my attempt in the below code. However, this isn't quite working because 0 is overwriting it when the dropdown is displayed. Can anyone help me out with the code and also suggest Javascript that could be used to make sure the user has entered a rating, i.e. Please Select is no longer being displayed. Thanks All. <select name="ReviewRating" id="ReviewRating"> <?php //my attempt //if form being shown for the first time If($_POST['processform'] != 1) { echo "<option selected=\"selected\">Please Select</option>\n"; } //loops 1 through 10, and adds the HTML attribute selected to the option tag, if the rating matches the number being printed $rating = (isset($ReviewRating)) ? $ReviewRating : ''; for ($i = 0; $i <= 10; $i++) { $selected = ($rating == $i) ? ' selected="selected"' : ''; echo "<option$selected>$i</option>\n"; } ?> </select>
  2. OK, here is the form in its entirety, sorry about all the commented code and everything but it's still under development. As you can see it's posting back on itself. Rgds <html> <head> <title>Add a Review</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="styles.css" rel="stylesheet" type="text/css" /> </head> <body> <?php include('inc-dbconnect.php'); //shared functions include("inc-functions.php"); //NEED TO CLEANSE QUERYSTRING //get ProductId $ProductId = $_GET['ProductId']; //check for cookie or session, or redirect to login page //If processform flag is set, processing can occur. If not set, form is being loaded for the first time processing if ($_POST['processform'] == 1) { //Process Form //retrieve form input $ProductId=$_POST['txtProductId']; $ReviewRating=$_POST['ReviewRating']; $ReviewDesc=$_POST['txtReviewDesc']; //for debugging //echo "ReviewDesc After Post: " . $ReviewDesc . "<br><br>"; //echo "ReviewDesc Length: " . strlen($ReviewDesc) . "<br><br>"; //make safe with htmlspecialchars, will now contain the ascii equivalents to all html chars like < //$ReviewDesc=htmlspecialchars($ReviewDesc); //echo "First character of Review Desc: " . $ReviewDesc[0] . "<br><br>"; //Y Year in four digits //m Month 01 to 12 //d Day of the month 01 to 31 //H Hour 00 to 23 //i Minutes 00 to 59 //s Seconds 00 to 59 $DateAndTime=date("Y-m-d H:i:s"); //for debugging //echo $DateAndTime . "<br>"; //Validate fields // create empty error variable $ErrorMsg = ""; if (!$ReviewDesc) { $ErrorMsg = "Please give Your Review.<br>"; } //check Review is 10 characters or more //PrepareForForm only actioned under error conditions so does not affect database input //need to use mb_strlen to cope with multibyte characters like £ if(mb_strlen(PrepareForLengthCheck($ReviewDesc)) < 10) { $ErrorMsg = $ErrorMsg . "Your Review must be 10 characters or more, please make it longer.<br>"; $ReviewDesc = PrepareForForm($ReviewDesc); } //check Review is not too long if(mb_strlen(PrepareForLengthCheck($ReviewDesc)) > 15000) { $ErrorMsg = $ErrorMsg . "Your Review is limited to 15,000 characters so please make it shorter.<br>"; //need to use PrepareForForm to account for magic quotes when putting back into form //note, correction for magic quotes is therefore dependent on this error being triggered $ReviewDesc = PrepareForForm($ReviewDesc); } echo "<p class='txterror'>" . $ErrorMsg . "</p>"; //If no errors write to database If ($ErrorMsg == "") { //for debugging //echo "Review Description Before Database Insert: " . $ReviewDesc . "<br><br>"; //insert into database $query = "INSERT INTO Reviews (ProductId, ReviewRating, ReviewDesc, ReviewDate, ReviewIsApproved) VALUES ('" . makeSQLSafe($ProductId) . "', '" . makeSQLSafe($ReviewRating) . "', '" . makeSQLSafe($ReviewDesc) . "', '" . makeSQLSafe($DateAndTime) . "', '" . makeSQLSafe(0) . "')"; mysql_query($query); mysql_close(); echo "Thank you, your review has been added and is now awaiting approval by our editors."; //Close If No Errors } //Close If processform flag is set } ?> <br><br> <a href="product-page.php">Product Page</a> <?php //If condition for when to display form //when processform flag is 1 and ErrorMsg is empty we don't want to display the form //otherwise we display the form for error correction If (!($_POST['processform'] == 1 && $ErrorMsg == "")) { ?> <!-- - Form gets posted back to itself. - If there are errors, form will get parsed again, but with updated variables in the fields. --> <form name="form1" method="post" action="<? echo $_SERVER['PHP_SELF']; ?>"> <p>Please note all reviews submitted are subject to approval by our editors. We want to approve as many of your reviews as possible, but please adhere to our guidelines. The decision of our editors is final and no correspondence will be entered into. </p> <ul> <li>Advertising in any form is not permitted.</li> <li>Please keep your review specific to the item being reviewed. </li> <li>Reviews must be your own original work and cannot be copied from elsewhere. </li> <li>Do not make remarks that insult other reviewers.</li> <li>Do not post content which is blasphemous, racist, insulting or hateful.</li> <li>Do not use swear words or sexually explicit language.</li> <li>Do not post any contact details such as telephone numbers, postal addresses, e-mail addresses or URLs.</li> <li>Please note your review length is limited to 15,000 characters. </li> </ul> <p>Thank you for your co-operation.</p> Your Rating out of 10:<br> <select name="ReviewRating" id="ReviewRating"> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> <option>6</option> <option>7</option> <option>8</option> <option>9</option> <option>10</option> </select> <br> <br> <p> <?php //debugging //echo "Review Description: " . $ReviewDesc . "<br><br>"; ?> </p> Your Review:<br> <textarea name="txtReviewDesc" cols="80" rows="10"><?print $ReviewDesc; ?></textarea> <!-- <input type="text" name="txtReviewDesc" size="20" maxlength="20" value="<?print $ReviewDesc; ?>" /> --> <br><br> <input type="hidden" name="txtProductId" value="<?=$ProductId?>"> <input type="hidden" name="processform" value="1"> <input type="submit" name="Submit" value="Submit"> </form> <a href="control-panel.php">Home</a> <?php //End If condition for when to display form } ?> </body> </html>
  3. Hi All I am developing a Reviews script where the user gets to choose a Rating Out of 10 via a Dropdown Box as follows: <select name="ReviewRating" id="ReviewRating"> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> <option>6</option> <option>7</option> <option>8</option> <option>9</option> <option>10</option> </select> The script posts back to itself and currently I am then losing the user selected value of this dropdown. So, how do I make the script remember the rating after postback? Please let me know or point me to a tutorial. Many thanks all.
  4. Thanks for your help with the logic statement. Here is the code that I have found to work the way I wanted regarding when to display the form: <?php If (!($_POST['processform'] == 1 && $ErrorMsg == "")) { ?> <!-- display the form --> <form> ... </form> <?php //end if } ?> Rgds
  5. Guys, I still don't think I have this right. Let me explain further: Under these conditions: $_POST['processform'] == 1 AND ErrorMsg == "" I don't want a form to be displayed, so I have to write and If statement saying If Not both the above mentioned conditions. If think it's something like: If !(($_POST['processform'] == 1) && (ErrorMsg == "")) { but this still isn't quite right as I'm getting an unexpected ! error. Thanks all.
  6. Hi All I have to code an statement that says "If not the conditions where processform is 1 AND ErrorMsg is empty string". So far I have this: If !($_POST['processform'] == 1 AND ErrorMsg == "") { which I know is wrong. Can anyone help me correct it? Thanks All.
  7. Hi All I have a form that takes user input and posts back to itself. Once the form input has been validated, it inserts the data into my database. At this point I effectively want to stop the script running, and show a msg that says "Thanks for your input". At the moment, even after the validation and insert has been done, the form is incorrectly displayed again, just because the page is posting back and the form html appears at the bottom of the page. So, what's the best way to interrupt processing and display the user msg? I tried using a statement like: header("Location: $newpage"); but it didn't like that. Thanks All.
  8. OK, so I've found the nl2br function, which works: nl2br($row[ReviewDesc]) is this the best practice method? Many thanks.
  9. Hi All If I input this into my textarea on my form: This is the first paragraph. This is the second paragraph. This is the third paragraph. i.e. I have put some line breaks into my input, when I look at the input in MySQL Query Browser I can see two (line break?) characters between each line as shown graphically in my attachment. Presently, when I pull the text out from my database and display on page, then the line breaks are not being preserved. So, how do I get the line breaks to be recognised when I redisplay the text? Thanks all. [attachment deleted by admin]
  10. OK, I have done a bit more testing. If I have a form field where the field contents is given in HTML as: testing"testing This is displayed in the browser in the field as: testing"testing If I then retrieve the contents of the field using: $ReviewDesc=$_POST['txtReviewDesc']; and redisplay this on the page it is shown as (note magic quotes on and producing the slash): testing\"testing Checking the actual HTML it is also shown as: testing\"testing So in summary, the underlying field contents in HTML has changed from: testing"testing to: testing\"testing i.e. we have transformed the contents from HTML entity " into character " through the contents being displayed in a form and retrieved with $_POST. Therefore my conclusion is that $_POST will retrieve actual characters from a field, even if in the actual HTML they are given as HTML entities. Would everyone agree with this? Thanks all.
  11. Hi All I have observed the following: HTML contents of form field: testing"testing (displayed in browser field as testing"testing) Goes into the database as: testing"testing My question is, can you confirm what is translating the html entity " into the character " when the database insert is done? I collect the field with: $ReviewDesc=$_POST['txtReviewDesc']; I assume it is mysql_real_escape_string which I am applying. Can anyone confirm that is how mysql_real_escape_string works? Many thanks
  12. Yes, you have a single php file that does everything. I suggest you call it survey.php. In the top section of this file will be a <?php ?> section that controls processing of the form when it has been submitted (as can be ascertained by some kind of flag as discussed previously). In the bottom section of this file is you <form> </form>. The php code will have some kind of error checking routine whereby if there are errors they are shown to the user and the script "falls back" to show the form again, although this time the fields can be populated with what the user has already put in. If the form contains no errors, then the script can move on to a database routine which puts the data into your database. Rgds
  13. In summary, what they are saying is that you should create a single .php file that contains your form and all the php that does the php form processing. You make the form post-back on itself, i.e. you have something like: <form name="form1" method="post" action="<? echo $HTTP_SERVER_VARS['PHP_SELF']; ?>"> I think this is probably the best method for you to choose, because it makes it a bit easier to remember the user submitted answers if you have to send the user back to the form. The variables are all contained in one page. Rgds
  14. I have stuck with the original technique of recognising that the form was posted, other than that the problems were as I detailed in earlier posts. Rgds
  15. I have modified the files and tried them on my server and it is now producing some output. There may be further issues with your code but hopefully this will give you some help: http://www.webref.eu/testing/survey.html <!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=iso-8859-1" /> <title>Survey</title> </head> <body> <p>Impact of Training Form:</p> <p>Please enter your company name: </p> <form id="Survey" name="Survey" form action="survey.php" method="post" > <label>Company Name <input type="text" name="CompanyName" /> </label> <p><strong>Please select your industry type:</strong></p> <label>Industry Type <select name="IndustryType"> <option value="1">Select Industry..</option> <option value="2">Forestry, Mining, Oil, and Gas extraction</option> <option value="3">Finance and Insurance</option> <option value="4">Real estate, rental, and leasing ops </option> <option value="5">Business services </option> <option value="6">Education and health services</option> <option value="7">Information and cultural services </option> <option value="8">Labour intensive tertiary manufacturing </option> <option value="9">Primary product manufacturing </option> <option value="10">Secondary product manufacturing </option> <option value="11">Capital intensive tertiary manufacturing </option> <option value="14">Construction </option> <option value="15">Transportation, warehousing, wholesale </option> <option value="16">Communication and utilities </option> <option value="17">Retail trade and consumer services </option> <option value="18">None of the above </option> </select> </label> <p><strong>Please select your company size: </strong></p> <label> <input name="CompanySize" type="radio" value="1" /> Small (less than 50 employees) </label> <p> <label> <input name="CompanySize" type="radio" value="2" /> Medium (between 50 and 250 employees) </label> </p> <p> <label> <input name="CompanySize" type="radio" value="3" /> Large (greater than 250) </label> <br /> </p> <p align="left"><strong>Class Room Training </strong></p> <p align="left">If your organization participated in Class Room Training, please indicate so by clicking the appropriate radio button. </p> <label>Class Room Training</label> <input name="ClassRoomTraining" type="radio" value="1" /> <label>No Class Room Training</label> <input name="ClassRoomTraining" type="radio" value="2" /> <p><strong>Go to Question 2</strong></p> <p><strong> Your organization participates in Class Room Training. Please select those that apply: </strong></p> <label> <input type="checkbox" name="ClassRoomOrientation" value="1" /> Orientation for new Employees </label> <p> <label> <input type="checkbox" name="ClassRoomManagerialOrSupervisoryTraining" value="1" /> Managerial or Supervisory Training </label> </p> <p> <label> <input type="checkbox"name="ClassRoomApprenticeshipTraining" value="1"/> Apprenticeship Training</label> </p> <p> <label> <input type="checkbox" name="ClassRoomComputerHardware" value="1" /> Computer Hardware </label> </p> <p> <label> <input type="checkbox" name="ClassRoomComputerSoftware" value="1"/> Computer Software</label> </p> <p> <label> <input type="checkbox" name="ClassRoomOtherOffice" value="1" /> Other office and non-office equipment </label> </p> <p> <label> <input type="checkbox" name="ClassRoomGroupDecisionMaking" value="1" /> Group decision-making or problem solving </label> </p> <p> <label> <input type="checkbox" name="ClassRoomTeamBuilding" value="1" /> Team-building, leadership, communication</label> </p> <p> <label> <input type="checkbox" name="ClassRoomLiteracyOrNumeracy" value="1" /> Literacy or Numeracy </label> </p> <p><strong>Please estimate the workplaces total training expenditure (in Dollars)</strong></p> <p> <label>$ <input name="TotalTrainingExpenditure" type="text" id="TotalTrainingExpenditure" /> </label> </p> <p><strong>Which of the following are included in the estimate?</strong></p> <p> <label> <input type="checkbox" name="TrainersSalary" value="1" /> Trainers' Salaries </label> </p> <p> <label> <input type="checkbox" name="TraineesSalary" value="1" /> Trainees' Salaries </label> </p> <p> <label> <input type="checkbox" name="ContractsToVendors" value="1" /> Contracts to vendors </label> </p> <p> <label> <input type="checkbox" name="DirectTuition" value="1" /> Direct Tuition to schools or training institutions </label> </p> <p> <label> <input type="checkbox" name="TrainingMaterials" value="1" /> Training materials </label> </p> <p> <label> <input type="checkbox" name="TravelOrLivingCosts" value="1" /> Travel or living costs for trainees and trainers </label> </p> <p> <label> <input type="checkbox" name="Overhead" value="1" /> Overhead or Office costs for training </label> </p> <p> <label> <input type="checkbox" name="OtherTraining" value="1" /> Other training expenses </label> </p> <p align="left"><strong>Work Place Training</strong></p> <p align="left">If your organization participated in Work Place Training, please indicate so by clicking the appropriate radio button. </p> <label>Work Place Training </label> <input name="WorkPlaceTraining" type="radio" value="1" /> <label>No Work Place Training</label> <input name="WorkPlaceTraining" type="radio" value="2" /> <br> <p><strong>Your organization participates in Work Place Training. Please select those that apply:</strong></p> <br> <input type="checkbox" name="WorkPlaceOrientation" value="1" /> Orientation for new Employees </label> <p> <label> <input type="checkbox" name="WorkPlaceManagerialOrSupervisoryTraining" value="1" /> Managerial or Supervisory Training </label> </p> <p> <label> <input name="WorkPlaceApprenticeshipTraining" type="checkbox" value="1"/> Apprenticeship Training </label> </p> <p> <label> <input type="checkbox" name="WorkPlaceComputerHardware" value="1" /> Computer Hardware </label> </p> <p> <label> <input type="checkbox" name="WorkPlaceComputerSoftware" value="1"/> Computer Software </label> </p> <p> <label> <input type="checkbox" name="WorkPlaceOtherOffice" value="1" /> Other Office and non-office equipment </label> </p> <p> <label> <input type="checkbox" name="WorkPlaceGroupDecisionMaking" value="1" /> Group Decision Making or Problem Solving </label> </p> <p> <label> <input type="checkbox" name="WorkPlaceTeamBuilding" value="1" /> Team-building, leadership, communication </label> </p> <p> <label> <input type="checkbox" name="WorkPlaceLiteracyOrNumeracy" value="1" /> Literacy or Numeracy </label> </p> <p> <p> </p> <p><strong>Please estimate the amount of employees that have had workplace training between April of last year and March of this year: </strong></p> <p> <label> <input name="TotalAmountEmployees" type="text" id="TotalAmountEmployees" /> </label> </p> <input type="submit" name="process_form" value="Submit the Form" /> <p> </p> <p> </p> <p></p> </form> <p> </p> </body> </html> http://www.webref.eu/testing/survey.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=iso-8859-1" /> <title>Survey</title> </head> <body> <?php echo 'Impact of Training Form:';// READ IN DATA FROM HTML FORM ?> <?php if( isset( $_POST['process_form'] ) ) { $CompanyName = $_POST['CompanyName']; $IndustryType = $_POST['IndustryType']; $CompanySize = $_POST['CompanySize']; $ClassRoomTraining = $_POST['ClassRoomTraining']; $ClassRoomOrientation = $_POST['ClassRoomOrientation']; $ClassRoomManagerialOrSupervisoryTraining = $_POST['ClassRoomManagerialOrSupervisoryTraining']; $ClassRoomApprenticeshipTraining = $_POST['ClassRoomApprenticeshipTraining']; $ClassroomComputerHardware = $_POST['ClassRoomComputerHardware']; $ClassroomComputerSoftware = $_POST['ClassRoomComputerSoftware']; $ClassroomOtherOffice = $_POST['ClassRoomOtherOffice']; $ClassroomGroupDecisionMaking = $_POST['ClassRoomGroupDecisionMaking']; $ClassroomTeamBuilding = $_POST['ClassRoomTeamBuilding']; $ClassroomLiteracyOrNumeracy = $_POST['ClassRoomLiteracyOrNumeracy']; $TotalTrainingExpenditure = $_POST['TotalTrainingExpenditure']; $TrainersSalary =$_POST['TrainersSalary']; /// Finished Here } ?> Name: <?php echo $_POST["CompanyName"]; ?>.<br /> Industry Type: <?php echo $_POST["IndustryType"]; ?>.<br /> Company Size: <?php echo $_POST["CompanySize"]; ?>.<br /> ClassRoom Training: <?php echo $_POST["ClassRoomTraining"]; ?>.<br /> <br> ClassRoom Options Orientation: <?php echo $_POST["ClassRoomOrientation"]; ?>.<br /> Managerial or Supervisory Training: <?php echo $_POST["ClassRoomManagerialOrSupervisoryTraining"]; ?>.<br /> Apprenticeship Training: <?php echo $_POST["ClassRoomApprenticeshipTraining"]; ?>.<br /> Computer Hardware Training: <?php echo $_POST["ClassRoomComputerHardware"]; ?>.<br /> Computer Software Training: <?php echo $_POST["ClassRoomComputerSoftware"]; ?>.<br /> Other office and non office equipment: <?php echo $_POST["ClassRoomOtherOffice"]; ?>.<br /> Classroom Decision and Problem Solving: <?php echo $_POST["ClassRoomGroupDecisionMaking"]; ?>.<br /> Classroom Team Building: <?php echo $_POST["ClassRoomTeamBuilding"]; ?>.<br /> Classroom Literacy or Numeracy: <?php echo $_POST["ClassRoomLiteracyOrNumeracy"]; ?>.<br /> <br> Total Training Expenditure: <?php echo $_POST["TotalTrainingExpenditure"]; ?>.<br /> Trainers Salary: <?php echo $_POST["TrainersSalary"]; ?>.<br /> Trainees Salary: <?php echo $_POST["TraineesSalary"]; ?>.<br /> Vendor Contracts: <?php echo $_POST["ContractsToVendors"]; ?>.<br /> Direct Tuition: <?php echo $_POST["DirectTuition"]; ?>.<br /> Training Materials: <?php echo $_POST["TrainingMaterials"]; ?>.<br /> Travel or Living expenses: <?php echo $_POST["TravelOrLivingCosts"]; ?>.<br /> Overhead: <?php echo $_POST["Overhead"]; ?>.<br /> Other: <?php echo $_POST["Other"]; ?>.<br /> <br> Work Place Orientation: <?php echo $_POST["WorkPlaceOrientation"]; ?>.<br /> Work Place Managerial or Supervisory: <?php echo $_POST["WorkPlaceManagerialOrSupervisoryTraining"]; ?>.<br /> Work Place Apprenticeship Training: <?php echo $_POST["WorkPlaceApprenticeshipTraining"]; ?>.<br /> Work Place Computer Hardware: <?php echo $_POST["WorkPlaceComputerHardware"]; ?>.<br /> Work Place Computer Software: <?php echo $_POST["WorkPlaceComputerSoftware"]; ?>.<br /> Work Place Other Office: <?php echo $_POST["WorkPlaceOtherOffice"]; ?>.<br /> Work Place Group Decision Making: <?php echo $_POST["WorkPlaceGroupDecisionMaking"]; ?>.<br /> Work Place Team Building: <?php echo $_POST["WorkPlaceTeamBuilding"]; ?>.<br /> Work Place Literacy and Numeracy: <?php echo $_POST["WorkPlaceLiteracyOrNumeracy"]; ?>.<br /> <br> Total Amount of Employees: <?php echo $_POST["TotalAmountEmployees"]; ?>.<br /> <?php echo "TEST TEST TEST"; echo $CompanyName; echo $CompanySize; ?> </body> </html>
  16. You need a space before method, i.e. should be: <form id="Survey" name="Survey" form action="survey.php" method="post" > Rgds
  17. Also, the action type of your form is POST, so: $CompanyName = $_GET['CompanyName']; should be: $CompanyName = $_POST['CompanyName']; Rgds
  18. I think you need a space after all your echos, i.e. Name: <?php echo$_POST["CompanyName"]; ?>.<br /> Becomes: Name: <?php echo $_POST["CompanyName"]; ?>.<br /> Rgds
  19. OK, let's do it the way I would: Change your submit button back to this: <input type="submit" name="submit" value="Submit" /> Add this hidden field to the form: <input type="hidden" name="process_form" value="1"> Change your main If statement to: If ($_POST['process_form'] == 1) { This way the form processing is controlled by the hidden field. Rgds
  20. Isset means "is this variable set" or "does this variable have a value". The problem is, as your code stands you do not have a variable named process_form, so add in a name attribute: <input type="submit" name="process_form" value="process_form" /> Note that your code is just asking "Does process_form have a value", so actually the value could be anything, i.e. <input type="submit" name="process_form" value="1" /> should work too. You could then change your main if statement to: if ($_POST['process_form'] == 1) { if you want more readable code. Rgds
  21. Thanks for your reply. Are there any further views? Rgds
  22. Hi All I'm writing a review script and I get the user's review from the form as follows: $ReviewDesc=$_POST['txtReviewDesc']; Now, when I insert this data into my database, I will be using mysql_real_escape_string as I understand this is best practice. 1) Is it also advisable to use: $ReviewDesc=htmlspecialchars($ReviewDesc); before doing the database insert? I understand this should prevent any attempt at rogue html or Javascript insertion. 2) Also, is it better to use htmlspecialchars($ReviewDesc); or htmlentities($ReviewDesc); and why? 3) Is there anything else I should be doing? Thanks All.
  23. Very rough answer: Run an SQL query against your database: //store the SQL query in the result variable $result = mysql_query("SELECT * FROM YourTable WHERE YourId LIKE 10"); (write your own LIKE clause) Run your query: //associative array allows you to use field names to get results while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { .... Refer to your field name to get it's value: echo '<td>' . $row[ReviewId] . '</td>'; Rgds
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.