Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Learn php tutor needed

Options
124»

Comments

  • Registered Users Posts: 963 ✭✭✭Greyian


    raher1 wrote: »
    Could you state where exactly it needs closing. I tried closing the last statement three time with varying degrees if unsucces.
    raher1 wrote: »
    <?php
    require('connect.php');
    // If the values are posted, insert them into the database.
    if (isset($_POST) && isset($_POST)){
    $username = $_POST;
    $email = $_POST;
    $password = $_POST;

    $query = "INSERT INTO `user` (username, password, email) VALUES ('$username', '$password', '$email')";
    $result = mysql_query($query);
    if($result){
    $msg = "User Created Successfully.";
    }

    ?>

    It depends on whether the "if($result)" statement should be inside the first if-statement (isset($_POST) && isset($_POST)) or not. I'm assuming it shouldn't be....as in, you're carrying out the first if-statement, then you are later carrying out the 2nd one (so they will both always run, the 2nd one isn't dependent on the first one).
    If this is the case, the 1st if-statement has to be closed before the commencement of the 2nd if statement, so it would look like this:
    if (isset($_POST['username']) && isset($_POST['password']))
    {
        // Code inside 1st if-statement here.
    [COLOR="Red"]}[/COLOR]
    if($result)
    {
        // Code inside 2nd if-statement here.
    }
    

    The "}" highlighted in red is missing from your original code.

    Disclaimer: I haven't tried running the code myself, so while the if-statement not being closed in the original code is a definite problem, it might not be the only one (I may have missed one just by looking at it). This means that other problems may arise when you fix the if-statement code (e.g. misnamed variables, misplaced semi-colons etc).


  • Registered Users Posts: 880 ✭✭✭raher1


    Ok,sorry about this. Going start from the beginning. I have re install my apache. Getting port 80 running and I think I jump the gun. More logical approach this time.


  • Registered Users Posts: 880 ✭✭✭raher1


    Is there anyone out who can config a php to run. Not just port 80. I mean run phpmyadmin file. I can't. It's all the battle.


  • Registered Users Posts: 880 ✭✭✭raher1


    Can't configure my php. I get port 80. Any body have some simple instructions. It's php 5.5.


  • Technology & Internet Moderators Posts: 28,792 Mod ✭✭✭✭oscarBravo


    raher1 wrote: »
    I get port 80.

    I don't know what this means. Try not to be so terse when describing your problems. Use more words, and explain your problems and symptoms in detail.


  • Advertisement
  • Registered Users Posts: 2,709 ✭✭✭MyPeopleDrankTheSoup


    i'm going to take a shot in the dark and say try exiting skype first and then seeing if you can load your local HTTP server on port 80. skype takes over port 80.


  • Moderators, Science, Health & Environment Moderators, Social & Fun Moderators, Society & Culture Moderators Posts: 60,082 Mod ✭✭✭✭Tar.Aldarion


    oscarBravo wrote: »
    I don't know what this means. Try not to be so terse when describing your problems. Use more words, and explain your problems and symptoms in detail.

    dude, he got port 80.


Advertisement