axhi Posted July 1, 2007 Share Posted July 1, 2007 Hi, I am fairly new to PHP and know minor details in it. I am trying to do a few things that I am having a terrible time with, hopefully someone here can help: 1. I have a page that is a User Agreement page. So before they can go on to the next page, I need them to agree to this agreement. How would I go about doing that? 2. I have been having troubles with formmail. I get the e-mails to the e-mail I have set up, but I always get an error. Also, I tried setting up the re-direct but something went wrong. 3. This questions kind of stems off of the first one, but once the user accepts the agreement page, they will be brought to a form to fill out and then a payment option. I was wondering, would there be any way I could count how many people have signed up and then turn off the sign up after a certain number? Anyway, I am not certain if I have asked too much or what because I am completely lost right now. These are the things that I am having the most trouble with and not been able to find out solutions. Thanks in advance for any help! If you need more info please let me know what you need. Quote Link to comment https://forums.phpfreaks.com/topic/57945-lots-of-issues/ Share on other sites More sharing options...
hackerkts Posted July 1, 2007 Share Posted July 1, 2007 1. Use session to check if "agree" button was hit 2. What errors are you getting? 3. Use database, like MySQL database Feel free to ask if you have other questions:) Quote Link to comment https://forums.phpfreaks.com/topic/57945-lots-of-issues/#findComment-287146 Share on other sites More sharing options...
axhi Posted July 1, 2007 Author Share Posted July 1, 2007 1. Use session to check if "agree" button was hit 2. What errors are you getting? 3. Use database, like MySQL database Feel free to ask if you have other questions:) Ya, I have no idea what session is. The errors I'm getting have to do w/ recipients. Is what it says. Thanks on the database, ill do that. Quote Link to comment https://forums.phpfreaks.com/topic/57945-lots-of-issues/#findComment-287147 Share on other sites More sharing options...
trq Posted July 1, 2007 Share Posted July 1, 2007 This forum is more for help wioth specific problems (code). If you have no idea what your doing, you need to read some tutorials. There is no point in us writtting tutorials especially for your needs, there are many tutorials allready on the web. Question 1 and 3 can easily be answered by reading this tutorial on how to deal with forms, and this tutorial on working with files. As for question 2, we need to see some code and the error your getting. Quote Link to comment https://forums.phpfreaks.com/topic/57945-lots-of-issues/#findComment-287148 Share on other sites More sharing options...
hackerkts Posted July 1, 2007 Share Posted July 1, 2007 Read this http://www.tizag.com/phpT/phpsessions.php for session, can you paste the error message? Quote Link to comment https://forums.phpfreaks.com/topic/57945-lots-of-issues/#findComment-287149 Share on other sites More sharing options...
axhi Posted July 1, 2007 Author Share Posted July 1, 2007 An error occurred while processing the form . Our staff have been alerted to the error . We apologize for any inconvenience this error may have caused. Quote Link to comment https://forums.phpfreaks.com/topic/57945-lots-of-issues/#findComment-287150 Share on other sites More sharing options...
trq Posted July 1, 2007 Share Posted July 1, 2007 Post your code!!! Quote Link to comment https://forums.phpfreaks.com/topic/57945-lots-of-issues/#findComment-287151 Share on other sites More sharing options...
axhi Posted July 1, 2007 Author Share Posted July 1, 2007 <form method="POST" action="?order"> <div align="center"> <p>If you agree please type YES into the box, and if you do not please type NO into the box:</p> <p><input type"text" name"order"/> <p> <input type="submit" value="submit" /> </p> </div> </form> <? if($_POST[’order’] == "YES") { echo "yay13"; } if($_POST[’order’] == "NO") { echo "Thank you for your patience"; } else { echo "I am sorry but at this time we will not be able to process your request."; } ?> Thats the code for my User Agreement. It doesn't work Quote Link to comment https://forums.phpfreaks.com/topic/57945-lots-of-issues/#findComment-287159 Share on other sites More sharing options...
axhi Posted July 1, 2007 Author Share Posted July 1, 2007 <form method="post" action="http://www.sconnietours.com/Custom Order Request.php" name="cusorder"> <input type="hidden" name="recipients" value="webmaster@sconnietours.com" /> <input type="hidden" name="required" value="email:Your email address,realname:Your name" /> <input type="hidden" name="subject" value="Custom Order Request" /> <input type="hidden" name="good_url" value="?request" /> <input type="hidden" name="bad_url" value="?error" /> And that's the intro form code for my page w/ that error that i posted earlier Quote Link to comment https://forums.phpfreaks.com/topic/57945-lots-of-issues/#findComment-287160 Share on other sites More sharing options...
hackerkts Posted July 1, 2007 Share Posted July 1, 2007 You will need a button with value YES and NO. As for your second post, you will need post more code, the statement that will show the error message. Example like when mail is not sent out, then show the error message. Quote Link to comment https://forums.phpfreaks.com/topic/57945-lots-of-issues/#findComment-287162 Share on other sites More sharing options...
axhi Posted July 1, 2007 Author Share Posted July 1, 2007 The e-mail always gets sent, it just posts that error afterwards. I want it to go to a confirmation screen but it wont. I have it set up to go to one if you look at my code. Quote Link to comment https://forums.phpfreaks.com/topic/57945-lots-of-issues/#findComment-287166 Share on other sites More sharing options...
hackerkts Posted July 1, 2007 Share Posted July 1, 2007 I will need to see your Custom Order Request.php code, you can try to post the code above and below the message shown after email was sent. Quote Link to comment https://forums.phpfreaks.com/topic/57945-lots-of-issues/#findComment-287167 Share on other sites More sharing options...
axhi Posted July 1, 2007 Author Share Posted July 1, 2007 I'll do that in a second. I have the option select on, but when I try and read it from $_POST it doesn't acknowledge. Am I reading the param in right? with this code? <? if($_POST[’order’] == "YES") { echo "yay13"; } if($_POST[’order’] == "NO") { echo "Thank you for your patience"; } else { echo "I am sorry but at this time we will not be able to process your request."; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/57945-lots-of-issues/#findComment-287168 Share on other sites More sharing options...
AndyB Posted July 1, 2007 Share Posted July 1, 2007 Don't use those "smart quotes" in your code. Look at your logic, as posted. If YES do something If NO do something, other do something else (which ALWAYS happens if you answer yes) Quote Link to comment https://forums.phpfreaks.com/topic/57945-lots-of-issues/#findComment-287170 Share on other sites More sharing options...
hackerkts Posted July 1, 2007 Share Posted July 1, 2007 Your form should look like this, <select name="order"> <option value="YES">Yes</option> <option value="NO">No</option> </select> Quote Link to comment https://forums.phpfreaks.com/topic/57945-lots-of-issues/#findComment-287174 Share on other sites More sharing options...
axhi Posted July 1, 2007 Author Share Posted July 1, 2007 <form method="POST" action="?order"> <div align="center"> <p><select name="order"> <option value="YES">Yes</option> <option value="NO">No</option> </select> </p> <p> <input type="submit" value="Continue" /> </p> </div> </form> <? if($_POST[`order`] == 'YES') { echo "yay13"; } else { echo "I am sorry but at this time we will not be able to process your request."; } ?> Thats what I have now Quote Link to comment https://forums.phpfreaks.com/topic/57945-lots-of-issues/#findComment-287176 Share on other sites More sharing options...
MadTechie Posted July 1, 2007 Share Posted July 1, 2007 change if($_POST[`order`] == 'YES') to if($_POST['order'] == 'YES') Quote Link to comment https://forums.phpfreaks.com/topic/57945-lots-of-issues/#findComment-287199 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.