Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   General Discussions (http://forums.winamp.com/forumdisplay.php?f=1)
-   -   PHP Help, again (http://forums.winamp.com/showthread.php?t=178085)

ryan 26th April 2004 22:44

PHP Help, again
 
http://www.vague.us/install.phps

Any idea why..
PHP Code:

echo '$mysql_user=' $mysql_user;
echo 
'<br />$mysql_pass=' $mysql_pass;
echo 
'<br />$mysql_db=' $mysql_db

Isn't echoing the variables, like it does earlier in the script?

xzxzzx 27th April 2004 00:08

Yes. You have to re-POST the variables to be maintained once the "yes" has been entered. Here's the corrected script:
PHP Code:

<?php session_start(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
   <title>Tiffany Install.</title>
</head>
<body>
<?php 
$mysql_user 
$_POST['mysqlname'];
$mysql_pass $_POST['mysqlpass'];
$mysql_db $_POST['mysqldb'];
$prefix $_POST['prefix'];
$adm_user $_POST['admuser'];
$adm_pass $_POST['admpass'];
$adm_mail $_POST['admmail'];
$main_form "
             <form action=\"install.php\" method=\"POST\">
             MySQL Username: 
             <input type=\"text\" name=\"mysqlname\" /> <br />
             MySQL Password: 
             <input type=\"password\" name=\"mysqlpass\" /> <br />
             DB Name (if DB exists, it will be emptied): 
             <input type=\"text\" name=\"mysqldb\" /> <br />
             Table Prefix (default: tiff_):
             <input type=\"text\" name=\"prefix\" /> <br />
             Admin Username:
             <input type=\"text\" name=\"admuser\" /> <br />
             Admin Password:
             <input type=\"password\" name=\"admpass\" /> <br />
             Admin Email:
               <input type=\"text\" name=\"admmail\" /> <br />  
             <input type=\"submit\" name=\"submit\" value=\"Submit\" />
             </form>
              "
;
$main_form2 "
              <form action=\"install.php\" method=\"POST\">
              <input type=\"hidden\" name=\"mysqlname\" value=\"
$mysql_user\" />
              <input type=\"hidden\" name=\"mysqlpass\" value=\"
$mysql_pass\" />
              <input type=\"hidden\" name=\"mysqldb\" value=\"
$mysql_db\" />
              <input type=\"hidden\" name=\"prefix\" value=\"
$prefix\" />
              <input type=\"hidden\" name=\"admuser\" value=\"
$adm_user\" />
              <input type=\"hidden\" name=\"admpass\" value=\"
$adm_pass\" />
              <input type=\"hidden\" name=\"admmail\" value=\"
$adm_mail\" />
              Is this information correct?
              <input type=\"text\" name=\"correct\" /><br />
              <input type=\"submit\" name=\"corr\" value=\"submit\" />
              </form>
              "
;
if(isset(
$_POST['submit']))
{
    if(
$prefix == "" ) { 
        
$prefix "tiff_"
    }
    echo 
"MySQL user: " $mysql_user "<br />";
    echo 
"MySQL pass: " $mysql_pass "<br />";
    echo 
"MySQL db: " $mysql_db "<br />";
    echo 
"Table prefix: " $prefix "<br />" ;
    echo 
"Admin username: " $adm_user "<br />";
    echo 
"Admin password: " $adm_pass "<br />";
    echo 
"Admin email: " $adm_mail;
    echo 
$main_form2;
}
elseif(isset(
$_POST['corr'])){
    if(
strtolower($_POST['correct']) == "yes"){   
        echo 
"Put the following code into a file called \"config.php\" in the same directory that you installed Tiffany.<br />";
        echo 
htmlentities('<'); echo '<i></i>?php<br />';
        echo 
'$mysql_user=' $mysql_user;
        echo 
'<br />$mysql_pass=' $mysql_pass;
        echo 
'<br />$mysql_db=' $mysql_db;
        echo 
'<br />?'; echo htmlentities('>');
        
//mysql shit will go here 
    
} else {
        echo 
$main_form
    }
} else {
    echo 
$main_form;
}
?>
</body>
</html>


ryan 27th April 2004 00:11

Thankyou :)

xzxzzx 27th April 2004 00:13

STUPIDFRAMESNOTBREAKINGWHENTHEYSHOULDBREAK!
[edit]You're welcome. :D[/edit]

xzxzzx 27th April 2004 17:11

Oh, by the way, I didn't change anything after
PHP Code:

if(isset($_POST['submit'])) 

, it's just that I had a tough time reading and understanding it with the spacing that was there.


All times are GMT. The time now is 10:31.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.