Paste Description for Yancho
The read from DB and echo row script described in PUGMT
- Yancho
- Tuesday, December 18th, 2007 at 7:16:42pm MST
- <?php
- //session_start();
- // The file which gets the data from the table to echo
- include 'db.php';
- $ip = $_SERVER['REMOTE_ADDR'];
- //if (isset($_COOKIE['tid'])) { $tid = $_COOKIE['tid']; }
- //else { $tid = $_SESSION['tid']; }
- //echo "tid is : $tid";
- //print_r ($_SESSION);
- //print_r ($_COOKIES);
- $query = "SELECT coalesce ((SELECT tid from xml where ip = '".$ip."' order by id ASC limit 1), 'null');" ;
- //echo $query ;
- $exists = $res['coalesce'];
- if ( $exists != "null" ) {
- $query2 = "SELECT tid, id, line from xml where ip = '".$ip."' order by id ASC limit 1;" ;
- //echo $query2;
- //print_r ($result);
- $tid = $result['tid'];
- $line2 = $result['line'];
- if ( $line2 != "<br><b>Welcome to destination - Hope you enjoyed your trip</b>" ) {
- $line = $now." ".$line2;
- }
- else {
- $line = $line2 ;
- }
- $id = $result['id'];
- $_SESSION['last_inst'] = $line;
- //setcookie("last_int",$line, time()+1200);
- echo $line;
- // now deleting the line
- $dquery = "delete from xml where (tid = '".$tid."' and id = '".$id."');" ;
- //echo $dquery;
- }
- else {
- }
- ?>
advertising
Update the Post
Either update this post and resubmit it with changes, or make a new post.
You may also comment on this post.
Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.