Jump to content

Recommended Posts

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;
}

Link to comment
https://forums.phpfreaks.com/topic/36702-get-php-mysql-and-misc-info/
Share on other sites

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.

 

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?

 

 

 

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.