Jump to content

undefined Variable Issue due to moving servers


rachae1

Recommended Posts

Hi I am hoping someone can help.

My hosting company has just moved my website to a different server, and I noticed that it was giving me blank pages, I added in some debug and now I am getting undefined variable errors and I don't know why or how to fix it.

The Page which has broken currently gets its information from the database from the url.
RewriteRule ^reviews/([^/]*)\/$ /bingosite.php?h1=$1 [L]

The code in the broken page that is throwing out undefined variable errors is the following:

<? $query = mysql_query("SELECT * FROM link where linktype='bingo' and h1 ='".StripUrl101(ucwords($h1))."'");  { while($row =mysql_fetch_assoc($query)) extract($row);?>

<? if ($linkType=="bingo") { ?>

<?php echo "$h1"; ?>

<? }  } ?>

I have used this code for years so it could be that it is old but as I only know basic PHP I am very stuck and the hosting company isn't being very helpful.

 

Just to add if I write <? $query = mysql_query("SELECT * FROM link where linktype='bingo' and h1 ='Quick Bingo'");  { while($row =mysql_fetch_assoc($query)) extract($row);?>

The results for Quick Bingo appear on the page. However it needs to work dynamically like it was doing before.

If anyone can help it would be appreciated.

Thanks

Rachael
 

Edited by rachae1
Link to comment
Share on other sites

way back in php4.1 (December 2001), php introduced the superglobals - $_POST, $_GET, $_COOKIE, ... in php4.2 (April of 2002), they turned register_globals off by default, because programmers were expected to start using the superglobal variables to access external data. register_globals being on started throwing deprecated errors in php5.3 (June 2009), and have been completely removed in php5.4 (March 2012.)

 

turning register globals on is at best a stop-gap measure since they have been removed from php versions starting over two years ago. time to update your code to use $_GET['h1'] to access values supplied in the url query string.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.