Jump to content

bwochinski

Members
  • Posts

    116
  • Joined

  • Last visited

Everything posted by bwochinski

  1. I'd say if you can you should check if all the uploads were successful before you move anything into your "/news/" folder. Then if all are successful, move them, if not, they will be automatically discarded.
  2. Yeah I see now you've got a couple other bits of PHP in there... You should just be able to add more <?php .... ?> blocks around any other area where you use php.
  3. Yeah teng's right, so never mind my earlier attempt at an explanation. Can't really say why what I recommended worked.
  4. I tried to clarify my previous post after cooldude posted... You just need to add: At the top where you set up the rest of your variables before you start the for loop. You're getting an error because if all the uploads in your script are successfull, $count is never incremented, so when you test for " if ($count > 0) ", it doesn't like the comparison of " if ( NULL > 0 ) ".
  5. You need to end your PHP block... You can then open another PHP block at the end of the page before the "echo" at the bottom...
  6. Do you want these things to change based on the day of the week, or change the color for dates already past, or just change the color of the current date? Or some other condition I didn't mention?
  7. Initialize the variable before your for-loop. (Edit: clarified addition)
  8. If you're deleting a lot of records better to do one query...
  9. didn't test the layout, but I think that'll make it work nicely...
  10. Well, the easiest way to fix the problem at this point would be just to change that line to this: <?php $target = "../news/" . basename( $_FILES[$photo]['name']); ?>
  11. This line is your culprit: <?php $target = $target . basename( $_FILES[$photo]['name']); ?> You need to reinitialize the $target variable each iteration of the loop.
  12. My first guess would be that you're using the wrong syntax for your multidimensional arrays here: <?php $name=$_POST['name['.$id.']']; $lastname=$_POST['lastname['.$id.']']; $email=$_POST['email['.$id.']']; ?> This would be the correct way: <?php $name=$_POST['name'][$id]; $lastname=$_POST['lastname'][$id]; $email=$_POST['email'][$id]; ?>
  13. "array_keys()" returns an array of all the keys of the array. You need to refer to $key[0] and $key[1] etc...
  14. In a class global variables are declared at the beginning of the class outside of any functions. Not sure what you mean about the file...
  15. Well, I don't seen any CSS referenced there, but the problem with your images is that you have to use full pathnames, relative pathnames wont work if the page isn't being browsed from your server. <img src="http://www.yoursite.com/images/mail_big.jpg" width="494" height="481" />
  16. The only workaround I can think of would be to not use POST. Not necessarily an option of course.
  17. Basically the issue is you're skipping the first row. You call "$row = mysql_fetch_row($result);" right after the query, then again in the while loop before anything is output. Just take out that first mysql_fetch_row line.
  18. Can you paste the HTML? Or if it's long, just the relevant tags would be good.
  19. Well, simply put, you could just: SELECT username, userlevel FROM users WHERE username<>'Admin' Although if you set the Admin user to a userlevel of "10" or something, you could filter by that, to allow more than one admin level account.
  20. As has been said, you really don't want to generate hundreds of pages. The ideal solution for this situation is to use ModRewrite. I'd recommend adding another directory to your pathname, to keep the .htaccess simple. Something along the lines of: http://www.carwebsite.com/model/ford focus Then in the /model/ folder put an .htaccess file with something like this... Options -Indexes RewriteEngine on RewriteRule ^(.*)$ /model/$1/ [R,NC] RewriteRule ^(.*)/$ /model/carpage.php?model=$1 [NC] You would still do your processing in /model/carpage.php, pulling records by model. Be sure to do plenty of data checking.
  21. So actually what you're saying is that date(T) incorrectly identifies your timezone as CST, rather than correctly as CDT. Same story for the -0600 offset. CDT offset is -0500. You could put in a workaround - http://us3.php.net/manual/en/function.date-timezone-set.php Or just call tech support for the server and notify them of the problem.
  22. Looks like you either need register globals to be "on" (not recommended) or to use the $_GET[] variables: <?php $filename = 'logfile.txt'; if (is_writable($filename)) { if (!$handle = fopen($filename, 'a')) { echo "Cannot open file ($filename)"; exit; } if (fwrite($handle, $_GET['input']) === FALSE) { echo "Cannot write to file ($filename)"; exit; } echo "Success, wrote ($_GET['input']) to file ($filename)"; fclose($handle); } else { echo "The file $filename is not writable"; } ?>
  23. Yes, the last parameter on your setcookie() statement is the domain on which the cookie will be avaliable. Having it set like you have there ( to .mtechdev.com ) is probably best ( I assume the dev subdomain is a temporary development location? ) for compatability ( mtechdev.com and www.mtechdev.com will both work that way). Check setcookie on php.net for more information about the function.
  24. Have you tried changing the domain on the cookie?? Other than that, start echoing out variables at strategic points. For example, after this line: if ($_SESSION['logged_in'] != 1 && isset($_COOKIE['login_cookie'])) { echo something so you can see if that statement is even evaluating to true.
  25. I found an example using cURL by googling: <?php $URL="www.mysite.com/test.php"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,"https://$URL"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, "Data1=blah&Data2=blah");curl_exec ($ch); curl_close ($ch); ?>
×
×
  • 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.