DeathStar Posted February 1, 2007 Share Posted February 1, 2007 Hi i'm making a scritp that will get the php version the mysql version the path the file is from. but i need the text info not an if statement. i also need a mysql install script(that writes something from the script into another php file. here is my current script but i dont want it as an if statement. if (version_compare(phpversion(), '4.2.0') < 0) { $phpver="<font color='red'>Not the Correct Version</font>"; $pvf=0; } else { $phpver="<font color='green'>4.2.0</font>"; $pvf=1; } if(is_writable('./')) { $write="<font color='green'>OK</font>"; $wvf=1; } else { $write="<font color='red'>Failed</font>"; $wvf=0; } if(function_exists('mysql_connect') || function_exists('mysqli_connect')) { $mysql"<font color='green'>Connected</font>"; $dvf=1; } else { $mysql="<font color='red'>Not Connected</font>"; $dvf=0; } if(str_replace('game_install.php','',$_SERVER['SCRIPT_NAME']) == "/") { $path="<font color='green'>Correct</font>"; $avf=1; } else { $path="<font color='red'>Not In root path</font>"; $avf=0; } Quote Link to comment https://forums.phpfreaks.com/topic/36702-get-php-mysql-and-misc-info/ Share on other sites More sharing options...
.josh Posted February 1, 2007 Share Posted February 1, 2007 so...just assign it to a variable. Quote Link to comment https://forums.phpfreaks.com/topic/36702-get-php-mysql-and-misc-info/#findComment-175012 Share on other sites More sharing options...
DeathStar Posted February 1, 2007 Author Share Posted February 1, 2007 Any help in doing that? but i need other parts to. like what's the server ip. like you normally have on the bottom left of a cpanel. Quote Link to comment https://forums.phpfreaks.com/topic/36702-get-php-mysql-and-misc-info/#findComment-175017 Share on other sites More sharing options...
.josh Posted February 1, 2007 Share Posted February 1, 2007 umm...are you saying that you don't know how to assign a value to a variable? No offense, but maybe you should go start on a hello world tutorial. Ever heard of the expression "don't put the cart before the horse?" Quote Link to comment https://forums.phpfreaks.com/topic/36702-get-php-mysql-and-misc-info/#findComment-175021 Share on other sites More sharing options...
DeathStar Posted February 1, 2007 Author Share Posted February 1, 2007 I know how but i dont need just the php,mysql ver , path but also need an script that will write info to a php file.(for mysql) some other ifo to. for and install file im making!! Quote Link to comment https://forums.phpfreaks.com/topic/36702-get-php-mysql-and-misc-info/#findComment-175057 Share on other sites More sharing options...
corbin Posted February 1, 2007 Share Posted February 1, 2007 I've never heard of making an install file from another file... It's just impractical. Also, no one has any idea what exactly you're trying to do... Like make an example file by hand, and maybe someone can help you dynamically recreate it. Quote Link to comment https://forums.phpfreaks.com/topic/36702-get-php-mysql-and-misc-info/#findComment-175062 Share on other sites More sharing options...
elis Posted February 1, 2007 Share Posted February 1, 2007 but also need an script that will write info to a php file. $phpFile = "yourfile.php"; $run = fopen($phpFile, 'w') or die("Can't open the file"); $Data = "YOUR TEXT\n"; fwrite($run, $Data); fclose($run); This is only if I understood what you were trying to do correctly, I may have misinterpretted you. Quote Link to comment https://forums.phpfreaks.com/topic/36702-get-php-mysql-and-misc-info/#findComment-175073 Share on other sites More sharing options...
DeathStar Posted February 2, 2007 Author Share Posted February 2, 2007 Yes thats one part thanks elis! what i want to make exactly is: an install file. Displays the php,mysql and apache version. next i want it to goto a page that will ask for the mysqlhost, username, password and the database. the. install the data if everything is right (php,mysql). then write that info to an file. ex. config.php now understand? Quote Link to comment https://forums.phpfreaks.com/topic/36702-get-php-mysql-and-misc-info/#findComment-175268 Share on other sites More sharing options...
elis Posted February 2, 2007 Share Posted February 2, 2007 At the moment, it seems like your best bet is to use a prewritten install code, and piggyback off that. Try downloading any sample file from hotscripts and editing their installation file to suit your needs. Quote Link to comment https://forums.phpfreaks.com/topic/36702-get-php-mysql-and-misc-info/#findComment-175665 Share on other sites More sharing options...
DeathStar Posted February 2, 2007 Author Share Posted February 2, 2007 yes that prob woukld be the best. thanks anyways! Quote Link to comment https://forums.phpfreaks.com/topic/36702-get-php-mysql-and-misc-info/#findComment-175800 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.