Jump to content

WebStyles

Members
  • Posts

    1,216
  • Joined

  • Last visited

Everything posted by WebStyles

  1. use a counter and check like this: if($count % 4 == 0){ // change row }
  2. remove extra } from end.... and one from if(!$result) { (you have 2)
  3. you could have your cron job to start by reading a variable in a .txt file, and use php to change that variable... a simple 1 or 0 will do. if contents of file = 1, run cron job, if not, don't run it.
  4. this is a javascript problem and not php, but anyway... what is $('#News') supposed to be?
  5. you are reading the entire table just to get a count... you don't need select * for that, you also don't need to loop through the results, you can just use mysql_num_rows or just count(). also, $select = mysql_query("SELECT * FROM `posts` WHERE `post_by`='" . $pid . "' AND `post_first`='no';"); does not require a semicolon in the statement (after `fist_post`='no')
  6. ok, that's a start. It basically means $_POST['details'] is not defined.
  7. Man, Richard Feynman is dead. I'm still alive. have you made the changes I suggested in my first post? what went wrong? what errors do you get now? if you want the value to persist when you go back to the initial page, you can store it in a $_SESSION var.
  8. (I've seen this code before. Didn't you just mark this very same thing as SOLVED so you could post it again?)... I recall asking you specifically to remove the redirects and do echo's instead, so we could find the error....
  9. sorry man, my bad. I'm reading too many posts at the same time. what errors are you getting ?
  10. where does $file come from ? (did you mean $_FILES ?)
  11. place at beginning of file ini_set('display_errors', 'On'); ini_set('display_startup_errors', 'On'); error_reporting(-1);
  12. ...and both the arrays come from a database right? You can probably build the entire array from a single mysql query, using a JOIN, eliminating the need for all this, but I don't have enough information about your database tables to give you an example.
  13. yeah, I said you should test on your hosting account an hour and a half ago. imagine the time you could have saved... Glad it's working now.
  14. use: $PropertyType=$_POST['pr']; (missing quotes around pr) also, you have 2 select boxes with exactly the same name, so only one will be sent through.
  15. I'm not saying "change your code", I'm saying "change it temporarily so we can figure out where the problem is"...
  16. could you please just do this: echo '<pre>'; print_r($other_instructors_test); echo '</pre>'; and post the result here so we can see the array's structure? thanks
  17. you're always redirecting to header("Location: upload_form.php"); no matter what happens. remove the redirects for now and replace with an echo 'some error'; so you can find out where the problem is.
  18. where does $instructor_code come from ? and why are you doing this: $info['role'] = $instructor_code; ??
  19. @ AyKay47, he seems to be testing locally with xampp, when he uploads to his hosting account it will probably work perfectly. (even if he gets the smtp address from the host, he will put it into his local php.ini and it won't work anyway). @anton_1: You need to get the smtp from your ISP for your local host (i.e. the computer you have xampp installed on and are using to test stuff) and you need to try the mail() function on your hosting account. if it does not work, then you need to get the smtp address for your hosting account (this should work without modifications though). I think the problem here is that you're trying to test on your local machine without uploading to you hosting account.
  20. desc is a mysql reserved word. try with backticks: (is your table really called 'table' ?) if 'id' is an auto-increment id, you can leave it out $query = "INSERT INTO `table` (`email`, `restname`, `cname`, `phoneNum`, `desc`, `password`, `specials`, `price`, `foodtype`) VALUES ('$email','$restname','$cname','$phoneNum','$desc','$password','$specials','$price','$foodtype')";
  21. can you post some more info please? at a glance it seems you're confusing $bannerpage with a database field name, seems you need something more in the lines of: $getheaderads = mysql_query("SELECT * FROM header_banners WHERE `FIELDNAME` = '$bannerpage' ORDER BY RAND() LIMIT 1"); (change FIELDNAME to whatever you field is called) but I don't know your database structure and you provided very little information, so I cant be sure.
  22. change this: mysql_query($query) or die ('Error updating database. Please try again later.'); to this: mysql_query($query) or die ('Error updating database. Please try again later. '.mysql_error()); and post the error here please.
  23. please turn on your error reporting and post the exact error here. thank you.
  24. in your original post (in the other forum) you said: I would start by trying to understand exactly what your code is doing, (and why it's kind of messy). Once you understand this, you will be able to add all the fields you want.
×
×
  • 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.