Jump to content

blakesmoore

Members
  • Posts

    17
  • Joined

  • Last visited

    Never

Posts posted by blakesmoore

  1. Hi,

     

    I have a html form...

     

    <form name="myform" action="blake.php" method="POST">

    <textarea cols="40" rows="5" name="domains">

    </textarea>

    <input type="submit" value="Submit" />

    </form>

     

    I want to run a script on the outout of the text area.

     

    I have tried using this for file

     

    blake.php

     

    <?php

    $output = shell_exec('expiry '$_POST['domains']'');

    echo "<pre>$output</pre>";

    ?>

     

    But i have no luck...

     

    any ideas?

     

     

  2. Hey,

     

    Please can you help me, I dont know why this script doesnt work....

     

    index.html (form)

    <html>
    <body>
    
    <form action="insert.php" method="post">
    <br>Username: <input type="text" name="username" />
    <br>Domain Name: <input type="text" name="domain" />
    <br>Password: <input type="password" name="pass" />
    <br><input type="submit" />
    </form>
    
    </body>
    </html>

     

     

    insert.php

    <?php
    $output = shell_exec('create_hosting '.$_POST['username']' '.$_POST['domain']''.$_POST['password']');
    ?>

     

     

    When i run this i get the below error

     

    The website encountered an error while retrieving /insert.php. It may be down for maintenance or configured incorrectly

  3. Hey,

     

    I would there be a way i could create a form in which upon entering a domain name/URL it will tell you how many connections there are to the site and how many (if any) MySQL queries are running?

     

    If I add this line to a wordpress footer it displays the number of sql queries.

     

    <?php echo get_num_queries(); ?> queries in <?php timer_stop(1); ?> seconds.
    

    Any help is greatly appreciated.

     

    Thanks.

  4. Hey,

     

    I would there be a way i could create a form in which upon entering a domain name/URL it will tell you how many connections there are to the site and how many (if any) MySQL queries are running?

     

    If I add this line to a wordpress footer it displays the number of sql queries.

     

    <?php echo get_num_queries(); ?> queries in <?php timer_stop(1); ?> seconds.
    

     

    Any help is greatly appreciated.

     

    Thanks.

  5. Thanks again, have added the @ before the mysql_connect

     

    The connection error message is shorter, but would it be possible to literally just make it say 'Could not connect?'

     

    I don't really understand the timing bit, would it be possible to explain in simpler terms? Sorry about this but i'm only just learning :(

     

    Thank you for your help!

  6. Thanks for the help.

     

    If i enter invalid credentials i still get the warning error, do you know how i could just make this say connection failed?

     

    Also would you know how to add the time it takes to connect to the database?

     

    Thank you so much

  7. Hi,

     

    I'm trying to create a form which will test database connection but I'm getting an error. I'm new to php so any help would be appreciated.

     

    form.php

    <html>
    <form action="dbconnection.php" method="post"> 
    <table width="400" border="0" cellspacing="2" cellpadding="0"> 
    <tr> 
    <td width="29%" class="bodytext">Host Name</td> 
    <td width="71%"><input name="server" type="text" id="name" size="32"></td> 
    </tr> 
    <tr> 
    <td class="bodytext">Username</td> 
    <td><input name="username" type="text" id="email" size="32"></td> 
    </tr> 
    <tr> 
    <td class="bodytext">Password</td> 
    <td><input name="password" type="text" id="email" size="32"></td> 
    </tr> 
    <tr> 
    <td class="bodytext"> </td> 
    <td align="left" valign="top"><input type="submit" name="Submit" value="Send"></td> 
    </tr> 
    </table> 
    </form>

     

    dbconnection.php

    <?php
    $server = $_POST['server'];
    $username = $_POST['username'];
    $password = $_POST['password'];
    $link = mysql_connect ('$server', '$username', '$password');
    if (!$link) {
    die('Could not connect: ' . mysql_error());
    }
    echo 'Connected successfully';
    mysql_close($link);
    ?>

     

    When submitting the form you get the below error

     

    Warning: mysql_connect() [function.mysql-connect]: Unknown MySQL server host '$server' (1) in /website/public_html/dbconnection.php on line 6

    Could not connect: Unknown MySQL server host '$server' (1)

     

    If you connect successfully if should echo 'Connected Successfully'

    If you cannot connect if should say 'Could not connect'

     

    any advice would be greatly appreciated.

     

    Thanks

×
×
  • 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.