interpim
Members-
Posts
303 -
Joined
-
Last visited
Never
Everything posted by interpim
-
[SOLVED] problem with regular expressions or something
interpim replied to psychohagis's topic in PHP Coding Help
what is this? LINE 9 -
try using different forms with seperate actions for each button... Looks to me like you have several buttons in 1 form, essentially doing whatever action that form is telling it.
-
<?php echo $_SERVER["REMOTE_ADDR"]; ?> I google searched "display ip address in php"... first result had the answer.
-
you want to look into Pagination... here is a tutorial on how to do this... http://www.phpfreaks.com/tutorial_cat/25/Page-Number--Pagination.php
-
$filename=$user . ".txt"; fopen($filename) will create a file if it doesn't exist... if you read up on this stuff http://us3.php.net/fopen you can get a lot more info on how to do this, for example what different methods you can use, and what happens with each different method.
-
<?php $d=date("D"); if ($d=="Fri"){ echo "Have a nice weekend!"; }elseif ($d=="Sun"){ echo "Have a nice Sunday!"; }else{ echo "Have a nice day!"; } ?>
-
$mytime=date()+25200; echo $mytime;
-
try this <?php $newsheads = get_news_id(); $i = 0; while($i < count($newsheads)){ //output newsheads echo $newsheads[$i]."<br />"; $i++; } function get_news_id() { $conn = db_connect(); $result = $conn->query("SELECT newshead FROM news ORDER BY id desc LIMIT 5"); if (!$result){ throw new Exception('Could not execute query'); } $i=0; while($row = mysqli_fetch_array($result)) { $return[$i] = $row['newshead']; $i++; echo $return[$i]; } } ?>
-
would this work? while(mysqli_fetch_assoc($result))
-
reset the same cookie with empty strings.
-
$url="http://url.com"; if(empty(file_get_contents($url)){ page isn't open; } else{ header("Location: $url"); } I may be wrong on the function to use... some of the more experienced folks around here can probably straighten me out LOL
-
$_GET $_POST $_COOKIE , etc...
-
Outputting Username to stay at top of page throughout user session.
interpim replied to jameson9's topic in PHP Coding Help
build a function to pull the username from the session variable then echo that... call teh function wherever you want the username displayed -
you could give it a name... as long as it's unique you can search for it in the database via your query
-
either way will work... different methods for each though
-
you have to build it either in html, or use a loop to go through an array and write each one... either way your still going to have to write out all the states and the code for it...
-
you would have to set an id variable based on that page... usually this is done with http://domain.com?page=123 you would then use the $_GET['page'] global array to grab the variable page. then you would use that to get the rest of the page from your DB.
-
write one... If the files are stored in a DB, then create new fields for last updated/size etc... then when someone updates something have that script call your email function to get that info and mail it to you.
-
pagination & sort by stationary column header & alternate row colors
interpim replied to NoDoze's topic in PHP Coding Help
$date=date(m,d,Y); -
<?php $index_id=$_GET['id']; //however your retrieving the data... be it GET or POST //connect to your DB... then query it with the $index_id variable $query="SELECT * FROM main WHERE index='$index_id'"; $result=mysql_query($query); //assign the content of the DB to variables $page_name=mysql_result($result,0,'page_name'); $content_1=mysql_result($result,0,'content_1'); $content_2=mysql_result($result,0,'content_2'); //print the variables and any html formatting you want to the screen. echo "<title>$page_name</title>"; echo "More code etc...."; echo "more stuff... "; ?>
-
you want this forum http://www.phpfreaks.com/forums/index.php/board,58.0.html
-
Entering data into database for Shopping Cart
interpim replied to leighhobson89's topic in PHP Coding Help
n/m -
if (!isset $_POST['var']){ You didn't come by $_POST; }else{ You came by $_POST; }