Jump to content

POG1

Members
  • Posts

    71
  • Joined

  • Last visited

    Never

Everything posted by POG1

  1. use the GET method to do it. Create a link inside the loop to something like file.php?car=idNumber on that page you can then search using $_GET['car'] or $_REQUEST['car']
  2. In the query select all the needed fields and put them into the hidden parts..
  3. To get the headline values you can just select the newest. Change the headlineFieldName to the name that the headline field is stored in, change news to the table name and change id to the appropriate field (use a key or date) $result = @mysql_query("SELECT `headlineFieldName` As a FROM `news` ORDER BY `id` DESC LIMIT 1;",$conn) or die('news selection error'); if(@mysql_num_rows($result)) { $newsTitle = mysql_fetch_array($result,MYSQL_ASSOC); $newsTitle = $newsTitle['a']; $title = $newsTitle . ' - Latest news from This is Dunstable'; } else { $newsTitle = 'No News - Latest news from This is Dunstable'; There probably is a faster way but this will get the title without having to add them manually.
  4. ini_set() or try looking in the error log.
  5. You will need to change the error reporting to E_ALL
  6. Where is the date? :S Is this supposed to be the date? 19 21 24 32 24 18 23 29.61
  7. Why do you need like 14 echos in a row :S And i dont understand what your trying to do. Do you want it so that when you click a row it will add another empty row at the bottom?
  8. ($rssFeeds as $feed) { readFeeds($feed);} That line is doing nothing..
  9. If i am right in every page you include a file in every page that does all the working out, try something like this; it will work based on the page URL. if($_SERVER['SCRIPT_NAME'] == '/news.php') { // ... get page titles $title = $newsTitle . ' - Latest news from This is Dunstable'; } else { $title = 'Dunstable, Bedfordshire - Information, and local resources from This is Dunstable'; } echo '<title>'.$title.'</title>';
  10. echo $var[0]; would be a faster alternative
  11. See if this works.. <?php $watermark = imagecreatefrompng(__PATH__.'/gallery_collegewomen2006/admin/msc_watermark.png'); ?>
  12. You won't want to remove things as it may do things to the file, why not just only accept it if it contains the alphabetic chars? http://uk2.php.net/manual/en/function.ctype-alpha.php
  13. You are trying to use JS in PHP Try wrapping the JS into a function then add into the JS secion/files of your page.
  14. I'm sure you will be doing it with a quite a few URLs do try something like this.. RewriteRule ^/([a-zA-Z]+)/([a-zA-Z]+)\.html$ /index.php?site=$1&page=$2 [L] I'm not very good with regular expressions but if it works as i think it will then you could have something like; iraqidinars/newiraqidinars.html and it would go to; index.php?site=iraqidinars&page=newiraqidinars
  15. This line is the error: echo"<input type=\"button\" value=\"Delete\" onClick=\""; unlink($myfile); "\"><br />"; It's not printing the html after the unlink function.. echo '<input type="button" value="Delete" onClick="'.unlink($myfile).'"><br />';
  16. I'm not very good at regex but you could try something like.. preg_replace('[^a]','',$var);
  17. SELECT COUNT(*) as Num FROM log WHERE live = 99 ORDER BY `id` DESC LIMIT 8; You will need to change `id` to the primary key field
  18. Why would you want to make a nice URL into a not nice URL?
  19. $sql = mysql_query(sprintf("SELECT `visitor_ip`,`visitor_day` FROM `visitors_list` WHERE `visitor_ip` = '%u' AND `visitor_day` = '%u';",(int)$visitor_ip,(int)$visitor_day)) or die('error!'); if(mysql_num_rows($sql)) { // A record exists. } else { // no record exists insert. }
  20. $count = count($shoulder_array); echo $shoulder_array[mt_rand(0,$count)];
  21. file_exsists & in_array functions would help to only allow what you want.
  22. I don;t know exactly what you are asking but I cooked something up quickly. session_start(); if(isset($_SESSION['number']) { // do some checks and do other things $thirtyMins = 60*30; if(isset($_SESSION['last']) AND time() > ($_SESSION['last'] + $thirtyMins)) { // update the last and number sessions } else { // no last done set the last session and do the first action to the number } } else { // no session and do something else }
  23. You can set it in the URL. For example index.php?page=home would set $_GET['home'] to the value of 'home' To use it in your page it is very simple. $page = isset($_GET['page']) AND ctype_alnum($_GET['page']) ? $_GET['page'] : 'inc_home'; include($page.'.php');
×
×
  • 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.