Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: PHP Error Help

  1. #11
    Join Date
    Feb 2006
    Location
    Scotland
    Posts
    2,087
    Tokens
    138

    Latest Awards:

    Default

    PHP Code:
     <?php
    include("require.php");
    $con mysql_connect($host,$user,$pass) or die("<center><br />Couldn't connect to MySQL!</center><br />");
    $select mysql_select_db($database$con) or die("Couldn't connect to Database!");
    use 
    the_database_name

    $sql
    ="INSERT INTO questions (name, email, question)
    VALUES
    ('
    $_POST[name]','$_POST[email]','$_POST[question]')";

    if (!
    mysql_query($sql$con)) {
      die(
    'Error: ' mysql_error());
    }
    echo 
    "<center><br />Question submitted!</center><br />";

    mysql_close($con);
    ?>
    Give that a go, not entirely sure if it will work once again but possibly
    Last edited by Johno; 16-09-2010 at 03:41 PM.

  2. #12
    Join Date
    Mar 2009
    Location
    Western Australia
    Posts
    386
    Tokens
    0

    Default

    More errors
    PHP Code:
    Parse errorsyntax errorunexpected T_STRINGexpecting T_CONSTANT_ENCAPSED_STRING in /home/a4030461/public_html/scripts/jps/demo/insert.php on line 5 

  3. #13
    Join Date
    May 2005
    Location
    /etc/passwd
    Posts
    19,110
    Tokens
    1,139

    Latest Awards:

    Default

    Warning: mysql_connect() [function.mysql-connect]: Host '*HOST-REMOVED*' is not allowed to connect to this MySQL server in /home/*USER*/public_html/scripts/jps/demo/insert.php on line 3
    Does this one not mean that the server which hosts the files isn't allowed to connect to the server that is hosting the MySQL...?
    Quote Originally Posted by Chippiewill View Post
    e-rebel forum moderator
    :8

  4. #14
    Join Date
    Mar 2008
    Posts
    5,108
    Tokens
    3,780

    Latest Awards:

    Default

    You had a comment on line 5 not closing.

    PHP Code:
    <?php
    include "require.php";
    $connect mysql_connect($host$user$pass) or die("<center><br />Couldn't connect to MySQL!</center><br />");
    mysql_select_db($database) or die("Couldn't connect to Database!");

    $sql "INSERT INTO `questions` (`name`, `email`, `question`) VALUES('{$_POST["name"]}', '{$_POST["email"]}', '{$_POST["question"]}')";

    if(!
    mysql_query($sql$connect)) {
        exit(
    "ERROR: " mysql_error());
    }

    echo 
    "<center><br/>Question submitted!</center><br />";

    mysql_close($connect);
    ?>

  5. #15
    Join Date
    Mar 2009
    Location
    Western Australia
    Posts
    386
    Tokens
    0

    Default

    Sorry if I hadn't posted. This has all been solved

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •