Jump to content

Jessica

Staff Alumni
  • Posts

    8,968
  • Joined

  • Last visited

  • Days Won

    41

Everything posted by Jessica

  1. they don't have to escape them, you could do print htmlentities($title) instead of just printing it.
  2. "SELECT count(*) AS numRows FROM files"
  3. [quote author=anatak link=topic=123788.msg512243#msg512243 date=1169644815] $newid = mysql_insert_id(); Do you know how to do this with ADOdb connections ? I got the message Warning: mysql_insert_id(): A link to the server could not be established wich was to be expected. [/quote] I use ADOdb and I can use mysql_insert_id. What's the exact code you used?
  4. Ah good point. If this is the entire page, you're right, RG is on. If there's more code, perhaps $var = $_SESSION['var']; earlier on? I dunno, either way. You're right it should be off. I think the code I posted will fix the immediate problem.
  5. !== compares types as well as value, not what you want here. Try != or instead use if(!isset($initial)){
  6. [quote author=SemiApocalyptic link=topic=124024.msg513393#msg513393 date=1169752312] I don't have an answer to your question, but you should [i]really[/i] be scripting with register_globals switched off in your php.ini [/quote] The fact that this isn't working makes it look like globals IS off.
  7. if(!isset($var)){$_SESSION['var']="23213123";} echo "$var"; When you first load the page var ISN'T set. $_SESSION['var'] is, but $var is not. Change to: if(!isset($var)){   $var = '23213123';   $_SESSION['var']=$var; } echo $var; And it will echo every time. ps: don't put quotes around varables that don't need them.
  8. or save to the session so that the users can't see it.
  9. What I would do is create an array. Have a field in your table called weight, and make it an int. Banner1 would have weight 2, banner 2, weight 1. Get all the banners from the table and put them in an array with their ID as the key and their weight as the value. foreach($bannersListFromDB AS $bannerID => $weight){   for($i=1; $i<=$weight; $i++){     $banners[] = $bannerID;   } } So you'll end up with this: $banners[0] = '1'; $banners[1] = '1'; $banners[2] = '2'; Then shuffle the array and pick the first one, or use array_rand.
  10. It's sorting them as strings, it can't tell you want it to be chronological. You need to take out the date part, use strtotime() to get a timestamp, then sort that.
  11. Well I can't tell which version it is because it's in a class, but if it's mysql_fetch_array - the manual says: "Returns an array that corresponds to the fetched row and moves the internal data pointer ahead." So that's why it goes to the next one automatically.
  12. You don't have the ; on the end of the line.
  13. echo $r->EntryID; <- does this line still have the ; on it, or did you erase it.
  14. Yes but you never had the closing " on the href. I don't see a problem with mine, but if escaping the double quotes works better, do that.
  15. http://dev.mysql.com/downloads/ Click "I can do it myself". You could just get some cheap hosting, from GoDaddy (php&mysql only 3.99/mo is good), and not worry about installing anything.
  16. You never close your link. Try this [code=php:0] echo '<a href="' . $_SERVER['PHP_SELF'] . '?action=delete&row_id='. $r->EntryID . '">delete</a>'."\n"; [/code]
  17. Your question is pretty vague. What is it doing that you think is wrong?
  18. % is the wildcard character. It means any number of characters in this spot.
  19. It helps if you post the error. The rest of you - $_REQUEST holds the $_GET and $_POST.
×
×
  • 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.