script help

Discussion in 'Scripts, 3rd Party Apps, and Programming' started by CascadesAdmin, Jul 9, 2007.

  1. t2t2t

    t2t2t New Member

    Messages:
    690
    Likes Received:
    0
    Trophy Points:
    0
    Actually it reads like this:
    PHP:
    $yoursite = &$webmaster = &$youremail = &/* LINE 57 HERE, if empty: */$subject 'You have successfully registered at $yoursite...'// First ; read because # means comment when not enclosed with "" or ''. 
     
    Last edited: Jul 12, 2007
  2. Zenax

    Zenax Active Member

    Messages:
    1,377
    Likes Received:
    4
    Trophy Points:
    38
    I was fairly close. I think I was right about the # commenting it out though, right?
     
  3. CascadesAdmin

    CascadesAdmin New Member

    Messages:
    87
    Likes Received:
    0
    Trophy Points:
    0
    ok it all works now but it gives me the message but dowsnt send an email or put the data into the my SQL table.
     
  4. Zenax

    Zenax Active Member

    Messages:
    1,377
    Likes Received:
    4
    Trophy Points:
    38
    well if it all works then that should happen. What are you using to insert into the SQL table and the mail() function is disabled, for security reasons.
     
  5. CascadesAdmin

    CascadesAdmin New Member

    Messages:
    87
    Likes Received:
    0
    Trophy Points:
    0
    ook. and I am using this:

    PHP:
    $query "INSERT INTO users (name, email, username, password) 
    VALUES('
    $name', '$email', '$username', '$password')"
    mysql_query($query) or die(mysql_error()); 
    mysql_close(connection); 
    and also, phpmyadmin is not working right.
    Edit:
    also someone make a my sql table query for me with the following criteria?

    Table Name: Email Table

    Tables:

    1. userID - Autogenerated, prmary auto-increment
    2. email - varchar 255 length
    3. validated - Int with a default value of Zero
    4. validkey - varchar 255
     
    Last edited: Jul 13, 2007
  6. Chris Z

    Chris Z Active Member

    Messages:
    5,603
    Likes Received:
    0
    Trophy Points:
    36
    If the "Table Name" is "Email Table", why are you inserting the data into "users"?
     
  7. Zenax

    Zenax Active Member

    Messages:
    1,377
    Likes Received:
    4
    Trophy Points:
    38
    I think he wants SQL code to create that table, along with a PHP insert statement

    PHP:
    $insert mysql_query("INSERT INTO users VALUES ('"$_POST['username'] ."', '"$_POST['password'] ."', '"$_POST['emailaddy'] ."') ")
        or die(
    "Could not insert data because ".mysql_error());

    Thats my inset statement that I use, and it seems to work.

    You have to make sure that the names used in the variables match the names used in the form items, otherwise it aint going to work.
     
    Last edited: Jul 14, 2007
  8. Chris Z

    Chris Z Active Member

    Messages:
    5,603
    Likes Received:
    0
    Trophy Points:
    36
    What I always do, is set some variables FOR the post variables. Example:
    PHP:
    $address $_POST['address'];
    and then I would do something like this:
    PHP:
    mysql_query("INSERT INTO `table` (`address`) VALUES ('$address');");
    instead of this:
    PHP:
    mysql_query("INSERT INTO `table` (`address`) VALUES (' "$POST['address'] ." ');");
     
    Last edited: Jul 14, 2007
  9. Zenax

    Zenax Active Member

    Messages:
    1,377
    Likes Received:
    4
    Trophy Points:
    38
    Yes you can do it that way, and I probably will end up changing my script, when I update the CMS that I am building, its just that at the moment, I am building the members panel. Back on topic .......

    Any more errors, and has what said helped you?
     
  10. CascadesAdmin

    CascadesAdmin New Member

    Messages:
    87
    Likes Received:
    0
    Trophy Points:
    0
    no I need someone to make me a mysql query that would make me that table, I need it for another newsletter script.

    So use this one:


    PHP:
    $insert mysql_query("INSERT INTO users VALUES ('"$_POST['username'] ."', '"$_POST['password'] ."', '"$_POST['emailaddy'] ."') ")
        or die(
    "Could not insert data because ".mysql_error());
    or the other one cause the other one is basicly what I have.
     

Share This Page