
benjaminbeazy
Members-
Posts
460 -
Joined
-
Last visited
Never
Everything posted by benjaminbeazy
-
this should work under most circumstances, you may have to look out for how you name pages session_start(); $pageCount = 'page_'.$_SERVER['PHP_SELF']; $parts = explode(".", $pageCount); $pageCount = $parts[0]; $_SESSION[$pageCount]++; echo "Number of pageviews this session: ".$_SESSION[$pageCount];
-
use addslashes on all input before processing query
-
Thats absolutely correct. PHP will not do it. You might be able to use php in the sense to trigger some variable to happen and have javascript to then take over. I'm not a javascript expert. What you are dealing with is client side programming not server side programming. PHP is severside. I know. I am always absolutely correct. I am infallible.
-
automatically redirect after processing mysql input using header() if you wanna be really sure, add a time log that disallows an insert from the same ip and such before a certain amount of time, or something like that
-
i think you were missing a brace or two, but oh well, i changed it already to a foreach loop before i saw that so here, use this... <?php ini_set('error_reporting', 8191); ini_set('display_startup_errors', 1); ini_set('display_errors', 1); $files=array("file1.txt","file2.txt","file1.jpg"); $count=count($files); foreach($files as $var => $val){ $parts = explode(".", $val); $ext = array_pop($parts); switch ($ext){ case "jpg": echo "<img src=\"{$val}\">"; break; default: include($val); break; } } ?>
-
dont know if there is a limit but that is well below it if there is one
-
not with php, php can only modify html and cannot interact with other aspects of the client's machine, you might find something using javacript, i dunno
-
something like this should work... $page = $_SERVER['PHP_SELF']; <a href="whatever.php" class="<?php if($page == "whatever.php"){ echo "class2"; }else{ echo "class1"; }?>">Whatever</a>
-
global setting for what?????
-
http://us.php.net/manual/en/function.mysql-real-escape-string.php
-
those are browser related settings, cannot be modified by php
-
$sql = "SELECT * FROM whatever"; $result = mysql_query($sql) or die(mysql_error()); $settings = mysql_fetch_array($result); echo "title = $settings['title']"; see http://www.tizag.com/mysqlTutorial/mysqlselect.php
-
i had the same experience with 1&1. ive had dedicated servers with them a couple times and they run great, but if you do run into a problem, don't expect much for support. everyone is foreign and hard to understand, and they dont understand what you're saying 3/4 of the time. plus they dont seem very well trained and have to look up answers to the simplest mind numbing questions. but overall, their prices are great and their servers run decent for the cost.
-
try WHERE techId = {$temp['Id']}"; if $query is returning more than 1 result you need to add a limit or use a loop...
-
u could use a multidimensional array with each subarray's key being th ip, then use natsort on the main array
-
try this... <?php ini_set('error_reporting', 8191); ini_set('display_startup_errors', 1); ini_set('display_errors', 1); $files=array("file1.txt","file2.txt","file1.jpg"); $count=count($files); for ($n=0; $n < $count; $n++{ $parts = explode(".", $files[$n]); $ext = array_pop($parts); switch ($ext){ case "jpg": echo "<img src=\"{$files[$n]}\">"; break; default: include($files[$n]); break; } } ?> do you want it to include just one file each time??? if so, just use a array_rand and pull out $files[0] for the include
-
$mysql_query($del, $link_id)or die(mysql_error()); should be mysql_query($del, $link_id)or die(mysql_error());
-
u'd need to keep track of sessions on multiple domains via an access/session security script and have each of them update a logged in table keeping track of ip, session ids, time, etc.. time consuming to set up
-
what does this give you? <?php ini_set('error_reporting', 8191); ini_set('display_startup_errors', 1); ini_set('display_errors', 1); $files=array("file1.txt","file2.txt","file1.jpg"); $count=count($files); for ($n=0; $n < $count; $n++{ include($files[$n]); } ?>
-
Matching external data with database for dynamic site
benjaminbeazy replied to yourownfriend's topic in PHP Coding Help
what exactly are you looking for? -
use ini_set("include_path", "path1/:../path2:/etc"); http://us.php.net/manual/en/ini.core.php#ini.include-path
-
try natsort... $sql = "SELECT ip FROM wherever"; $result = mysql_query($sql); $ips = array(); while ( $row = mysql_fetch_assoc($result) ) { $ips[] .= $row['ip']; } $ips = natsort($ips);
-
try this... <?php $where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/")); $to = '[email protected]'; $headers = 'From: [email protected]' . "\r\n" . 'Reply-To: [email protected]' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); $subject = 'MCWL New Member - Form submission'; $message = "Form data: Name: " . $_POST['field_1'] . " Telephone: " . $_POST['field_2'] . " Email: " . $_POST['field_3'] . " Business Address: " . $_POST['field_4'] . " Address Line 2: " . $_POST['field_5'] . " City: " . $_POST['field_6'] . " State: " . $_POST['field_7'] . " Zip Code: " . $_POST['field_8'] . " Website: " . $_POST['field_9'] . " Areas of Practice: " . $_POST['field_10']; mail($to, $subject, $message, $headers); include("newmember_thankyou.html"); ?>
-
try this... $del="DELETE FROM tr, ts USING tr, ts WHERE tr.Id = $Id AND ts.user = tr.user";