Jump to content

ChaosKnight

Members
  • Posts

    183
  • Joined

  • Last visited

    Never

Everything posted by ChaosKnight

  1. Hi gevans, thanks for your reply, here is some full code, I hope you'll be able to trace the problem, once again thanks a lot! _________________________________________ Index page <?php if (!isset($_GET['page'])){ $page = "country"; }else{ $page = $_GET['page']; } switch($page){ case "home": include ("home.php"); break; case "about": include ("about.php"); break; case "country": include ("country.php"); //Next page included break; case "accomodation": include ("accomodation.php"); break; case "rental": include ("rental.php"); break; case "maps": include ("maps.php"); break; case "bookings": include ("bookings.php"); break; case "contact": include ("contact.php"); break; case "thankyou": include ("thankyou.php"); break; default: include ("home.php"); break; }?> ___________________________________________ Country page <?php if ( IsSet($_GET['country'])) { $country = $_GET['country']; }else{ $country = southafrica; } $db_link = mysql_connect($db_host, $db_user, $db_pass); if ( ! $db_link ) die( "Couldn't connect to mySql Server<br />"); //echo( "Connected to mySql Server<br />"); //Select database $db_select = mysql_select_db($db); if ( ! $db_select ) die("Couldn't connect to Database<br />"); //echo("Connected to Database<br />"); ?> <table width="780" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="images/<? print ($country) ?>_main.gif" width="780" height="119" /></td> </tr> <tr> <td class="content_bg"><table width="780%" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="250" valign="top"><table width="780" height="250" border="0" cellpadding="0" cellspacing="0"> <tr valign="top"> <td align="left"><?php include("countries.php"); ?></td> </tr> </table></td> </tr> </table></td> </tr> </table> ____________________________________________ Countries page <table width="780" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="content_bg"><table width="780%" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="250" valign="top"><table width="780" height="250" border="0" cellpadding="0" cellspacing="0"> <tr valign="top"> <td width="190" align="center"><table width="180" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="images/spacer.gif" width="8" height="8" /></td> </tr> <tr> <td><img src="maps/<? print($country) ?>.gif" width="180" height="190" /></td> </tr> <tr> <td align="center"> <? $table = "countries"; //Run query $query3 = "SELECT * FROM $table WHERE `country` = '".$country."' AND `active` = 'yes'"; $result3 = mysql_query($query3, $db_link); //Number of rows $num_rows3 = mysql_num_rows($result3); if ( $num_rows3 < 1 ) { print( "<span class=\"error_text\">NO RESULTS FOUND. Please try again...</span>" ); } else{ //Display Country Description while ($row = mysql_fetch_array($result3)) { //Column names $area = $row[area]; $capital = $row[capital]; $currency = $row[currency]; $languages = $row[languages]; $time = $row[time]; $dial = $row[dial]; $voltage = $row[voltage]; $car = $row[car]; print (" <table width=\"180\" border=\"0\" cellspacing=\"2\" cellpadding=\"0\"> <tr> <td class=\"body_bold\">Area:</td> </tr> <tr> <td class=\"body_text\">$area</td> </tr> <tr> <td class=\"body_bold\">Capital:</td> </tr> <tr> <td class=\"body_text\">$capital</td> </tr> <tr> <td class=\"body_bold\">Currency:</td> </tr> <tr> <td class=\"body_text\">$currency</td> </tr> <tr> <td class=\"body_bold\">Languages:</td> </tr> <tr> <td class=\"body_text\">$languages</td> </tr> <tr> <td class=\"body_bold\">Time:</td> </tr> <tr> <td class=\"body_text\">$time</td> </tr> <tr> <td class=\"body_bold\">Dialing Code:</td> </tr> <tr> <td class=\"body_text\">$dial</td> </tr> <tr> <td class=\"body_bold\">Voltage:</td> </tr> <tr> <td class=\"body_text\">$voltage</td> </tr> </table> "); } } ?> </td> </tr> <tr> <td align="center"><img src="images/spacer.gif" width="8" height="8" /></td> </tr> <tr> <td align="center"><table width="180" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="headings/game.gif" width="180" height="32" /></td> </tr> <tr> <td> <? //Display Game Parks //Set Table $table = "countries"; //Run query $query5 = "SELECT * FROM $table WHERE `country` = '".$country."' AND `active` = 'yes' "; $result5 = mysql_query($query5, $db_link); //Number of rows $num_rows5 = mysql_num_rows($result5); if ( $num_rows5 < 1 ) { print( "<span class=\"error_text\">NO RESULTS FOUND. Please try again...</span>" ); } else{ //Display Country Description while ($row = mysql_fetch_array($result5)) { //Column names $parks = $row[parks]; print (" <table width=\"180\" border=\"0\" cellspacing=\"2\" cellpadding=\"0\"> <tr> <td class=\"body_text\" align=\"left\">$parks</td> </tr> </table> "); } } ?></td> </tr> </table></td> </tr> <tr> <td align="center"><img src="images/spacer.gif" width="8" height="8" /></td> </tr> <tr> <td align="center"><table width="180" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="55" align="center" class="banner_border"><span class="advertise">ADVERTISE HERE</span><br> <span class="body_text">Call +27 82 688 2419 </span></td> </tr> <tr> <td><img src="images/spacer.gif" width="8" height="8" /></td> </tr> </table></td> </tr> </table></td> <td width="400" align="center"> <table width="370" border="0" cellspacing="0" cellpadding="0"> <tr> <td> <? //Display Middle Country Content //Set Table $table = "countries"; //Run query $query = "SELECT * FROM $table WHERE `country` = '".$country."' AND `active` = 'yes' "; $result = mysql_query($query, $db_link); //Number of rows $num_rows = mysql_num_rows($result); //Number of records $num_rec = 1; $startnum = ( IsSet( $_GET["startnum"] ) ? $_GET["startnum"] : 0 ); //Run query - limit records on page $query2 = "SELECT * FROM $table WHERE `country` = '".$country."' LIMIT $startnum, $num_rec"; $result2 = mysql_query($query2, $db_link); //Number of rows $num_rows2 = mysql_num_rows($result2); if ( $num_rows2 < 1 ) { print( "<span class=\"error_text\">NO RESULTS FOUND. Please try again...</span>" ); } else{ //Display Country Description while ($row = mysql_fetch_array($result2)) { //Column names $country2 = $row[country]; $description = $row[description]; $provinces = $row[provinces]; $cities = $row[cities]; $area = $row[area]; $capital = $row[capital]; $currency = $row[currency]; $cultural = $row[cultural]; $parks = $row[parks]; $languages = $row[languages]; $time = $row[time]; $dial = $row[dial]; $voltage = $row[voltage]; $car = $row[car]; $active = $row[active]; print (" <table width=\"370\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> <tr> <td><img src=\"images/spacer.gif\" width=\"12\" height=\"12\" /></td> </tr> <tr> <td valign=\"top\"><img src=\"headings/$country2.gif\" width=\"300\" height=\"18\" /></td> </tr> <tr> <td><img src=\"images/spacer.gif\" width=\"7\" height=\"7\" /> </td> </tr> <tr> <td class=\"body_text\">$description</td> </tr> <tr> <td align=\"center\"><img src=\"images/spacer.gif\" width=\"8\" height=\"8\" /></td> </tr> <tr> <td><img src=\"headings/cities.gif\" width=\"295\" height=\"16\" /></td> </tr> <tr> <td class=\"body_text\">$cities</td> </tr> <tr> <td align=\"center\"><img src=\"images/spacer.gif\" width=\"8\" height=\"8\" /></td> </tr> <tr> <td align=\"center\"><img src=\"images/spacer.gif\" width=\"8\" height=\"8\" /></td> </tr> <tr> <td><img src=\"headings/interest.gif\" width=\"295\" height=\"16\" /></td> </tr> <tr> <td class=\"body_text\">$cultural</td> </tr> </table> "); } } ?></td> </tr> <tr> <td><img src="images/spacer.gif" width="8" height="8" /></td> </tr> <tr> <td height="55" align="center" class="banner_border">hts banner</td> </tr> <tr> <td align="center"><img src="images/spacer.gif" width="8" height="8" /></td> </tr> </table></td> <td width="190" align="center"><table width="180" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="images/spacer.gif" width="12" height="12" /></td> </tr> <tr> <td width="180" height="18" valign="bottom"><table width="180" border="0" cellspacing="0" cellpadding="0"> <tr> <td> <? //Display Premium Accomodation //Set Table $table = "hotels"; //Run query $query4 = "SELECT * FROM $table WHERE `country` = '".$country."' AND `homepage` = 'yes' AND `active` = 'yes' ORDER BY `name` ASC "; $result4 = mysql_query($query4, $db_link); //Number of rows $num_rows4 = mysql_num_rows($result4); if ( $num_rows4 < 1 ) { print( " <table width=\"180\" height=\"55\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"banner_border\"> <tr> <td class=\"advertise\">ADVERTISE HERE<br><span class=\"body_text\">Premium Hotel Listing</span></td> </tr> </table> " ); } else{ //Display Country Description while ($row = mysql_fetch_array($result4)) { //Column names $logo = $row[logo]; $name = $row[name]; $logo_width = $row[logo_width]; $logo_height = $row[logo_height]; print (" <table width=\"180\" border=\"0\" cellspacing=\"2\" cellpadding=\"0\"> <tr> <td class=\"body_bold\"><img src=\"hotels/logos/$logo.gif\" width=\"$logo_width\" height=\"$logo_height\" /></td> </tr> <tr> <td class=\"body_text\"><a href=\"index.php?page=accomodation&country=$country&hotel=$name\">$name</a></td> </tr> </table> "); } } ?></td> </tr> <tr> <td><img src="images/spacer.gif" width="8" height="8" /></td> </tr> <tr> <td><img src="headings/accomodation.gif" width="180" height="16" /></td> </tr> <tr> <td> <? //Display Accomodation //Set Table $table = "hotels"; //Run query $query6 = "SELECT * FROM $table WHERE `country` = '".$country."' AND `active` = 'yes' ORDER BY `name` ASC "; $result6 = mysql_query($query6, $db_link); //Number of rows $num_rows6 = mysql_num_rows($result6); if ( $num_rows6 < 1 ) { print( "<span class=\"error_text\">NO RESULTS FOUND. Please try again...</span>" ); } else{ //Display Country Description while ($row = mysql_fetch_array($result6)) { //Column names $logo = $row[logo]; $name = $row[name]; print (" <table width=\"180\" border=\"0\" cellspacing=\"2\" cellpadding=\"0\"> <tr> <td class=\"body_text\"><a href=\"index.php?page=accomodation&country=$country&hotel=$name\">$name</a></td> </tr> </table> "); } } ?></td> </tr> </table></td> </tr> <tr> <td align="left" valign="top"></td> </tr> <tr> <td width="180" align="left" valign="middle"><img src="images/spacer.gif" width="8" height="8" /></td> </tr> </table></td> </tr> </table></td> </tr> </table></td> </tr> </table>
  2. One last thing... The fact that it doesn't work in Internet Explorer is where my headache is coming from! I don't know of any browser differences with PHP or MySQL, please correct me if I'm wrong... I want to finish this big mess as soon as possible! Thanks
  3. I don't think you can do that with php... I could be wrong... I think you'll be able to make like an embedded object of the radio station... Go and take a look at: http://www.highveld.co.za/planet947/streaming.asp on the left hand side is a link to listen to the radio live, if you click it a pop-up will go to: http://www.highveld.co.za/planet947/player.asp where you can listen to their radio... Unfortunately I never attempted something like this before, otherwise I would've helped with the code... Maybe someone else that reads this thread will be able to help. Good luck with the station!
  4. Hi guys, I hope you'll be able to help me, I don't know wheter this is an MySQL or PHP related question, so I'll post it on both just for incase... I'm new to PHP and MySQL and I'm loving it, but stumbled upon a rather upsetting problem... Once again I don't know if it's a syntax problem or just browser differences, I will appreciate some help seeing that my deadline is approaching really fast! My web application is for a tourism website with a lot of data, I'm only using MySQL to store the info and retrieve it... firstly I have the index page which doesn't have any errors that I currently know about, next is a page include via php, this still works in all browsers, the next one is where I get my headache from! It's also an php include which contains the code that retrieves all the MySQL info... Unfortunately my clients web host only supports PHP 5.1.6 and MySQL 3.23.51, and I have to respect their decision to sticking with that web host... Here's how I'm currently connecting to the database: (PLEASE NOTE: due to client's concern for privacy I left out page names and other data) __________________________________________________________ //Connect to database $db_link = mysql_connect($[host], $[user], $[password]); if ( ! $db_link ) die( "Couldn't connect to mySQL Server<br />"); //echo( "Connected to mySQL Server<br />"); //Select database $db_select = mysql_select_db($db); if ( ! $db_select ) die("Couldn't connect to Database<br />"); //echo("Connected to Database<br />"); __________________________________________________________ And seeing that the 3rd include doesn't work in IE, im also going to add the code I use for that: (PLEASE NOTE: due to client's concern for privacy I left out page names and other data) __________________________________________________________ <?php include("[page name].php"); ?> __________________________________________________________ isn't this code supposed to include in IE?? next is the code in the 3rd include where I select the database and table and retrieve the info... Afterwards please correct my problem If you come accross it! (PLEASE NOTE: due to client's concern for privacy I left out page names and other data) __________________________________________________________ $table = "[table name]"; //Run query $query3 = "SELECT * FROM $table WHERE `object` = '".$object."' AND `active` = 'yes'"; $result3 = mysql_query($query3, $db_link); __________________________________________________________ later in the code is the print() function that I use to display the data in a table-like form on the web page... If you can help me or know where I can get help, please post a message!! Thanks in advance, ChaosKnight
×
×
  • 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.