Jump to content

AdRock

Members
  • Posts

    913
  • Joined

  • Last visited

Everything posted by AdRock

  1. Why don't you use mysql full text searches? It just searches the query using those keywords entered
  2. What do you mean "drop a folder or files into the stucture of the website making it easily extensable"?
  3. Loads of tutorials here from session management and login scripts http://www.plus2net.com/php_tutorial/site_map.php
  4. I made a php calendar following a couple tutorials and it does what you want it to do. Mine has a date range tho so it highlights all days between a date range Here is the calendar turorial http://www.phpjabbers.com/phpexample.php?eid=26
  5. Are you sure the $sql2 query is being executed? To check put after thw query var_dump($sql2) and it should tell you what is being put in the query, you may have variables that aren't set becuase to get ERROR, $result2 can't be taken
  6. If you want the answers seperated by commas $q1 = mysql_real_escape_string(implode(' ',',',$_POST["q1"])); $q2 = mysql_real_escape_string(implode(' ',',',$_POST["q2"])); $q3 = mysql_real_escape_string(implode(' ',',',$_POST["q3"])); $q4 = mysql_real_escape_string(implode(' ',',',$_POST["q4"])); $q5 = mysql_real_escape_string(implode(' ',',',$_POST["q5"])); $q6 = mysql_real_escape_string(implode(' ',',',$_POST["q6"])); $q7 = mysql_real_escape_string(implode(' ',',',$_POST["q7"])); $q8 = mysql_real_escape_string(implode(' ',',',$_POST["q8"])); $q9 = mysql_real_escape_string(implode(' ',',',$_POST["q9"]));
  7. Why don't you use JOIN on the tables in one query
  8. Jut out of curiosity, does your query return any results if you use phpmyadmin or something. That's how I test if a query is working and returning any results
  9. I would have all the checkboxes with the same name liek you said checkbox[] The on the $_POST i have something like this $quals = implode(",",$_POST['quals']); The use a foreach on the $split foreach($split as $s) { if($s == 'car') { echo 'Car checkbox here'; } }
  10. Not tried but i found this http://akinas.com/pages/en/blog/mysql_enum/
  11. use mysql_real_escape_string on your $_POST variables also
  12. You've not set any values to each of you options in the drop down menu
  13. The unxepected $end means you're missing a curly brace } somewhere
  14. the 41 should have a variable assigned to it like ?page=41 or whatever name you want the you would use $_GET['page'];
  15. Are you not getting an error on this line? $url = "http://localhost/workflow/new.php?cat=select_workflow" no semi colon
  16. You could use a switch switch($_POST['RadioGroup']) { case 0: $to = "Service@gmail.com"; break; case 1: $to = "service@domain.com"; break; default: }
  17. A function from w3schools to prevent against database attacks <?php function check_input($value) { // Stripslashes if (get_magic_quotes_gpc()) { $value = stripslashes($value); } // Quote if not a number if (!is_numeric($value)) { $value = "'" . mysql_real_escape_string($value) . "'"; } return $value; } ?> then change to $primary_contact = check_input($_POST['primary_contact']); $address_1 =check_input( $_POST['address_1']); $address_2 = check_input($_POST['address_2']); $address_3 = check_input($_POST['address_3']); $town = check_input($_POST['town']); $county = check_input($_POST['county']); $postcode = check_input($_POST['postcode']); $email = check_input($_POST['email']); $telephone_1 = check_input($_POST['telephone_1'); $telephone_2 =check_input( $_POST['telephone_2']); $fax = check_input($_POST['fax']); your query should be like $SQL = " INSERT INTO fishery_b_details (primary_contact, address_1, address_2, address_3, town, county, postcode, email, telephone_1, telephone_2, fax) VALUES ($primary_contact, $address_2, address_3 = '$_POST[address_3]', $town, $county, $postcode, $email, $telephone_1, $telephone_2, $fax) ON DUPLICATE KEY UPDATE primary_contact='$primary_contact', address_1='$address_1', address_2='$address_2', address_3='$address_3', town='$town', county='$county', postcode='$postcode', email='$email', telephone_1='$telephone_1', telephone_2='$telephone_2', fax='$fax' "; this line should be $sql = "SELECT * FROM fishery_b_details WHERE fishery_id = '".$_SESSION['fishery_id']."' "; Have you got the form to display now? Fix these errors and see what happens It should be easy to fix your problems
  18. You need to show some code so we can see what the problem is
  19. $fname=$row[fullname]; $gender=$row[gender]; $answer1=$row[answer1]; $answer2=$row[answer2]; $answer3=$row[answer3]; $answer4=$row[answer4]; $answer5=$row[answer5]; $answer6=$row[answer6]; $answer7=$row[answer7]; $answer8=$row[answer8]; $answer9=$row[answer9]; $comments=$row[comments]; you forgot to add the ' after [ and before ] $fname=$row[fullname]; $gender=$row[gender]; $answer1=$row['answer1']; $answer2=$row['answer2']; $answer3=$row['answer3']; $answer4=$row['answer4']; $answer5=$row['answer5']; $answer6=$row['answer6']; $answer7=$row['answer7']; $answer8=$row['answer8']; $answer9=$row['answer9']; $comments=$row['comments'];
  20. Thanks premiso....it now works. I was using extract on teh $row and it didn't like it....put the code in the while loop and it worked
  21. for($i=1;$i<9;$i++) { $experience = ${$experience . $i}; if(!empty($experience) { $experience = explode(",",$experience); echo "<tr><td>&nbs;</td>"; foreach($experience as $exp) { echo "<td class='fields'>".ucwords(str_replace('_',' ',$exp))."</td>"; } echo "</tr>"; } } Didn't work I tried something similar but it displays nothing
  22. What do you mean put them into an array....i don't think i understand....put what into an array?
  23. I have a longl list of if statements and the only thing that is different is the variable name. The variable name itself is the same but just a number at the end of the variable changes experiece0, experience1, experience2.....experience9 This is the current code if(!empty($experience1)) { $experience1 = explode(",",$experience1); echo "<tr><td> </td>"; foreach($experience1 as $exp1) { echo "<td class='fields'>".ucwords(str_replace('_',' ',$exp1))."</td>"; } echo "</tr>"; } if(!empty($experience2)) { $experience2 = explode(",",$experience2); echo "<tr><td> </td>"; foreach($experience2 as $exp2) { echo "<td class='fields'>".ucwords(str_replace('_',' ',$exp2))."</td>"; } echo "</tr>"; } ... ... ... ... if(!empty($experience3)) { $experience3 = explode(",",$experience3); echo "<tr><td> </td>"; foreach($experience3 as $exp3) { echo "<td class='fields'>".ucwords(str_replace('_',' ',$exp3))."</td>"; } echo "</tr>"; } i want to make it more efficient by using a for loop and incrementing the variable number like this but it doesn't work for($i=1;$i<9;$i++) { if(!empty($experience.$i)) { $experience.$i = explode(",",$experience.$i); echo "<tr><td>&nbs;</td>"; foreach($experience.$i as $exp.$i) { echo "<td class='fields'>".ucwords(str_replace('_',' ',$exp.$i))."</td>"; } echo "</tr>"; } } i get this error message
×
×
  • 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.