Jump to content

GingerRobot

Staff Alumni
  • Posts

    4,082
  • Joined

  • Last visited

Everything posted by GingerRobot

  1. I am thinking of installing linux on a 2nd hard drive on my computer because i want try using it but i also want to install php on a linux system. Do any particular distributions of linux have any advantages/disadvantages for installed php etc on them? I understand some of them come with it pre installed?
  2. From what i can workout, the title is misleading - thats why im asking for his form and php code so far.
  3. And for the second, again it depends on how you name the options in the dropdown box [code] <?php $item_category = $_POST['item_category']; if($item_category == "0")//assumes you gave it the value 0 { echo "no category selected"; exit; } ?> [/code]
  4. Yes that is all possible: the first part: [code] <?php $bid_increment = $_POST['bid_increment']; $item_type = $_POST['item_type']; if($item_type == "auction" or $item_type=="dutch auction") { if(!(is_numeric($bid_increment) && is_int($bid_increment + 0)) OR empty($bid_increment)){   echo "Invalid bid increment";   exit;   }   else{   echo "Valid bid increment";   } }elseif($item_type == "fixed price" OR $item_type=="classified"){   if(!empty($bid_increment)){     echo "you can have no bid increment with this item type!"; } } ?> [/code] This assumes that you have given the options within the dropdown box the same value as i have e.g.: <option value="auction">Auction</option> <option value="dutch auction">Dutch Auction</option> etc
  5. well yes, its looking for validation.php and cant find it. If you change the action to uploadformcomplete.php or the file name to validation.php it should work.
  6. so the form itself is called validation.php?
  7. The only way i could think of doing this would be to check every item in the POST array: [code] <?php foreach($_POST as $check){  if (empty($check) && $check !="submit")//the name of your submit button  { $num++; } } if($num != 0) {  echo "all fields are empty"; }else{  echo "not all fields are empty"; } ?> [/code]
  8. Can we see your form? That would help.
  9. Well im guessing you have installed some sort of forum php scripts, perhaps in the setup somewhere for that you can specify that non-members can vote?
  10. Im not sure, try adding it in and see what happens: $query = mysql_query("INSERT INTO `news` (id,title, by, on, message) VALUES('','$title','$by','$time','$message')");
  11. Perhaps i am missing the point here with your simplified version, but couldn't you just put the php information that you want that is currently in $variable and put it in a file and include the file?
  12. Im unsure if you are allowed spaces inside this part: (title, by, on, message) try: (title,by,on,message)
  13. [code] <? <?php $sql = mysql_query("SELECT * FROM `your table`"); while($row = mysql_fetch_array($sql)) {  $search[$row[searchterm]]++; } print_r($search); ?> [/code] With the data i chucked in to test this, outputted Array ( [dog] => 3 [cat] => 2 [rabbit] => 1 )
  14. Add an or die statement: $query = mysql_query("INSERT INTO `news` (title, by, on, message) VALUES('$title','$by','$time','$message')") or die(mysql_error()); So we can see if that is the problem.
  15. Do you know how to use it? You will need to log into it and create the tables. You may well have problems for a while though because you do not know all the fields and types the script requires. Brown2005 is right, your best bet would be to contact the person who gave you the script.
  16. Well what happens? And also, you might wanna edit out your database username and password.
  17. You are missing the terminating single quote here: OR skill3 LIKE '%$select_search%) should be OR skill3 LIKE '%$select_search%')
  18. Well you have to query the database to get the IDs that you want e.g. [code] <? $sql = mysql_query("SELECT * FROM `yourtable'"); while($row = mysql_fetch_assoc($sql)) { $title = $row['titlefield']; $id = $row['idfield']; echo "<a href='page.php?id=$id'>$title</a>"; } ?> [/code] And then on "page.php": [code] <? $id = $_GET[id]; $sql = mysql_query("SELECT * FROM `yourtable` WHERE and `idfield`='$id'"); then grab the information you need and display it. ?> [/code] You will have to modify the table and field names.
  19. Well you will have to create the tables to be able to use the script, do you have access to phpMyAdmin?
  20. You'll want to make the pattern: $pattern = '/\s\[evilgrin\]\s/is'; the \s i added means any whitespace character. for information on the modifiers, look at the manual: http://uk.php.net/manual/en/reference.pcre.pattern.modifiers.php
  21. Its not something i can do for you. Did you create the database with the table in? If so how did you create it, did you use phpMyAdmin?
  22. Could you not include a password in the php file and have that as one of the inputs on the form?
  23. Are you sure you've selected the right table? It says the table "images" doesn't exist.
×
×
  • 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.