Jump to content

waterssaz

Members
  • Posts

    111
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Female
  • Location
    Carlisle,England

waterssaz's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. All that snippet of code essentially does is select one of the files from the array at random everytime the page is called, so yes it would change when the page is refreshed and on each visit, although due to the nature of random and depending on how many files you specify this may sometimes stay the same. The files can contain whatever code you want, Regards Sarah
  2. Ok, can't say I've actuallly tried this with jut php before but I could think of a few ways that should work, some will be more graceful than others. One to try then, How about an array of files that you want to include and then use something like <?php $files = array("file1.html", "file2.txt", "file3.php", "file4.php"); $rand = array_rand($files); include ($files[$rand]); ?> You could include this in on each page or to make it more portable incase you change the array, include it in a class file or function and call it from there. Forgive any syntax errors as I haven't tested it Hope it helps Regards Sarah
  3. Are you trying to create some kind of dynamic footer I take it but purely with PHP?
  4. You mean you want to count how many occurences of each there are? If so just do a simple GROUP BY query For example Select ID, COUNT(ID) from [YOUR_TABLE_NAME] GROUP BY ID or in PHP you can use the function array_count_values(array) Hope either of these helps :-) Regards Sarah
  5. You say you can't evaluate 'any' against the database which is why you have so many queries going on which is overcomplicating the code in my view. Why don't you evaluate the $_SESSION['type' and $_SESSION['area'] 1st to seewhat they contain like so: if ($_SESSION['area']== 'any') { $area = '%'; } else{ $area = $_SESSION['area']; } if ($_SESSION['type']== 'any') { $type = '%'; } else{ $type = $_SESSION['type']; } Then run your query inserting those variables but using like()
  6. If you say you are putting multiple entries into the database, I presume you are using some kind of loop, if so is $reference set inside or out of the loop? :-)
  7. beat me lol :-) But mine had extra BETWEEN typo as well
  8. no like SELECT *FROM model_picturesWHERE user_id = colname AND model_pictures.user_picture_date BETWEEN BETWEEN DATE_SUB( CURDATE( ) ,INTERVAL 7 DAY ) AND CURDATE( )
  9. Thats because you are sending $name as a string literal and not a variable. Take it out of the quotes like this: mail('email@email.com','Application Completed',$name.' has completed the exam',$body);
  10. AHhhh the dreaded common fpdf error .Also make sure you have no whitespace after the code as well :-) Sorry I meant to say whitespace at the end of the include files :-)
  11. will the users at the office go through proxy before accessing your web page?
  12. Yes you could do that which would make your code more portable should you ever move it to another host, however it depends how many files you will have to change. If there are a lot, then you could just turn on short tag support as I explained above although i have never been a fan of short tags at all :-)
  13. To enable short tags on WAMP left click the wamp taksbar icon and select PHP > PHP Settings > short open tag.
  14. As i said the short tags are probably not supported on your configuration which means that the php is being interprted as literal text
×
×
  • 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.