POG1
Members-
Posts
71 -
Joined
-
Last visited
Never
Everything posted by POG1
-
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']
-
In the query select all the needed fields and put them into the hidden parts..
-
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.
-
ini_set() or try looking in the error log.
-
You will need to change the error reporting to E_ALL
-
Where is the date? :S Is this supposed to be the date? 19 21 24 32 24 18 23 29.61
-
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?
-
($rssFeeds as $feed) { readFeeds($feed);} That line is doing nothing..
-
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>';
-
echo $var[0]; would be a faster alternative
-
See if this works.. <?php $watermark = imagecreatefrompng(__PATH__.'/gallery_collegewomen2006/admin/msc_watermark.png'); ?>
-
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
-
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.
-
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
-
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 />';
-
I'm not very good at regex but you could try something like.. preg_replace('[^a]','',$var);
-
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
-
Why would you want to make a nice URL into a not nice URL?
-
Object passing through sessions does not work in windows vista
POG1 replied to menwn's topic in Application Design
Why would you even want to run it on windows? -
$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. }
-
$count = count($shoulder_array); echo $shoulder_array[mt_rand(0,$count)];
-
is your char encoding ISO?
-
Can someone help convert this include function to GET?
POG1 replied to violetradio's topic in PHP Coding Help
file_exsists & in_array functions would help to only allow what you want. -
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 }
-
Can someone help convert this include function to GET?
POG1 replied to violetradio's topic in PHP Coding Help
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');