Jump to content

WebStyles

Members
  • Posts

    1,216
  • Joined

  • Last visited

Everything posted by WebStyles

  1. how about this (it's just an idea, that i've used before and worked fine for me): Grab all id's from database and place in a session array if array doesn't exist yet: (assuming you unique id field is called `id`) if(!isset($_SESSION['ids']) || empty($_SESSION['ids']){ $_SESSION['ids'] = array(); $q = mysql_query("SELECT `id` FROM `Projects`"); while ($row = mysql_fetch_array($result)) { $_SESSION['ids'][] = $r['id']; } } // reorder array in random fashion every time the page is loaded (why the hell not?) shuffle($_SESSION['ids']); //grab an element from end of array while removing it from array (so it never repeates) $id = array_pop($_SESSION['ids']); // now just use that id to retrieve project from database. // when $_SESSION['ids'] is empty, it should reload again in a different order. * untested code, may contain typos and need some tweeking. hope it helps
  2. I've seen the 0 being outputted before, but at the end of pages that actually had content. If memory serves me well, it was an apache/headers issue, but I cannot remember any details.
  3. I just gave you a tip, I didn't do the work for you, so you don't just "put the code somewhere". echo that variable to see what you get while inside one of the admin folders. Then you can figure out how to protect the folders by splitting the result and adding another $_SESSION check.
  4. A better example: function confirmSubmit(formName){ if(confirm("Are you sure you want to submit this form?")){ document.forms[formName].submit(); } } hope that helps
  5. you can use onsubmit="" to call a javascript function, and use a simple confirm("are you sure"); in javascript.
  6. in what situation? when submitting a form? if so, maybe you need a little javascript to avoid jumping back and forward between pages.
  7. have you tried just: $email = "youremail@yourdomain.com"; mail($email,"test","a little test"); just to be sure your server and smtp are set up correctly?
  8. you're grabbing the $_POST['email'] value into $email, but you're using $email_to when sending it. try changing: @mail($email_to, $email_subject, $email_message, $headers); to @mail($email, $email_subject, $email_message, $headers);
  9. Would you like to try yourself or would you rather one of us just do the whole thing for you? May I suggest posting in the forum "Get your entire homework done for free". (sorry man, couldn't help myself) Seriously now: Try google.com, slap some stuff together and post the code here with any errors you're getting, and we'll help you from there.
  10. means the file does not exist. check folder and filenames, remember that on unix systems they are case-sensitive.
  11. try adding quotes: (I'm assuming $newfile has the name you want without .jpg <? rename('/members/01/myfile.jpg', '/members/01/'.$newfile.'.jpg') ?>
  12. mysql_affected_rows() will give you a count of the changed rows.
  13. Did the same for me, but if you go though the homepage, and use the links, it works. Still, since the file doing all the formatting is zstore.php, it will be hard to help without it's code.
  14. That makes the order non-alphabetical. Are you just trying to reverse the order of the original array?
  15. you can use $_SERVER['REQUEST_URI'] to grab the url path and split it accordingly to find the last folder's name.
  16. you can use explode to separate each line... something like: $file = file_get_contents('yourFileName.txt'); $lines = explode("\n",$file); foreach($lines as $line){ $parts = explode("C:",$line); echo '<br \>C:'.$parts[1]; } hope that helps.
  17. I got your private message explaining the problem... Why? Seems like you expect me (and only me??) to help... You'll stand a much better chance of getting feedback if you post the details here for everyone to participate. thanks
  18. mail() function is sending to address in $email_to, but the one posted is stored in $email.
  19. Have you tried it? did it work? Did you get an error? what error was it?
×
×
  • 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.