Jump to content

jim39

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jim39's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks. I can't get this work - when I place header("HTTP/1.0 404 Not Found"); header("Status: 404 Not Found"); it just shows all pages 404. here is my code without header("HTTP/1.0 404 Not Found"); <?php $id = (int)$_GET['id']; if(isset($id)) { include "config.php"; $sorgu = "select * from table where id=$id"; $sonuc = mysql_query($sorgu) or die(mysql_error()); $baslik1 = mysql_fetch_row($sonuc); ?> <?php #sorgula $sorgu = "select * from table"; $sonuc = mysql_query($sorgu) or die(mysql_error()); ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. Thank you! but page.php is still in use so when we add header("HTTP/1.0 404 Not Found"); header("Status: 404 Not Found"); we are automaticly redirecting all pages regardless of empty or not. I am looking for more if the page empty do 404 if not display the whatever information comes from mysql db? does this make sense? Thanks That wont always work, when you throw an error page, you should do it like so: header("HTTP/1.0 404 Not Found"); header("Status: 404 Not Found"); you will also want to make a custom 404 page, and in that case you would do this: // If the file is not found run this: header("HTTP/1.0 404 Not Found"); header("Status: 404 Not Found"); readfile("/errors/404.html"); exit;
  3. Hi I have deleted quite lot data from mysql database however, php still shows that page but blank ie page.php?id=186 - this id and all assosiated fields with this id has been removed from mysql but id still showing on the net and google cached all of them ( 600 pages) . page.php is still in use but I was wondering if there is any way not to show these blank pages/ids from mysql db and more importantly how can I remove these blank pages from google? Thanks for your help.
  4. Thanks guys, below is worked fine... $result = mysql_query("SELECT DISTINCT city FROM hotels ORDER BY city"); one more question when a city link is clicked as listed below ( say city.php?id=newyork) , I want to list all the hotels in that city will display on a city Page using the appropriate template (city.php) so how can i give a link here <?php $result = mysql_query("SELECT DISTINCT city FROM hotels ORDER BY city"); while($row = mysql_fetch_array($result)) { [b] echo $row['city'] . " " ;[/b] echo "<br />"; } ?> Newyork washington seattle kansas Thanks again
  5. Hi If anyone could help with below code as I am new to php <?php $result = mysql_query("SELECT * FROM hotels ORDER BY city"); while($row = mysql_fetch_array($result)) { echo $row['city'] . " " ; echo "<br />"; } ?> above code list all cities as below newyork newyork newyork newyork newyork newyork Washington Washington Washington Washington Washington Washington Seattle Seattle Seattle Seattle Seattle Kansas Kansas Kansas Kansas Kansas Kansas Kansas .... continue but i want to list like below and when a city link is clicked, all the hotels in that city will display on a city Page using the appropriate template Newyork washington seattle kansas .... any help much appreciate Thanks
  6. they are working however it list all products on one page that's what i don't want. I want to list them by country
  7. Hi I am new to php coding and trying list products by country - my code are as below . I want to list tours by country say tours from x country listed one page from y listed on another page. Thanks for your help <? include "config.php"; ?> <? function view_turlar(){ global $id; $queryupdate = "select * from turlar where id = '$id'"; $resultupdate = mysql_query($queryupdate); $numberupdate = mysql_num_rows($resultupdate); if ($numberupdate>0) { $x=0; while ($x<$numberupdate) { $ulkesehir=mysql_result($resultupdate,$x,"ulkesehir"); $tur_adi=mysql_result($resultupdate,$x,"tur_adi"); $facility=mysql_result($resultupdate,$x,"facility"); $fiyati=mysql_result($resultupdate,$x,"fiyati"); $x++; } // end while } // end if } // end function view_turlar function index_turlar(){ global $offcolor,$oncolor,$tblhead,$sortby,$start,$pagelimit,$id,$ulkesehir,$tur_adi,$facility,$fiyati,$ip,$tarih; # echo "<a href=turlar.php?act=new>"._NEWRECORD."</a><br>\n"; $pagelimit = 30; $initstart = 0; if (!isset($start)){$start = $initstart;} $querylimit = " limit $start,$pagelimit "; $nextstart = $start + $pagelimit; $previousstart = $start - $pagelimit; $keyword = mysql_escape_string($_GET['keyword']); if (!$keyword) $where = ""; else $where = " where ulkesehir like '%$keyword%' or tur_adi like '%$keyword%' or facility like '%$keyword%' "; if ($sortby!=""){$sorted = " order by $sortby ";} $query_turlar = "select id,ulkesehir,tur_adi,facility,fiyati,ip,tarih from turlar "; $queryall = $query_turlar.$where.$sorted.$querylimit; $resultall = mysql_query($queryall); $numberall = mysql_numrows($resultall); if ($numberall==0) {echo ""._NORECORD."";} else if ($numberall>0) { $x=0; // echo "<b>"._TURLAR." "._LIST."</b>\n"; echo "<table border=0 cellspacing=1 cellpadding=1>\n"; echo " <tr bgcolor=\"$tblhead\">\n"; echo " <td><b>Location</b></td>\n"; echo " <td><b>Tour Title</b></td>\n"; echo " <td><b> Description</b></td>\n"; echo " <td><b>Price</b></td>\n"; // echo " <td><b><a href=\"update_tours.php?sortby=ip&start=$start&pagelimit=$pagelimit&keyword=$keyword\">"._IP."</a></b></td>\n"; // echo " <td><b><a href=\"update_tours.php?sortby=tarih&start=$start&pagelimit=$pagelimit&keyword=$keyword\">"._TARIH."</a></b></td>\n"; // echo " <td colspan=3><b>".Book."</b></td>\n"; echo " </tr>\n"; while ($x<$numberall) { // changing background color for each alternate row if (($x%2)==0) { $bgcolor="#C8D2F2"; } else { $bgcolor="#E4E4E4"; } // retreiving data and putting it in local variables for each row $id=mysql_result($resultall,$x,"id"); $ulkesehir=mysql_result($resultall,$x,"ulkesehir"); $tur_adi=mysql_result($resultall,$x,"tur_adi"); $facility=mysql_result($resultall,$x,"facility"); $fiyati=mysql_result($resultall,$x,"fiyati"); //$ip=mysql_result($resultall,$x,"ip"); //$tarih=mysql_result($resultall,$x,"tarih"); echo "<tr bgcolor=\"$bgcolor\">\n"; echo " <td>$ulkesehir </td>\n"; echo " <td><a href=\"turkeytour.php?act=view&id=$id\" title=\"$tur_adi\">$tur_adi</a></td>\n"; echo " <td>".strtolower(substr(strip_tags($facility),0,40))."...</td>\n"; echo " <td>".strtolower(substr(strip_tags($fiyati),0,40))."...</td>\n"; //echo " <td><a href=\"checktour.php?act=view&id=$id\"‚¨–â‚¢‡‚킹ƒtƒH[ƒ€‚Í‚±‚¿‚ç\">‚¨–â‚¢‡‚킹ƒtƒH[ƒ€‚Í‚±‚¿‚ç</a></td>\n"; ?> <? $x++; } // end while if ($prev_page){ } for ($i = 1; $i <= $num_pages; $i++) { if ($i != $page) { } else { } } if ($page != $num_pages){ } } // end if numberall > 0 } // end function index_turlar ?> <? function baska_list(){ $data = mysql_query("SELECT id,ulkesehir,tur_adi,facility,fiyati,ip,tarih FROM turlar"); while(list($id,$ulkesehir,$tur_adi,$facility,$fiyati,$ip,$tarih) = mysql_fetch_row($data)) { echo "$ulkesehir,$tur_adi,$facility,$fiyati,$ip,$tarih<br>"; } } // end function switch($act) { case "view": view_turlar(); break; case "reserve1": reserve1_turlar(); break; default: index_turlar(); break; } // color settings $tblhead = "#FF9933"; $oncolor = "#FFCC66"; $offcolor = "#FFFFFF"; //general define("_NORECORD","No Data Exist !"); define("_RECORDNOTFOUND","No Records Found !"); define("_SEARCHRESULT","Search Result"); define("_INSERTOK","New data created."); define("Book ","Actions"); define("_EDIT","Edit"); define("_DELETE","‚¨–â‚¢‡‚킹ƒtƒH[ƒ€‚Í‚±‚¿‚ç"); define("_DETAIL","View"); define("_YOUSURE","Are you sure?"); define("_YES","Yes"); define("_NO","No"); define("_RECORDDELETED","Data Deleted"); define("_RECORD","Record"); define("_UPDATERECORD","Edit Data"); define("_RECORDUPDATED","Data Updated"); define("_PREVIOUS","Prev"); define("_NEXT","Next"); define("_SAVE"," Save"); define("_RESET","Reset"); define("_UPDATE","Update"); define("_SEARCH","Search"); define("_LIST","List"); define("_WRITEKEYWORD","Please type word(s) in search box"); define("_SEARCHDATABASE","Search database"); define("_FORMINCOMPLETE","LEfen formu doldurun..."); define("_PAGES","Page(s)"); define("_TURLAR","TURLAR"); define("_ID","Id"); define("_ULKESEHIR","ulkesehir"); define("_TUR_ADI","Tur_adi"); define("_FACILITY","Facility"); define("_FIYATI","Fiyati"); define("_IP","Ip"); define("_TARIH","Tarih"); ?>
×
×
  • 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.