FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

need help with this code

 


aningbo
I dont have any problem with this code in my offline server (miniportal) but nothing seems to show when i use it here in this server!! It shows nothing but the link "Install" and nothing shows up when I click it.

Can anyone try looking at the code. I tried various techniques like uploading the database and all that but they dont work...any help?


Code:

<?
require("config.php");
?>
<html>
<body>

<?
if(!isset($install)){
   echo"<a href=\"?install=1\">Install</a>";
}
if($install == 1){
$query = "CREATE TABLE $t_posts (
   ID int(7) unsigned DEFAULT '0' NOT NULL auto_increment,
   name varchar(50) NOT NULL,
   mail varchar(50) NOT NULL,
   homepage varchar(50) NOT NULL,
   place varchar(50) NOT NULL,
   icq varchar(50) NOT NULL,
   msn varchar(50) NOT NULL,
   msg mediumtext NOT NULL,
   date int(11) DEFAULT '0' NOT NULL,
   PRIMARY KEY (ID)
)";
mysql_query($query,$db);

$test = mysql_query("SELECT * from $t_posts");
if(!$test){
   echo"<b>There's an error<br>";
}
else{
   echo"Table <i>$table</i> created finally. congrats to myelf</a>";
}
}
?>
</body>
</html>
Philip
where is from $install variable from ?

u need to use isset($_POST["install"]) to take from form post variable
isset($_GET["install"]) to take from url.

if u dont have set any variable then if(!isset($install)) <-- will always have true. and print out install.
Maryndor
if register_globals are not set to true
then yes you should use $_GET["install"]

Code:
if(!isset($_GET["install"])){
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.