Jump to content


Photo

Urgent Help needed


  • Please log in to reply
3 replies to this topic

#1 mum4d

mum4d
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 26 April 2006 - 08:48 AM

I have created a site in dreamweaver. I created a page that inserts data into a MySql database and then re-directs to a new page using the wizzard in dreamweaver. this works fine on my local machine but not on my ISP's server. I think i's because my ISP is only on PHP version 4 (i'm on PHP5).
The code created by Dreamweaver is:
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
  $insertSQL = sprintf("INSERT INTO vistion_orders (x) VALUES (%s)",
                       GetSQLValueString($_POST['x'], "int"));

  mysql_select_db($database_vistion, $vistion);
  $Result1 = mysql_query($insertSQL, $vistion) or die(mysql_error());

  $insertGoTo = "userholder.php?page=update.php";
  if (isset($_SERVER['QUERY_STRING'])) {
  $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
    $insertGoTo .= $_SERVER['QUERY_STRING'];
    
  }
  header(sprintf("Location: %s", $insertGoTo));
}

how can I change this to run on PHP4?

This site needs to go live ASAP so I need a quick answer PLEASE!!!!

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 26 April 2006 - 09:30 AM

It doesn't really matter if your your ISP is running PHP4 as you are not using any PHP5 specific functions. What I think is the problem is die to your ISP having register_globals turned on. Which means that any use of superglobal arrays will not work, i e($_POSt, $_GET, $_SERVER variables).

To see whether Register_globals is on run the following scipt:
<?php

// remove the space between the p and the h in the code below:
p hpinfo();

?>
Now run that on your ISPs server and find where it says register_globals if it says On in both coloumns this is the reason why your script isn't working.

#3 mum4d

mum4d
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 26 April 2006 - 09:47 AM

[!--quoteo(post=368771:date=Apr 26 2006, 09:30 AM:name=wildteen88)--][div class=\'quotetop\']QUOTE(wildteen88 @ Apr 26 2006, 09:30 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
It doesn't really matter if your your ISP is running PHP4 as you are not using any PHP5 specific functions. What I think is the problem is die to your ISP having register_globals turned on. Which means that any use of superglobal arrays will not work, i e($_POSt, $_GET, $_SERVER variables).

To see whether Register_globals is on run the following scipt:
<?php

// remove the space between the p and the h in the code below:
p hpinfo();

?>
Now run that on your ISPs server and find where it says register_globals if it says On in both coloumns this is the reason why your script isn't working.
[/quote]
Thanks for a quick reply,
I have PhpMyAdmin installed on their server. form there I clicked the "show PHP Information" link and that states that register_globals are both OFF

any other solutions??

Thanks again!

#4 mum4d

mum4d
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 26 April 2006 - 12:29 PM

Anyone?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users