|
|
|
|
![]() ![]() |
May 8 2008, 04:00 PM
Post
#1
|
|
|
Member [Level 2] ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 88 Joined: 21-April 08 From: Errm...this maps dodgey...i think im in the desert... Member No.: 61,127 |
CODE <?php require("config.php"); $link=mysql_connect("$sql_localhost","$sql_user","$sql_pass") or die("Couldn't connect to sql server"); if($step==0){ echo "This will perform a clean install of wisePoll, it will delete any previous versions you may have on your server.<br><a href=\"install.php?step=1\">Continue -></a>"; } if($step==1){ if(!isset($action)){ if(mysql_select_db("$db_name")){ ?> This is the code for part of the installation for a poll thing, when installing i hit continue and the url goes from: http://www.xxx/install.php to: http://www.xxx/install.php?setp=1 but the page stays the same!!! Can anyone help? This post has been edited by chappill: May 8 2008, 04:33 PM |
|
|
|
May 8 2008, 04:28 PM
Post
#2
|
|
|
A computer once beat me at chess, but it was no match for me at kick boxing. ![]() Group: [MODERATOR] Posts: 3,882 Joined: 24-July 05 From: In Trouble Again... still? Member No.: 9,787 ![]() |
I don't see anything wrong with the code you provide, but there is a bunch of code missing, too...
Can you post more code? |
|
|
|
May 8 2008, 04:34 PM
Post
#3
|
|
|
Member [Level 2] ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 88 Joined: 21-April 08 From: Errm...this maps dodgey...i think im in the desert... Member No.: 61,127 |
Done thats everything up to mysql, if you think you could help i would give you the links.
|
|
|
|
May 8 2008, 04:53 PM
Post
#4
|
|
|
A computer once beat me at chess, but it was no match for me at kick boxing. ![]() Group: [MODERATOR] Posts: 3,882 Joined: 24-July 05 From: In Trouble Again... still? Member No.: 9,787 ![]() |
Don't need a link yet, we need the code first to see what it is supposed to be doing.
And what is in the config file? just Db connection info? |
|
|
|
May 8 2008, 05:03 PM
Post
#5
|
|
|
Member [Level 2] ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 88 Joined: 21-April 08 From: Errm...this maps dodgey...i think im in the desert... Member No.: 61,127 |
CODE <?php //CONFIGURE THESE VARIABLES //MYSQL VARIABLES $sql_localhost="localhost";//THIS IS THE LOCALHOST NAME OF THE MYSQL SERVER $sql_user="xxxx";//THIS IS THE USERNAME FOR THE MYSQL SERVER ACCOUNT $sql_pass="xxxx";//THIS IS THE PASSWORD FOR THE MYSQL SERVER ACCOUNT $db_name="xxxx";//THIS IS THE NAME OF THE DATABASE YOU WANT TO USE OR CREATE /////////// //COOKIE VARIABLES $cookie_time=xxxx;//THIS IS THE LENGTH OF TIME THAT THE VOTE COOKIES LAST IN SECONDS ////////// ?> Yeah thats the config fiel do you want ALL of the code from install.php? |
|
|
|
May 8 2008, 05:13 PM
Post
#6
|
|
|
A computer once beat me at chess, but it was no match for me at kick boxing. ![]() Group: [MODERATOR] Posts: 3,882 Joined: 24-July 05 From: In Trouble Again... still? Member No.: 9,787 ![]() |
yes.
place it inside codebox tags. |
|
|
|
May 8 2008, 07:00 PM
Post
#7
|
|
|
Member [Level 2] ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 88 Joined: 21-April 08 From: Errm...this maps dodgey...i think im in the desert... Member No.: 61,127 |
This is the reason i didn't really want to... It's 500 lines+ long CODE <?php if(!isset($step)){ $step=0; } if($step==1){ if(isset($already_voted)){ setcookie("already_voted","no",time()-3600) or die("Couldnt clear cookies"); } ?> <html> <head> <?php echo "<font face=\"arial,sans-serif\" size=\"2\">Cleared Cookies</font><br>\n"; } ?> <title>wisePoll installation</title> <script language="javascript" type="text/javascript"> <!-- if(window!=top){ top.location=window.location; } //--> </script> <style type="text/css"> FORM { FONT-FAMILY: Verdana,Arial,Helvetica,sans-serif; FONT-SIZE: 10px; } SELECT, INPUT, TEXTAREA { FONT-FAMILY: Verdana,Arial,Helvetica,sans-serif; COLOR: #51485F; FONT-SIZE: 10px; } #submitrow INPUT { BACKGROUND-COLOR:#d0d0d0; COLOR: #000000; } </style> </head> <body bgcolor="#e0e0e0" link="blue" vlink="blue" alink="blue"> <font face="arial,sans-serif" size="2"> <?php require("config.php"); $link=mysql_connect("$sql_localhost","$sql_user","$sql_pass") or die("Couldn't connect to sql server"); if($step==0){ echo "This will perform a clean install of wisePoll, it will delete any previous versions you may have on your server.<br><a href=\"install.php?step=1\">Continue -></a>"; } if($step==1){ if(!isset($action)){ if(mysql_select_db("$db_name")){ ?> The database already exists, do you want to use it, or delete it?<br> <a href="install.php?step=1&action=use_old">Use It</a><br> <a href="install.php?step=1&action=delete_old">Delete It</a><br> <?php die(); } else{ $action="create_new"; } } if($action=="delete_old"){ mysql_drop_db("$db_name") or die("Couldn't drop database"); echo "Drop Database<br>"; mysql_create_db("$db_name") or die("Couldn't create database"); echo "Created Database<br>"; mysql_select_db("$db_name") or die("Couldn't select database"); echo "Selected Database<br>"; } if($action=="create_new"){ mysql_create_db("$db_name") or die("Couldn't create database"); echo "Created Database<br>"; mysql_select_db("$db_name") or die("Couldn't select database"); echo "Selected Database<br>"; } if($action=="use_old"){ mysql_select_db("$db_name") or die("Couldn't select database"); echo "Selected Database<br>"; } mysql_query("CREATE TABLE wisePoll_admins(User text, Pass text, Mail text, Priv text, Enabled text)") or die("Couldnt create admins table"); echo "Created admins table.<br>\n"; mysql_query("CREATE TABLE wisePoll_privs(GroupID INT NOT NULL primary key auto_increment, GroupName text, AddAdmin text, EditAdmin text, DisableAdmin text, DeleteAdmin text, AddGroup text, EditGroup text, DeleteGroup text, AddTemplate text, EditTemplate text, DisableTemplate text, DeleteTemplate text, AddPoll text, EditPoll text, DisablePoll text, DeletePoll text, OtherOps text)") or die("Couldnt create priviledges table"); echo "Created priviledges table.<br>\n"; mysql_query("INSERT INTO wisePoll_privs VALUES('','orig','yes','yes','yes','yes','yes','yes','yes','yes','yes','yes','yes','yes','yes','yes','yes','yes')") or die("Couldnt create original administrator priviledges"); echo "Created original administrator priviledges.<br>\n"; mysql_query("INSERT INTO wisePoll_privs VALUES('','full','yes','yes','yes','yes','yes','yes','yes','yes','yes','yes','yes','yes','yes','yes','yes','yes')") or die("Couldnt create full administrator priviledges"); echo "Created full administrator priviledges.<br>\n"; mysql_query("INSERT INTO wisePoll_privs VALUES('','mod','no','no','no','no','no','no','no','no','no','no','no','yes','yes','yes','yes','no')") or die("Couldnt create moderated administrator priviledges"); echo "Created moderated administrator priviledges.<br>\n"; mysql_query("CREATE TABLE wisePoll_layout(ID INT NOT NULL primary key auto_increment, Template text, HeadInput text, Header text, Footer text, PageTitle text, SiteURL text, PollURL text, TblBorderSize int, TblBorderCol text, LayoutType text, PageBGCol text, PageTxtCol text, PageTxtFont text, PageTxtSize int, PageLnkCol text, PageLnkBGCol text, PagevLinkCol text, PageaLinkCol text, PageoLinkCol text, PageoLinkBGCol text, PageLnkFont text, PageLnkSize int, PageoLinkFont text, MnTblBGCol text, MnTblTxtCol text, MnTblTxtFont text, MnTblTxtSize int, MnTblLnkCol text, MnTblLnkBGCol text, MnTblvLinkCol text, MnTblaLinkCol text, MnTbloLinkCol text, MnTbloLinkBGCol text, MnTblLnkFont text, MnTblLnkSize int, MnTbloLinkFont text, HrowBGCol text, HrowTxtCol text, HrowTxtFont text, HrowTxtSize int, HrowLnkCol text, HrowLnkBGCol text, HrowvLinkCol text, HrowaLinkCol text, HrowoLinkCol text, HrowoLinkBGCol text, HrowLnkFont text, HrowLnkSize int, HrowoLinkFont text, ErowBGCol text, ErowTxtCol text, ErowTxtFont text, ErowTxtSize int, ErowLnkCol text, ErowLnkBGCol text, ErowvLinkCol text, ErowaLinkCol text, ErowoLinkCol text, ErowoLinkBGCol text, ErowLnkFont text, ErowLnkSize int, ErowoLinkFont text, OrowBGCol text, OrowTxtCol text, OrowTxtFont text, OrowTxtSize int, OrowLnkCol text, OrowLnkBGCol text, OrowvLinkCol text, OrowaLinkCol text, OrowoLinkCol text, OrowoLinkBGCol text, OrowLnkFont text, OrowLnkSize int, OrowoLinkFont text, enabled text)") or die("Couldnt create layout table".mysql_error()); echo "Created layout table.<br>\n"; mysql_query("CREATE TABLE wisePoll_options(PollActive text, InactiveMessage text, UserTemplates text, Frames text, ContactMail text)") or die("Couldnt create options table"); echo "Created options table.<br>\n"; mysql_query("CREATE TABLE wisePoll_polls(PollID INT NOT NULL primary key auto_increment,PollTitle text,Question text,Options text,Answers text,Enabled text)") or die("Couldnt create polls table"); echo "Created polls table.<br>\n"; ?> You're All good there spanky spank!!<br> <br><br> <a href="install.php?step=2">Click here</a> to create a user, you MUST do this to access the admin shell. <br><br> <?php } if($step==2){ ?> <form action="install.php" method="post"> <input type="hidden" value="3" name="step"> <table cellpadding="0" cellspacing="0" border="0" bgcolor="#000000" align="center"><tr><td> <table cellpadding="4" cellspacing="1" border="0" width="100%"> <tr align="center"> <td bgcolor="#000000" align="center" width="100%" colspan="2"><font face="verdana,arial,helvetica" size="1" color="#ffffff"><b>Create An Admin</b></font></td> </tr> <tr> <td bgcolor="#d0d0d0" align="left" nowrap> <font face="verdana,arial,helvetica" size="2"> <strong>Username:</strong> </font> <br> <font face="verdana,arial,helvetica" size="1"> Type your desired login name. </font> </td> <td bgcolor="#dfdfdf" align="center" valign="top"> <input type="text" size="30" name="user"> </td> </tr> <tr> <td bgcolor="#d0d0d0" align="left" nowrap> <font face="verdana,arial,helvetica" size="2"> <strong>Password:</strong> </font> <br> <font face="verdana,arial,helvetica" size="1"> Type your desired login password. </font> </td> <td bgcolor="#dfdfdf" align="center" valign="top"> <input type="password" size="30" name="pass"> </td> </tr> <tr> <td bgcolor="#d0d0d0" align="left" nowrap> <font face="verdana,arial,helvetica" size="2"> <strong>Confirm Password:</strong> </font> <br> <font face="verdana,arial,helvetica" size="1"> Type your desired login password again. </font> </td> <td bgcolor="#dfdfdf" align="center" valign="top"> <input type="password" size="30" name="pass2"> </td> </tr> <tr> <td bgcolor="#d0d0d0" align="left" nowrap> <font face="verdana,arial,helvetica" size="2"> <strong>Email Address:</strong> </font> <br> <font face="verdana,arial,helvetica" size="1"> This is the email address you want associated with your account. </font> </td> <td bgcolor="#dfdfdf" align="center" valign="top"> <input type="text" size="30" name="mail"> </td> </tr> <tr align="center"> <td bgcolor="#000000" align="center" width="100%" colspan="2"><font face="verdana,arial,helvetica" size="1" color="#ffffff"><b>Enter Your Site Information</b></font></td> </tr> <tr> <td bgcolor="#d0d0d0" align="left" nowrap> <font face="verdana,arial,helvetica" size="2"> <strong>Site Title:</strong> </font> <br> <font face="verdana,arial,helvetica" size="1"> This is the title or name of your site. </font> </td> <td bgcolor="#dfdfdf" align="center" valign="top"> <input type="text" size="30" name="sitename"> </td> </tr> <tr> <td bgcolor="#d0d0d0" align="left" nowrap> <font face="verdana,arial,helvetica" size="2"> <strong>Site URL:</strong> </font> <br> <font face="verdana,arial,helvetica" size="1"> This is the url to your site (e.g. http://www.mysite.com). </font> </td> <td bgcolor="#dfdfdf" align="center" valign="top"> <input type="text" size="30" name="siteurl"> </td> </tr> <tr> <td bgcolor="#d0d0d0" align="left" nowrap> <font face="verdana,arial,helvetica" size="2"> <strong>Polls URL:</strong> </font> <br> <font face="verdana,arial,helvetica" size="1"> This is the url to your polls (e.g. http://www.mysite.com/wisePoll/index.php). </font> </td> <td bgcolor="#dfdfdf" align="center" valign="top"> <input type="text" size="30" name="pollurl"> </td> </tr> <tr id="submitrow"> <td bgcolor="#000000" align="center" colspan="2"> <input type="submit" value="Finish Installation"> </td> </tr> </table> </td> </tr> </table> </form> <?php } if($step==3){ //CHECK SUBMITTED INFORMATION if((!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*$",$mail)) || (!isset($pass)) || (!isset($pass2)) || (empty($pass)) || (empty($pass2)) || ($pass!=$pass2) || (!isset($user)) || (empty($user)) || (!isset($sitename)) || (empty($sitename)) || (!eregi("^http://+[_a-z0-9-]*",$siteurl)) || (!eregi("^http://+[_a-z0-9-]*",$pollurl))){ ?> <strong>You must fill out all of the information correctly. The problems were as follows:</strong> <ul type="disc"> <?php if((!isset($user)) || (empty($user)) || (!isset($sitename)) || (empty($sitename))){ echo "<li><strong>Some of the information wasn't filled out.</strong></li>"; } if(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*$",$mail)){ echo "<li><strong>The email address is not a valid email address.</strong></li>"; } if(!isset($pass) || !isset($pass2) || empty($pass) || empty($pass2) || ($pass!=$pass2)){ echo "<li><strong>The password, and confirm password fields were not the same.</strong></li>"; } if(!eregi("^http://+[_a-z0-9-]*",$siteurl) || !eregi("^http://+[_a-z0-9-]*",$pollurl)){ echo "<li><strong>The site URL and/or poll URL were not valid URL's. You must use the full address.</strong></li>"; } ?> </ul> <strong>Please fix these, and try again. You will be redirected in 5 seconds.</strong><br> If you do not want to wait, or your browser does not support Javascript, <a href="install.php?step=2">click here</a> to go back now. <script language="javascript" type="text/javascript"> <!-- function goBack(){ location="install.php?step=2"; } setTimeout('goBack()',5000); //--> </script> <?php die(); } $head_input='FORM { FONT-FAMILY: Verdana,Arial,Helvetica,sans-serif; FONT-SIZE: 10px; } SELECT, INPUT, TEXTAREA { FONT-FAMILY: Verdana,Arial,Helvetica,sans-serif; COLOR: #51485F; FONT-SIZE: 10px; } #submitrow INPUT { BACKGROUND-COLOR:#d0d0d0; COLOR: #000000; }'; $header='<center> <table border="0" cellpadding="0" cellspacing="0" width="98%" align="center"> <tr> <td height="100" background="top_line.gif" rowspan="2" cellpadding="0" align="left"> <a href="<?php echo $pollurl ?>" onfocus="this.blur()"> <img src="wisepoll_logo.gif" alt="wisePoll" vspace="0" hspace="0" border="0" width="250" height="99" onfocus="this.blur()"> </a> </td> <td bgcolor="<?php echo $page_bgcol ?>" height="48" align="right" valign="bottom"> <a href="search.php" onfocus="this.blur()"><img src="top_search.gif" border="0" hspace="0" vspace="0" alt="Search"></a> <a href="<?php echo $siteurl ?>" onfocus="this.blur()"><img src="top_home.gif" border="0" hspace="0" vspace="0" alt="Home"></a> </td> </tr> <tr> <td bgcolor="#ffffff" valign="top" align="right"> </td> </tr> </table>'; $footer='<table border="0" cellpadding="0" cellspacing="0" width="98%"> <tr> <td bgcolor="<?php echo $page_bgcol ?>" align="center"> <br><br> <font face="<?php echo $page_linkfont ?>" size="<?php echo $page_linksize ?>" color="<?php echo $page_linkcol ?>"> <big><</big> <strong> <a href="mailto:<?php echo $contact_mail ?>" class="page">Contact Us</a> - <a href="<?php echo $siteurl ?>" class="page"><?php echo $sitename ?></a><big>></big> </font> </td> </tr> </table>'; mysql_select_db("$db_name") or die("Couldn't select database.".mysql_error()); echo "Selected Database<br>"; mysql_query("INSERT INTO wisePoll_admins VALUES('$user','$pass','$mail','1','yes')") or die("Couldn't create administrator".mysql_error()); echo "Created Administrator<br>"; mysql_query("INSERT INTO wisePoll_layout VALUES('','Default','$head_input','$header','$footer','$sitename','$siteurl','$pollurl','1','#000000','rows','#336699','#000000','arial,sans-serif','2','#000000','#336699','#000000','#000000','#ff0000','#336699','arial,sans-serif','2','arial,sans-serif','#ffffff','#000000','arial,sans-serif','2','#000000','#ffffff','#000000','#000000','#ff0000','#ffffff','arial,sans-serif','2','arial,sans-serif','#000000','#ffffff','verdana,arial,helvetica','1','#ffffff','#000000','#ffffff','#ffffff','#ffffff','#000000','verdana,arial,helvetica','1','verdana,arial,helvetica','#dfdfdf','#000000','verdana,arial,helvetica','1','#000000','#dfdfdf','#000000','#000000','#ff0000','#dfdfdf','verdana,arial,helvetica','2','verdana,arial,helvetica','#d0d0d0','#000000','verdana,arial,helvetica','1','#000000','#d0d0d0','#000000','#000000','#ff0000','#d0d0d0','verdana,arial,helvetica','2','verdana,arial,helvetica','yes')") or die("Couldn't create default template.".mysql_error()); echo "Created default Layout<br>"; $inactive_msg="<strong>The polls are currently undergoing renovations.</strong>"; mysql_query("INSERT INTO wisePoll_options VALUES('yes','$inactive_msg','yes','yes','$mail')") or die("Couldnt create defa |