Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP script to deploy another PHP script
    primarykey
    data
    text
    <p>I have a familiar system that I make for alot of people. It takes up alot of my time to manually copy the template-script I made, edit it as needed. Import the mysql databases, etc. So I was thinking to myself a few nights ago, " What if I could make a form to be filled out, where when given the correct mysql info, and correct variables such as links and style, it would go in and perform the following tasks: 1. Create a specific table in the specified mySQL database 2. Actually Create a Script that resembled the following template-code:</p> <pre><code> &lt;?php // Creator: Will Renfroe // All rights Reserved //Vote Sites and MySQL $DBNAME="DATABASENAME"; $DBUSER="DATABASENAME"; $DBPASSWORD="PASS"; $DBHOST="DATABASE HOST NAME"; /////////////////// // SCRIPT /////////////////// mysql_connect($DBHOST, $DBUSER, $DBPASSWORD) or die("&lt;center&gt;Cannot connect to MySQL&lt;/center&gt;"); mysql_select_db($DBNAME) or die("&lt;center&gt;Cannot select DB&lt;/center&gt;"); ///////// ?&gt; &lt;?php include("secure.php"); if (getenv(HTTP_X_FORWARDED_FOR)) { $pipaddress = getenv(HTTP_X_FORWARDED_FOR); $ipaddress = getenv(REMOTE_ADDR); } else { $ipaddress = getenv(REMOTE_ADDR); } if(isset($_POST['dovote'])){ check_inject(); //Get user id from session $userid=secure($_POST["nick"]); $time=time(); $query=mysql_query("SELECT nick,time FROM votesdb WHERE ip='$ipaddress'"); $checkip=mysql_num_rows($query); $iprow=mysql_fetch_row($query); $query=mysql_query("SELECT time FROM votesdb WHERE nick='$userid'"); $checkuser=mysql_num_rows($query); $userrow=mysql_fetch_row($query); if ($checkuser){ //if user vote if ($checkip and $time&gt;$iprow[1]){$canvote=1;} if (!$checkip and $time&gt;$userrow[0]){$canvote=1;} }else{ //if user never vote if ($checkip and $time&gt;$iprow[1]){$canvote=1;} if (!$checkip){$canvote=1;} } //Do Vote if ($canvote){ $newtime=time()+60*60*24; if ($checkuser){ //update mysql_query("UPDATE votesdb SET time=$newtime, ip='$ipaddress', votes=votes+1, flag=flag+1 WHERE nick='$userid'"); }else{ //insert $query=mysql_query("INSERT INTO votesdb(nick,time,ip,votes,flag) VALUES ('$userid',$newtime,'$ipaddress',1,1)"); } //Add nick to nicklist table $query=mysql_query("INSERT INTO nicklist(nick) VALUES ('$userid')"); echo "&lt;font color='green'&gt;Thanks you for a vote. You have been rewarded 10 diamond!&lt;/font&gt;"; }else{ echo "&lt;font color='red'&gt;You can only vote every 24 hours to get a reward.&lt;/font&gt;"; } } ?&gt; &lt;center&gt; &lt;form target="_blank" action="**WEBSITE URL CAN GO HERE**" method="post"&gt; &lt;input onclick="document.getElementById('vote2').disabled=false" value="NAME OF BUTTON" name="vote1" id="vote1" type="submit" /&gt;&amp;nbsp;&lt;/form&gt; &lt;form method="post" action="**WEBSITE URL CAN GO HERE**" target="_blank"&gt; &lt;input disabled="disabled" name="vote3" value="NAME OF BUTTON" onclick="document.getElementById('vote4').disabled=false" id="vote2" type="submit" /&gt; &lt;/form&gt; &lt;/p&gt; &lt;span class="minecrafttext"&gt;Then Enter Your In-Game-Name: &lt;/span&gt; &lt;br /&gt; &lt;form method="POST"&gt; &lt;input name="nick" onSubmit="return nameempty();" /&gt; &lt;br/&gt; &lt;form method="POST"&gt; &lt;input name="dovote" type="submit" value="Get your diamonds!" onclick="document.getElementById('vote4').disabled=false" id="vote4" disabled="disabled"/&gt; &lt;/form&gt; ©&lt;a href="mailto:Willrenfroe@gmail.com"&gt;WILLRENFROE&lt;/a&gt; &lt;/center&gt; &lt;/body&gt; </code></pre> <p>It needs to ask for DATABASENAME, DATABASE, USERNAME, DTABASE, PASSWORD, DATABASE HOST, links etc, can anyone help me? I tried google and couldnt find anything.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload