my config maker v 1.0, in need of help..

phpBB3 and MOD challenges setup by the staff to test and challenge your phpBB3 coding skills.

my config maker v 1.0, in need of help..

Postby silencer0 » 16 Jul 2007, 06:01

here's the entire script to create the config of my script :
Spoiler:
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<?
//file_put_contents("./configuration.php","
//$sitename = '" . $_POST["sitename"] . "';" . "
//$debug_show_if_installed_right = false;
//$installed = true; ");
?>



$debug_show_if_installed_right = false;
$installed = true;
?>
<body>
<form id="allvars" name="allvars" method="post" action="">
  <label>
  IMGU's install script, compatible PHP 4 or higher. <br />
  <br />
  <br />
  Site name :
  <br />
  <input name="sitename" type="text" id="sitename" />
  </label>
  e.g's : My Upload Site
  <br />
Site Url :<br />
<input name="siteurl" type="text" id="siteurl" />
http://www.site.com/imgu/ including slash at the end.
<br />
Admin panel password : <br />
<input name="pass" type="text" id="pass" />
password to access admin panel. be carefull not to lose it.
<br />
Site upload url :<br />
<input name="siteuploadurl" type="text" id="siteuploadurl" />
&nbsp;&nbsp;http://www.site.com/imgu/upload/<br />
Max Size in bytes : <br />
<input name="maxsize" type="text" id="maxsize" />
<br />
Show a tab where a guest can see his ip? : <br />
<input name="iptab" type="text" id="iptab" />
Put true or false <br />
Show ads?<br />
<input name="ads" type="text" id="ads" />
  Put true or false<br />
  If true, what's the ad code?<br />
  <input name="adscode" type="text" id="adscode" />
  Your code for your ads. <br />
  Max file size <br />
  <input name="maxfilesize" type="text" id="maxfilesize" />
   this is what the users will see, so you can put it in MB KB or GB just write what you want. <br />
  Do you have PHP 5 ? <br />
  <input name="hasphp5" type="text" id="hasphp5" />
   Put true or false<br />
   Do you offer support?
  <br />
   <input name="support" type="text" id="support" />
   Put true or false<br />
   If yes, what's your support email ?
  <br />
  <input name="supportemail" type="text" id="supportemail" />
   Your email here. <br />
   Show an announcement ? <br />
   <input name="announcementyn" type="text" id="announcementyn" />
    Put true or false<br />
  If yes, what's the announcement message? <br />
   <input name="announcementmsg" type="text" id="announcementmsg" />
    Announcement message here.<br />
    Enable News Section ?<br />
    <input name="news" type="text" id="news" />
    Put true or false
  -- edit newsconfig.php for editing the news. <br />
    <br />
<label>Write Config.php
<input type="submit" name="Submit" value="Submit" />
</label>
</form>
<?php echo "<textarea name='textarea' cols='120' rows='81'><?
#_  ¯|¯    /|  /|  /¯_   |     | _#
#¯  _|_  /  |/  |  \__|   \._./  ¯#
// © WWW.WORTH2TALK.NET
// CONFIG VARS READ ME :
# some things you only need to change to true or false,
# just do that then.
# NOTE : LEAVE THE $installed ALONE, AND $debug_show_if_installed_right ALONE TOO
#IF YOU WOULD TOUCH IT IT MIGHT MAKE  AN ERROR IN THE SCRIPT.
#for help sof2_clan2_server@ hotmail.com
# Leave the copyright and etc...
#Thanks for downloading and using this script.
// END CONFIG VARS READ ME. \\

//-Start INSTALLATION README-\\
#firstly, modify ./configuration.php & ./admin/configuration.php
#Then, upload everything to your server
#and then, just simply chmod the uploads directory to 999
#enjoy and get uploaders :)
#for help : sof2_clan2_server@ hotmail.com
//-End installation readme-\\

$sitename = '" . $_POST['sitename'] . "';
//Your sitename.

$pass = '" . $_POST['pass'] . "';
//admin panel pass

$siteurl = '" . $_POST['siteurl'] . "';
//Your site url, WITH a slash at the end of the url, if you've put it wrong, the script won't work! and, EXAMPLE : http://www.site.com/imgu/ .

$siteuploadurl = '" . $_POST['siteuploadurl'] . "';
//This is needed to be http://www.yoursite.com/imgu/upload/ NO OTHER folder, modify only 'yoursite' and 'imgu' !!

$maxsize = '" . $_POST['maxsize'] . "';
//Max upload size in (102400bytes=100KB) bytes

$iptab = '" . $_POST['iptab'] . "';
//shows a tab were a guest can see his ip, like whatismyip.com (true/false)

$ads = '" . $_POST['ads'] . "';
//Show ads on your site? (true/false)

$adscode = '" . $_POST['adscode'] . "';
//The code for your ads :-)

$maxfilesize = '" . $_POST['maxfilesize'] . "';
//For showing it properly, like not 1024 bytes or something it will show that the max file size is the above.

$hasphp5 = '" . $_POST['hasphp'] . "';
//Ask your hoster to know if you have php5, if you do write true, if you don't write false!
//all functions don't work for php 5 & 4 so if you don't do this correctly, you might get errors.

///////////////MEMBERSHIP.PHP CONFIG\\\\\\\\\\\\\\\\\\\

$wmarkremoval = true;
//do not touch at this setting!!!

$support = '" . $_POST['support'] . "';
// says free group has support. (true/false)

$supportemail = '" . $_POST['supportemail'] . "';
//puts the email so that the user knows where he can ask support, if $support is false, leave this alone.

$attention = '" . $_POST['announcementyn'] . "';
//show a special announcement on index.php?

$attentionmsg = '" . $_POST['announcementmsg'] . "';
//if there is an announcemnent,which?

$publishnews = '" . $_POST['newssection'] . "';
//adds a whole news section!! - to update the news, edit newsconfig.php

///////////////////////////////////START Leave this part alone\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
$installed = true;
//our installer will modify this. - do not touch this, this will tell you if your site is installed right if the $debug_show_if_installed_right is on true!!! So do not touch this!

$debug_show_if_installed_right = false;
//will say { successfully installed / Not installed right! } if is set on true Put false whenever you get the successfully installed message, it wouldn't be needed! If you get the wrong message, try reinstalling IMGU then if you get the good message put false.

///////////////////////////////////END Leave this part alone\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
?></textarea>"


?>
</body>
</html>


if you can test it in localhost or something it would be kool, but the actual problem is that the textarea at the end with the config file you need to copy, show
Code: Select all
= 'postedthing';
= 'postedthing2';

and it removes the vars.. any idea how to do that it doesn't remove the vars ?

Thanks.
Proud to be working on : - Extended Warning Mod Grin
silencer0
Ensign
Ensign
 
Posts: 84
Joined: 10 Feb 2007, 05:08
Gender: Male




phpBB Academy at StarTrekGuide
Support STG
Using PayPal Donate

Re: my config maker v 1.0, in need of help..

Postby Tuk » 16 Jul 2007, 06:24

You need to escape the $ signs. As it is right now, php replaces the variables with their actual value.
To prevent this, use
Code: Select all
\$sitename

instead of
Code: Select all
$sitename

This leading \ tells php to treat the following character without its "special meaning" (starting a variable identifier in this case).
"If sharks die, the sea dies" - Andy Cobb, ambassador SHARKPROJECT South Africa
User avatar
Tuk
Supporter
Supporter
 
Posts: 271
Joined: 17 Jul 2006, 11:46
Gender: Male

Re: my config maker v 1.0, in need of help..

Postby patrikStar » 16 Jul 2007, 06:26

Spoiler:
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>IMGU's install script</title>
</head>
<body>
<form id="allvars" name="allvars" method="post" action="">
  <label>
  IMGU's install script, compatible PHP 4 or higher. <br />
  <br />
  <br />
  Site name :
  <br />
  <input name="sitename" type="text" id="sitename" />
  </label>
  e.g's : My Upload Site
  <br />
Site Url :<br />
<input name="siteurl" type="text" id="siteurl" />
http://www.site.com/imgu/ including slash at the end.
<br />
Admin panel password : <br />
<input name="pass" type="text" id="pass" />
password to access admin panel. be carefull not to lose it.
<br />
Site upload url :<br />
<input name="siteuploadurl" type="text" id="siteuploadurl" />
&nbsp;&nbsp;http://www.site.com/imgu/upload/<br />
Max Size in bytes : <br />
<input name="maxsize" type="text" id="maxsize" />
<br />
Show a tab where a guest can see his ip? : <br />
<input name="iptab" type="text" id="iptab" />
Put true or false <br />
Show ads?<br />
<input name="ads" type="text" id="ads" />
  Put true or false<br />
  If true, what's the ad code?<br />
  <input name="adscode" type="text" id="adscode" />
  Your code for your ads. <br />
  Max file size <br />
  <input name="maxfilesize" type="text" id="maxfilesize" />
   this is what the users will see, so you can put it in MB KB or GB just write what you want. <br />
  Do you have PHP 5 ? <br />
  <input name="hasphp5" type="text" id="hasphp5" />
   Put true or false<br />
   Do you offer support?
  <br />
   <input name="support" type="text" id="support" />
   Put true or false<br />
   If yes, what's your support email ?
  <br />
  <input name="supportemail" type="text" id="supportemail" />
   Your email here. <br />
   Show an announcement ? <br />
   <input name="announcementyn" type="text" id="announcementyn" />
    Put true or false<br />
  If yes, what's the announcement message? <br />
   <input name="announcementmsg" type="text" id="announcementmsg" />
    Announcement message here.<br />
    Enable News Section ?<br />
    <input name="news" type="text" id="news" />
    Put true or false
  -- edit newsconfig.php for editing the news. <br />
    <br />
<label>Write Config.php
<input type="submit" name="Submit" value="Submit" />
</label>
</form>
<?php echo "<textarea name='textarea' cols='120' rows='81'><?
#_  ¯|¯    /|  /|  /¯_   |     | _#
#¯  _|_  /  |/  |  \__|   \._./  ¯#
// © WWW.WORTH2TALK.NET
// CONFIG VARS READ ME :
# some things you only need to change to true or false,
# just do that then.
# NOTE : LEAVE THE $installed ALONE, AND $debug_show_if_installed_right ALONE TOO
#IF YOU WOULD TOUCH IT IT MIGHT MAKE  AN ERROR IN THE SCRIPT.
#for help sof2_clan2_server@ hotmail.com
# Leave the copyright and etc...
#Thanks for downloading and using this script.
// END CONFIG VARS READ ME. \\

//-Start INSTALLATION README-\\
#firstly, modify ./configuration.php & ./admin/configuration.php
#Then, upload everything to your server
#and then, just simply chmod the uploads directory to 999
#enjoy and get uploaders :)
#for help : sof2_clan2_server@ hotmail.com
//-End installation readme-\\

" . '$sitename' . " = '" . $_POST['sitename'] . "';
//Your sitename.

" . '$pass' . " = '" . $_POST['pass'] . "';
//admin panel pass

" . '$siteurl' . " = '" . $_POST['siteurl'] . "';
//Your site url, WITH a slash at the end of the url, if you've put it wrong, the script won't work! and, EXAMPLE : http://www.site.com/imgu/ .

" . '$siteuploadurl' . " = '" . $_POST['siteuploadurl'] . "';
//This is needed to be http://www.yoursite.com/imgu/upload/ NO OTHER folder, modify only 'yoursite' and 'imgu' !!

" . '$maxsize' . " = '" . $_POST['maxsize'] . "';
//Max upload size in (102400bytes=100KB) bytes

" . '$iptab' . " = '" . $_POST['iptab'] . "';
//shows a tab were a guest can see his ip, like whatismyip.com (true/false)

" . '$ads' . " = '" . $_POST['ads'] . "';
//Show ads on your site? (true/false)

" . '$adscode' . " = '" . $_POST['adscode'] . "';
//The code for your ads :-)

" . '$maxfilesize' . " = '" . $_POST['maxfilesize'] . "';
//For showing it properly, like not 1024 bytes or something it will show that the max file size is the above.

" . '$hasphp5' . " = '" . $_POST['hasphp'] . "';
//Ask your hoster to know if you have php5, if you do write true, if you don't write false!
//all functions don't work for php 5 & 4 so if you don't do this correctly, you might get errors.

///////////////MEMBERSHIP.PHP CONFIG\\\\\\\\\\\\\\\\\\\

" . '$wmarkremoval' . " = true;
//do not touch at this setting!!!

" . '$support' . " = '" . $_POST['support'] . "';
// says free group has support. (true/false)

" . '$supportemail' . " = '" . $_POST['supportemail'] . "';
//puts the email so that the user knows where he can ask support, if $support is false, leave this alone.

" . '$attention' . " = '" . $_POST['announcementyn'] . "';
//show a special announcement on index.php?

" . '$attentionmsg' . " = '" . $_POST['announcementmsg'] . "';
//if there is an announcemnent,which?

" . '$publishnews' . " = '" . $_POST['newssection'] . "';
//adds a whole news section!! - to update the news, edit newsconfig.php

///////////////////////////////////START Leave this part alone\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
" . '$installed' . " = true;
//our installer will modify this. - do not touch this, this will tell you if your site is installed right if the " .
'$debug_show_if_installed_right' . " is on true!!! So do not touch this!

" . '$debug_show_if_installed_right' . " = false;
//will say { successfully installed / Not installed right! } if is set on true Put false whenever you get the successfully installed message, it wouldn't be needed! If you get the wrong message, try reinstalling IMGU then if you get the good message put false.

///////////////////////////////////END Leave this part alone\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
?></textarea>"


?>
</body>
</html>


There


*edit*

or you could do the escape thing i forgot about that
patrikStar
Borg Drone
Borg Drone
 
Posts: 73
Joined: 16 May 2007, 20:47
Location: Las Vegas
Gender: Male
phpBB Knowledge: 7

Re: my config maker v 1.0, in need of help..

Postby silencer0 » 16 Jul 2007, 07:15

kool thanks guys :)
oh and one more question :)
at some vars i need to put $var = true; without quotes... like @ this one

Code: Select all
" . '$publishnews' . " = '" . $_POST['newssection'] . "';

how do i do it?

Thanks!
Proud to be working on : - Extended Warning Mod Grin
silencer0
Ensign
Ensign
 
Posts: 84
Joined: 10 Feb 2007, 05:08
Gender: Male


Return to phpBB3 Challenges at phpBB Academy

Who is online

Users browsing this forum: No registered users and 2 guests