PHP include() Problems on PHP5 Help!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
cloudnyn3
Forum Newbie
Posts: 7
Joined: Fri Jun 26, 2009 11:12 am

PHP include() Problems on PHP5 Help!

Post by cloudnyn3 »

Hello,
I'm currently running PHP5 on a linux server, and I am having some problems with the include string, and just to let you know I used the ofopen = on and the allow_URL_Include = on too, and neither have done anything. The code is here.

along with the errors and the lines they are on
If someone could help me with this I'd really appreciate it, i've been working on this for almost two days now and I can't seem to find a solution "sigh"

P.s. I've removed some of my information on here so no one decides to get creative and use my flaws against me -_-

Code: Select all

<?php
    //Database Information
    $dbhost = "****";
    $dbname = "&*&*&*";
    $dbuser = "sdfsdf";
    $dbpass = "sdfsdf";
 
    //Connect to database
    mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error());
    mysql_select_db($dbname) or die(mysql_error());
 
    //Collection of information
    $name = $_POST['name'];
    $email = $_POST['email'];   
    $username = $_POST['username'];
    $password = md5($_POST['password']);
 
    //Check for existing users
    $checkuser = mysql_query("SELECT username FROM users WHERE username='$username'");
 
    $username_exist = mysql_num_rows($checkuser);
 
    //This is the problem!!!!!!!!!!!!!!!!!!!!!
    if($username_exist > 0){
        echo "I'm sorry but the username you specified has already been taken.  Please pick another one.";
        unset($username);
        include 'Page to redirect to.htmll';
        exit();
    }
 
    //Insertion of data into table
    $query = "INSERT INTO users (name, email, username, password)
    VALUES('$name', '$email', '$username', '$password')";
    mysql_query($query) or die(mysql_error());
    mysql_close();
 
    echo "You have successfully Registered $name.";
 
    //confirmation Letter
    $yoursite = ‘www.intensity-technologies.com’;
    $webmaster = 'Cloud_Nyn3';
    $webmaster2 = 'Phayd_out';
    $youremail = ‘’;
 
    $subject = "YOUR ONE OF OUR FIRST members $name!!";
    $message = "Dear $name, I $webmaster and $webmaster2 Would personally like to thank your for registering with us, you are one of our very first members!
 
    $name, your login information is as follows below!
        Username: $username
        Password: $password
       
        Please print this information out and store it for future reference.
       
       
    Thanks,
        $webmaster and $webmaster2";
       
    mail($email, $subject, $message, "From: $yoursite\nX-Mailer:PHP/" . phpversion());
       
    echo " Your information has been mailed to your email address($email).";
 
 
    mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error());
    mysql_select_db($dbname) or die(mysql_error());
    ?>
    <!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=utf-8" />
    <title>Untitled Document</title>
    </head>
 
    <body>
    </body>
    </html>
 
ALSO!!!! The lines say 26 but they aren't on 26 they are on the include line, I may have altered some stuff for them to show up like that but I'm sure its the Include line.

Code: Select all

   I'm sorry but the username you specified has already been taken. Please pick another one.
    Warning: include() [function.include]: URL file-access is disabled in the server configuration in /mywebsiteregister.php on line 26
 
    Warning: include(mywebsite.com/register.html) [function.include]: failed to open stream: no suitable wrapper could be found in /mywebsiteregister.php on line 26
 
    Warning: include() [function.include]: Failed opening 'mywebiste.com'/register.html' for inclusion (include_path='.:/usr/local/php5/lib/php') in /mywebsiteregister.php on line 26
danielrs1
Forum Commoner
Posts: 29
Joined: Wed Jun 24, 2009 5:30 pm

Re: PHP include() Problems on PHP5 Help!

Post by danielrs1 »

You are not using the include() function the right way.

I sugguest you to read the PHP manual: http://pt2.php.net/manual/en/function.include.php
Post Reply