PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > alt.php > PHP SELECT Case and Passing Variable problem.
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
PHP SELECT Case and Passing Variable problem.

Réponse
 
LinkBack Outils de la discussion
Vieux 08/12/2007, 09h57   #1
cgkh.webservices
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut PHP SELECT Case and Passing Variable problem.

Ok! I am going nuts!

I am migrating a client's website from one domain to another with the
same hosting provider.

On the old site I had a car hire page which offered data in 4
languages using a very basic php/mysql SELECT CASE syntax.

It can be seen here:

Default English version:

http://www.solpraiaferias.com/fred/index_template.php

Portuguese Version:

http://www.solpraiaferias.com/fred/i....php?option=pt

This works fine!

However, I am now trying to migrate the site to http:// www.paraisolpraia.com
with the same hosting company.

Default English version:

http://www.paraisolpraia.com/carhire...x_template.php

This works fine.

HOWEVER, and here is the rub:

When submitting the url for the Portuguese Version:

http://www.paraisolpraia.com/carhire....php?option=pt

The server ONLY serves up the Default English text. I have checked the
MYSQL database tables on both sites and they are both the same.

It appears that the variable '?option=pt' is not being passed on the
new site. The same happens with the other languages and I know the
data is in the MYSQL table.

I admit that I am not a very experienced programmer but have had the
old site working for 18 months without problems.

The relevant PHP code is here:

"

<?php

// Connects to your Database
require_once("../psp_lig.php");

$_POST['option'];

switch ($option) {

// default car hire page

case "":

$lang="en";
$data = "SELECT * FROM LUZCAR WHERE fora = 'active' LIMIT 0, 30";
$title = "SELECT * FROM CAR_HIRE_TITLES WHERE lang = '$lang' ";
$result = mysql_query($data);
$result_2 = mysql_query($title);
$info_2 = mysql_fetch_array( $result_2 );
Print "<tr>";
Print "<td valign=\"top\">";
Print "</td>";
Print "<td colspan=\"4\" align=\"center\">";
Print "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=
\"95%\">";
Print "<tbody>";
Print "<tr height=\"5\">";
Print "<td colspan=\"2\" valign=\"middle\"><hr width=\"250\" size=\"2\
align=\"center\" NOSHADE></td>";
Print "</tr>";
Print "<tr>";
Print "<td colspan=\"1\" valign=\"middle\"><p class=\"luzcargreettxt
\">".$info_2[ 'pg_greet' ] . "</p><p class=\"luzcargreettxt\">".
$info_2[ 'oferta' ] . "</p></td>";
Print "<td align=\"center\"><img alt=\"\" src=\"images/luzcar_logo.jpg
\" width=\"100\" height=\"84\"></td>";
Print "</tr>";
Print "<tr height=\"5\">";
Print "<td colspan=\"2\" valign=\"middle\"><hr width=\"250\" size=\"2\
align=\"center\" NOSHADE></td>";
Print "</tr>";
while($info = mysql_fetch_array( $result ))
{
Print "<tr>";
Print "<td style=\"background:#e6e6e6\" align=\"center\"><div class=
\"luzcargrouphd\">".$info_2['group_title'] . " ".$info['group'] . "</
div></td>";
Print "<td rowspan=\"2\"><div class=\"textbodyluzcar\"><img src=
\"images/".$info['lz_car_img']."\" hspace=\"2\" vspace=\"2\"></div></
td>";
Print "</tr>";
Print "<tr>";
Print "<td align=\"center\"><div class=\"luzcarmodeltxt\">".
$info['model_en'] . "</div></td>";
Print "</tr>";
Print "<tr>";
Print "<td valign=\"top\" align=\"center\">";
Print "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=
\"100%\">";
Print "<tbody>";
Print "<tr>";
Print "<td style=\"background:#e6e6e6\" colspan=\"2\" align=\"center
\"><div class=\"luzcarpricehd\">".$info_2['price_title'] . " </div></
td>";
Print "<tr>";
Print "<td align=\"center\"><div class=\"textbodyluzcar\">".
$info_2['low_season_price_title'] . " </div></td>";
Print "<td align=\"center\"><div class=\"textbodyluzcar\">".
$info['low_season'] . "</div></td>";
Print "<tr>";
Print "<td style=\"background:#e6e6e6\" align=\"center\"><div class=
\"textbodyluzcar\">".$info_2['mid_season_price_title'] . " </div></
td>";
Print "<td style=\"background:#e6e6e6\" align=\"center\"><div class=
\"textbodyluzcar\">".$info['mid_season'] . "</div></td>";
Print "<tr>";
Print "<td align=\"center\"><div class=\"textbodyluzcar\">".
$info_2['high_season_price_title'] . " </div></td>";
Print "<td align=\"center\"><div class=\"textbodyluzcar\">".
$info['high_season'] . "</div></td>";
Print "</tr>";
Print "</tbody>";
Print "</table>";
Print "</td>";
Print "<td align=\"center\"><a class=\"luzcargrouphd\" href=\"form.php?
opt_form=en\" >Click to book</a></td>";
Print "</tr>";
Print "<tr height=\"20\">";
Print "<td colspan=\"2\" valign=\"middle\"><hr size=\"2\ align=\"center
\" NOSHADE width=\"200\"></td>";
Print "</tr>";

}

Print "</tbody>";
Print "</table>";
Print "</td>";
Print "<td valign=\"top\">";
include("lang_menu_carros.php");
Print "</td>";
Print "</tr>";


break;

case "pt":

$lang="pt";
$data = "SELECT * FROM LUZCAR WHERE fora = 'active' LIMIT 0, 30";
$title = "SELECT * FROM CAR_HIRE_TITLES WHERE lang = '$lang' ";
$result = mysql_query($data);
$result_2 = mysql_query($title);
$info_2 = mysql_fetch_array( $result_2 );
Print "<tr>";
Print "<td valign=\"top\">";
Print "</td>";
Print "<td colspan=\"4\" align=\"center\">";
Print "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=
\"95%\">";
Print "<tbody>";
Print "<tr height=\"5\">";
Print "<td colspan=\"2\" valign=\"middle\"><hr width=\"250\" size=\"2\
align=\"center\" NOSHADE></td>";
Print "</tr>";
Print "<tr>";
Print "<td colspan=\"1\" valign=\"middle\"><p class=\"luzcargreettxt
\">".$info_2[ 'pg_greet' ] . "</p><p class=\"luzcargreettxt\">".
$info_2[ 'oferta' ] . "</p></td>";
Print "<td align=\"center\"><img alt=\"\" src=\"images/luzcar_logo.jpg
\" width=\"100\" height=\"84\"></td>";
Print "</tr>";
Print "<tr height=\"5\">";
Print "<td colspan=\"2\" valign=\"middle\"><hr width=\"250\" size=\"2\
align=\"center\" NOSHADE></td>";
Print "</tr>";
while($info = mysql_fetch_array( $result ))
{
Print "<tr>";
Print "<td style=\"background:#e6e6e6\" align=\"center\"><div class=
\"luzcargrouphd\">".$info_2['group_title'] . " ".$info['group'] . "</
div></td>";
Print "<td rowspan=\"2\"><div class=\"textbodyluzcar\"><img src=
\"images/".$info['lz_car_img']."\" hspace=\"2\" vspace=\"2\"></div></
td>";
Print "</tr>";
Print "<tr>";
Print "<td align=\"center\"><div class=\"luzcarmodeltxt\">".
$info['model_en'] . "</div></td>";
Print "</tr>";
Print "<tr>";
Print "<td valign=\"top\" align=\"center\">";
Print "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=
\"100%\">";
Print "<tbody>";
Print "<tr>";
Print "<td style=\"background:#e6e6e6\" colspan=\"2\" align=\"center
\"><div class=\"luzcarpricehd\">".$info_2['price_title'] . " </div></
td>";
Print "<tr>";
Print "<td align=\"center\"><div class=\"textbodyluzcar\">".
$info_2['low_season_price_title'] . " </div></td>";
Print "<td align=\"center\"><div class=\"textbodyluzcar\">".
$info['low_season'] . "</div></td>";
Print "<tr>";
Print "<td style=\"background:#e6e6e6\" align=\"center\"><div class=
\"textbodyluzcar\">".$info_2['mid_season_price_title'] . " </div></
td>";
Print "<td style=\"background:#e6e6e6\" align=\"center\"><div class=
\"textbodyluzcar\">".$info['mid_season'] . "</div></td>";
Print "<tr>";
Print "<td align=\"center\"><div class=\"textbodyluzcar\">".
$info_2['high_season_price_title'] . " </div></td>";
Print "<td align=\"center\"><div class=\"textbodyluzcar\">".
$info['high_season'] . "</div></td>";
Print "</tr>";
Print "</tbody>";
Print "</table>";
Print "</td>";
Print "<td align=\"center\"><a class=\"luzcargrouphd\" href=\"form.php?
opt_form=en\" >Click to book</a></td>";
Print "</tr>";
Print "<tr height=\"20\">";
Print "<td colspan=\"2\" valign=\"middle\"><hr size=\"2\ align=\"center
\" NOSHADE width=\"200\"></td>";
Print "</tr>";

}

Print "</tbody>";
Print "</table>";
Print "</td>";
Print "<td valign=\"top\">";
include("lang_menu_carros.php");
Print "</td>";


break;

}

?>
"

I have tried with a close database statement as well to no avail.

I have also cleared my cache and tried accessing the page on different
browsers and machine. No result.

I would really appreciate any advice that anyone could give.

Many Thanks

Chris


  Réponse avec citation
Vieux 08/12/2007, 12h42   #2
Jerry Stuckle
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: PHP SELECT Case and Passing Variable problem.

cgkh.webservices wrote:
> Ok! I am going nuts!
>
> I am migrating a client's website from one domain to another with the
> same hosting provider.
>
> On the old site I had a car hire page which offered data in 4
> languages using a very basic php/mysql SELECT CASE syntax.
>
> It can be seen here:
>
> Default English version:
>
> http://www.solpraiaferias.com/fred/index_template.php
>
> Portuguese Version:
>
> http://www.solpraiaferias.com/fred/i....php?option=pt
>
> This works fine!
>
> However, I am now trying to migrate the site to http:// www.paraisolpraia.com
> with the same hosting company.
>
> Default English version:
>
> http://www.paraisolpraia.com/carhire...x_template.php
>
> This works fine.
>
> HOWEVER, and here is the rub:
>
> When submitting the url for the Portuguese Version:
>
> http://www.paraisolpraia.com/carhire....php?option=pt
>
> The server ONLY serves up the Default English text. I have checked the
> MYSQL database tables on both sites and they are both the same.
>
> It appears that the variable '?option=pt' is not being passed on the
> new site. The same happens with the other languages and I know the
> data is in the MYSQL table.
>
> I admit that I am not a very experienced programmer but have had the
> old site working for 18 months without problems.
>
> The relevant PHP code is here:
>
> "
>
> <?php
>


>
> I have tried with a close database statement as well to no avail.
>
> I have also cleared my cache and tried accessing the page on different
> browsers and machine. No result.
>
> I would really appreciate any advice that anyone could give.
>
> Many Thanks
>
> Chris
>
>


What is the statement

$_POST['option'];

supposed to do? Maybe instead you want

$option = $_POST['option'];

What's the difference between the two systems? Different PHP versions?
Different options? Run phpinfo() on both systems and compare the
output.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

  Réponse avec citation
Vieux 09/12/2007, 10h51   #3
cgkh.webservices
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: PHP SELECT Case and Passing Variable problem.

Jerry,

Thanks!

Using phpinfo() (which I had forgotten about), I think I have detected
a difference in configuration in the includes path on the second
server.

I have sent a blast to technical support at the hosting provider.

Will report back once I have new.

Many thanks again.

On Dec 8, 12:42 pm, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> cgkh.webservices wrote:
> > Ok! I am going nuts!

>
> > I am migrating a client's website from one domain to another with the
> > same hosting provider.l s

>
> > On the old site I had a car hire page which offered data in 4
> > languages using a very basic php/mysql SELECT CASE syntax.

>
> > It can be seen here:

>
> > Default English version:

>
> >http://www.solpraiaferias.com/fred/index_template.php

>
> > Portuguese Version:

>
> >http://www.solpraiaferias.com/fred/i....php?option=pt

>
> > This works fine!

>
> > However, I am now trying to migrate the site to http://www.paraisolpraia.com
> > with the same hosting company.

>
> > Default English version:

>
> >http://www.paraisolpraia.com/carhire...x_template.php

>
> > This works fine.

>
> > HOWEVER, and here is the rub:

>
> > When submitting the url for the Portuguese Version:

>
> >http://www.paraisolpraia.com/carhire....php?option=pt

>
> > The server ONLY serves up the Default English text. I have checked the
> > MYSQL database tables on both sites and they are both the same.

>
> > It appears that the variable '?option=pt' is not being passed on the
> > new site. The same happens with the other languages and I know the
> > data is in the MYSQL table.

>
> > I admit that I am not a very experienced programmer but have had the
> > old site working for 18 months without problems.

>
> > The relevant PHP code is here:

>
> > "

>
> > <?php

>
> > I have tried with a close database statement as well to no avail.

>
> > I have also cleared my cache and tried accessing the page on different
> > browsers and machine. No result.

>
> > I would really appreciate any advice that anyone could give.

>
> > Many Thanks

>
> > Chris

>
> What is the statement
>
> $_POST['option'];
>
> supposed to do? Maybe instead you want
>
> $option = $_POST['option'];
>
> What's the difference between the two systems? Different PHP versions?
> Different options? Run phpinfo() on both systems and compare the
> output.
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstuck...@attglobal.net
> ==================




  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 22h44.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,19228 seconds with 11 queries