Jump to content

divinedesigns1

Members
  • Posts

    1,200
  • Joined

  • Last visited

Everything posted by divinedesigns1

  1. i also looked at your html form, and you have 2 head tags and 2 title tags, um you should have 1 head tag "including the closing" and 1 title tag "including the closing". also your form isnt your to work if you have part of it in 1 div and the other parts in different divs, you can have the inputs in different divs "please correct me if im not" and its going to work, so you should be doing something like this <form method="post" action="#"><div class="name"><input type="text" id="firstname" name="firstname" /><input type="text" id="firstname" name="firstname" /></div> and whatever other inputs and divs you need to go there, then you follow it up with </form> and this should allow your form to work, with the correct php script "not 100% good with php but i can help to my best knowledge well hope your stuff comes out good DDS1 we aint a pro............. yetttt
  2. Come on guys, give him a break, hes seem to be new at php like i am, but eduardlid you should really listen to these guys, i have learned so much from them, and now im capable of fixing my errors in php without them getting to the point of telling me what i did wrong, pretty much it be the smallest mistake, such as placing the wrong code in the wrong place or not closing a tag or placing both quotes where its needed. im also motivated to supass these guys or atleast get on their level so i can also help out those who are having trouble with these kind of thing, "im not a rockie and im not a pro, im just decent" the key to learning is to listen, accept and process, in other words, if someone gives you advice take it and run with it, if your not too sure on their advice, test it and if its wrong do feel free to let them know that it didnt work "they wouldnt mind being wrong" and im capable of saying this because i have a website that i need to fix which these guys helped me to fix 50% of the errors, so im gonna try and fix the other 50% on my own P.S stop assuming that your going to fail, if thats your attitude then programming isnt for you sorry to say, you need to be motivated about what your doing or your just going to keep feeling like your going to fail, now
  3. yea, i had 2 parts of the codes mixed up so then outputting the errors and not sending the email it sends the email without outputting the errors lol i got it fix tho
  4. i got it fixed, i mixed the code up a little thats why its not working
  5. yea i put the quotes like that, since i deleted the orginal infor for the mysqli_connect statement and yes i have check the value of each post
  6. hey sup?i am having problem with sending emails to the people who subscribe to receive the newsletter, it send the email but it doesnt show the errors anymore nor does it keep the info into the fields, also even if the fields are empty it still send the email out. this is the site www.divinedesigns1.com/demo/blast.php and this is the code <?phpif(isset($_POST['submit'])){ $from = 'ty@ty.net'; $subject = $_POST['subject']; $text = $_POST['divineblast']; $display_form = false;if(empty($subject) && empty($text)){ //We know both $subject AND $text are blank echo 'Fill in both body and subject.<br/>'; $display_form = true;}if(empty($subject) && (!empty($text))){ echo 'you forgot the email subject.<br/>'; $display_form = true;}if((!empty($subject)) && empty($text)){ echo 'you forgot the body text.<br/>'; $display_form = true;}if((!empty($subject)) && (!empty($text))){ //Send the email}}else{$display_form = true;}if($display_form){ ?><table border="0" align="center" width="405"><tr><td width="399"><form method="post" action="<?php $_SERVER['PHP_SELF']; ?>"> <label for="subject">Subject of email:</label><br /> <input id="subject" name="subject" type="text" size="30" value="<?php echo $subject; ?>"/><br /> <label for="divineblast">Body of email:</label><br /> <textarea id="divineblast" name="divineblast" rows="8" cols="40"><?php echo $text; ?></textarea><br /> <input type="submit" name="Submit" id="submit" value="Submit" /> </form></td></tr></table><?php } $dbc = mysqli_connect(ty, ty, ty', 'ty') or die('Error connecting to MySQL server.'); $query = "SELECT * FROM newsletter"; $result = mysqli_query($dbc, $query) or die('Error querying database.'); while ($row = mysqli_fetch_array($result)){ $to = $row['email']; $first_name = $row['fname']; $last_name = $row['lname']; $msg = "Dear $firstname $lastname,\n$text"; mail($to, $subject, $msg, 'From:' . $from); echo 'Email sent to: ' . $to . '<br />'; } mysqli_close($dbc);?> what am i doing wrong?
  7. yea i know, that but was unsure if it would work or not but its up and working everything went correctly thanks
  8. nvm i figured it out, its a little pointless to style the legend but if you style the <p></p> tags inside of the legend it works perfectly your opinion is acceptable on what i just said
  9. hello, is it possible to style the legend tag in html? i want to put some padding so the text wouldnt be so close to it, is it possible for me to do this? if so how? do i have to do .legend{}/#legend{}/legend {}
  10. eduardchile you can also make a newsletter system or a contact page, or a login system, register system, or make a social website, or a form, etc. if you want to learn php, im reading this book called first head i can send you a copy if you wish, just inbox me your info "i dont think you can upload files and send to people on here 0.o"
  11. thats a good idea, 0.o i hope i learn how to do that because i have a nice idea hehehehehehe foxy are you a girl or a guy?
  12. nvm i got it, i used a $_get in the html form, then use a $_post in the php script which didnt work out too well, i guess you cant use $_post and $_get
  13. nope its not blank, i got it working but still dont know what was the problem i think i cant use the word text in a variable not too sure who gonna have to check it out, since i got it fixed
  14. hey sup, im trying to complete this script, but part of it isnt working, they mail gets send to the person emails but when it comes to the text that was suppose to display that doesnt show this is the code im using <?php$from = 'ty@ty.com';$subject = $_POST['subject'];$text = $_POST['text'];$conn = mysqli_connect('ty','ty','ty','ty') or die ('We have incounter a error');$query = "SELECT * FROM newsletter";$result = mysqli_query($conn, $query) or die ('problem excuting the query');while($row = mysqli_fetch_array($result)){$firstname = $row['fname'];$lastname = $row['lname'];$msg = "Dear $firstname $lastname, \n $text";$to = $row['email'];mail($to, $subject, $msg, 'from: ' . $from);echo 'You just BASTED emails to: ' . $to . '<br/>';echo 'THANK YOU FOR BLASTING';}mysqli_close($conn);?> the $msg = "Dear $firstname $lastname, \n $text"; is what is giving me a problem, in the email it displays Dear smith smity,and the rest is blank
  15. long time no see foxy, and yea i am using post, but it was placed in a different file, so i included the myconnect file to that page
  16. ok so this just came across my mind, can you have a form where the date of the form, changes according to the present day, and when someone fill it out, the form grabs that code and store it into the database, so if you need to search for a specific info you dont have to go through all of them BUT just select the date of which you wish to view and bam all the mails from that specific date gets displayed
  17. hey birbal i figured it out thanks for the help man
  18. yes your correct on that, and thats what i missed when i first readed the page, until i re-read the page, it explained that the escape variable /n doesnt not work with the single quote but it would process the operation in the double quotes instead
  19. yea its working but its coming up blank in the database, and yea i send the variables in the phptest.php then i include the myconnect with the insert or was that a wrong move? anyway this is the code i did, when i figured how to fixed it, then i try yours but it came back with the same error <?php$dbhost = 'ty';$dbuser = 'ty';$dbpass = 'ty';$dbname = 'ty';$conn = mysqli_connect($dbhost, $dbuser, $dbpass, $dbname) or die ('Error connecting to mysql');$query = "INSERT INTO demo SET firstname='$firstname', lastname='$lastname', email='$email', country='$country', service='$service', amount='$amount', comment='$comment', detail='$detail'";$result = mysqli_query($conn, $query) or die ('Error querying database.');mysqli_close($conn);?>
  20. it not working, it insert everything blank grrrrr
  21. hey birbal,how do you make the subject variable be the subject that the person choices? i did $subject = $subject; but it didnt work
  22. you should close all of your tags, and make sure the php statements are close with a semi colon, have both quotes, etc "if you would like a copy of a php book im reading i dont mind sending you it, its very helpful" well im gald your script works now hope you get a good grade lata
  23. correct Don E, but i got it working now tho, i just had to do this <?echo 'my name is: ' . $firstname. '' . $lastname .'<br/>';?> and it displayed the name how i wanted it to, i was unsure why the person used \n but i had to re-readed the page a second time, and i didnt notice that i had skipped a piece of info in the book. Thanks tho
  24. hello, i think im doing something wrong here, <?php$dbhost = ty.ty.cp;$dbuser = 'ty';$dbpass = 'ty';$conn = mysqli_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');$query = "INSERT INTO demo(firstname, lastname, email, country, service, amount, comment, detail)" . "VALUES ('$first_name','$last_name','$email','$country','$service','$amount','$comment','$detail')";$result = mysqli_query($conn, $query) or die ('Error querying database.');mysqli_close($conn);?> what am i doing wrong here? i keep getting the "error querying database"
×
×
  • Create New...