script help

t2t2t

New Member
Messages
690
Reaction score
0
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:

Zenax

Active Member
Messages
1,377
Reaction score
4
Points
38
I was fairly close. I think I was right about the # commenting it out though, right?
 

CascadesAdmin

New Member
Messages
87
Reaction score
0
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.
 

Zenax

Active Member
Messages
1,377
Reaction score
4
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.
 

CascadesAdmin

New Member
Messages
87
Reaction score
0
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:

Chris Z

Active Member
Messages
5,603
Reaction score
0
Points
36
If the "Table Name" is "Email Table", why are you inserting the data into "users"?
 

Zenax

Active Member
Messages
1,377
Reaction score
4
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:

Chris Z

Active Member
Messages
5,603
Reaction score
0
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:

Zenax

Active Member
Messages
1,377
Reaction score
4
Points
38
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'] ." ');");

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?
 

CascadesAdmin

New Member
Messages
87
Reaction score
0
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.
 
Top