FRIHOSTFORUMSSEARCHFAQTOSBLOGSCOMPETITIONS
You are invited to Log in or Register a free 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"])){
Related topics
Can l get a css document to
Help needed with Javascript and overflow
Javascript function not working!!??
Need Expert help in php-mysql
JavaScript Countdown Timer Help!
HTML submit textbox functions etc.
logging problems
Error i can't figure out, php
Cron Jobs
Making Games... (Looking for help)
renaming uploaded image file?
[Linux] Alguien me podría ayudar con MPlayer
fix some naming issues in this Java thing
help with unobtrusive ajax
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

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