-
Posts
1,216 -
Joined
-
Last visited
Everything posted by WebStyles
-
use a counter and check like this: if($count % 4 == 0){ // change row }
-
remove extra } from end.... and one from if(!$result) { (you have 2)
-
HELP! Some sort of PHP cron task kill script needed ! ! !
WebStyles replied to Vixushr's topic in PHP Coding Help
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. -
this is a javascript problem and not php, but anyway... what is $('#News') supposed to be?
-
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')
-
ok, that's a start. It basically means $_POST['details'] is not defined.
-
onclick - should change name in drop down
WebStyles replied to jimsanghvi@hotmail.com's topic in PHP Coding Help
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. -
(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....
-
sorry man, my bad. I'm reading too many posts at the same time. what errors are you getting ?
-
onclick - should change name in drop down
WebStyles replied to jimsanghvi@hotmail.com's topic in PHP Coding Help
Why are you calling me Richard ? -
where does $file come from ? (did you mean $_FILES ?)
-
place at beginning of file ini_set('display_errors', 'On'); ini_set('display_startup_errors', 'On'); error_reporting(-1);
-
foreach on 2-D array, seems simple, not working
WebStyles replied to digital_priest's topic in PHP Coding Help
...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. -
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.
-
onclick - should change name in drop down
WebStyles replied to jimsanghvi@hotmail.com's topic in PHP Coding Help
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. -
I'm not saying "change your code", I'm saying "change it temporarily so we can figure out where the problem is"...
-
foreach on 2-D array, seems simple, not working
WebStyles replied to digital_priest's topic in PHP Coding Help
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 -
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.
-
foreach on 2-D array, seems simple, not working
WebStyles replied to digital_priest's topic in PHP Coding Help
where does $instructor_code come from ? and why are you doing this: $info['role'] = $instructor_code; ?? -
@ 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.
-
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')";
-
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.
-
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.
-
please turn on your error reporting and post the exact error here. thank you.
-
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.