Jump to content

king arthur

Members
  • Posts

    335
  • Joined

  • Last visited

    Never

Everything posted by king arthur

  1. Try replacing the whole thing with this and see if you are still getting similar errors. [code] <?php extract($_POST); if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,"."))) { echo "<h2>Use Back - Enter valid e-mail</h2>\n"; $badinput = "<h2>Feedback was NOT submitted</h2>\n"; } if(empty($visitor) || empty($visitormail) || empty($notes )) { echo "<h2>Use Back - fill in all fields</h2>\n"; } echo $badinput; $todayis = date("l, F j, Y, g:i a") ; $subject = $visitor; $msg=" Name: $visitor \n Email: $visitoremail \n Street: $visitorstreet\n City: $visitorcity \n State: $visitorstreet \n Zip Code: $visitorzipcode Payment Method: $paymentmethod \n Poster Style: $posterstyle \n Poster Line: $posterline \n Player Name: $playername \n Colors: $colors \n Main Text: $maintext \n Small Text: $smalltext \n Player Number: $playernumber \n Main Photo: $mainphoto \n Additional Info: IP = $ip \n Browser Info: $httpagent \n Referral: $httpref \n "; mail("me@comcast.net", $subject, $msg, "Jill"); echo "<div align=\"center\">Thank you for you order. If you do not receive personalized  order confirmation from us within two business days, please call us at 555-555-5555. </div> <p align=\"center\"> Date: $todayis <a href=\"sportsposters\"> Next Page </a> </p> "; ?> [/code]
  2. [code] <?php print("<table border=10>"); while($RESULT = mssql_fetch_assoc($RESULTDS)){ echo "<tr>"; echo "<td>"; echo $RESULT['Leave Code']; echo "</td>"; echo "<td>"; echo $RESULT['Lmo']; echo "/"; echo $RESULT['Lda']; echo "/"; echo $RESULT['LYR'];  echo "</td>"; echo "<td>"; echo $RESULT['whatever your hours field is called']; echo "</td>"; echo "</tr>"; } print("</table>"); ?> [/code] Try that.
  3. There must still be something in your script that is throwing the PHP interpreter. Post the whole thing again.
  4. Replace all the lines you posted with just the one single line I posted.
  5. Just to be clear, you want Date in one cell, Leave Type in the next cell, Hours in the next cell, and then underneath that the next row, and so on?
  6. Odd. Try replacing that whole lot with [code] extract($_POST); [/code] (that will do the exact same thing as all those lines). Then see if you still get an error.
  7. So the first cell should contain a code, the date and some hours, not just the date as it does now? Where will you get the hours from?
  8. Well, what do you see? How do you know it works?
  9. These are definitely the correct column names?
  10. Username and password are reserved words. Put backticks around them if you must use those column names. [code] $query = "INSERT INTO $table_users (id, first_name, last_name, email_address, `username`, `password`, signup_date) VALUES('$userid', '$first_name', '$last_name', '$email_address', '$username', '$mdpwd', '$today')"; echo $query; $sql = mysql_query($query) or die("Error: ". mysql_error(). " with query ". $query); [/code]
  11. Ok.... Look closely.  Change your code to this.  Exactly this. Do not add anything, do not take anything away. [code] $query = "INSERT INTO $table_users (id, first_name, last_name, email_address, username, password, signup_date) VALUES('$userid', '$first_name', '$last_name', '$email_address', '$username', '$mdpwd', '$today')"; echo $query; $sql = mysql_query($query) or die("Error: ". mysql_error(). " with query ". $query); [/code] And now let's see what the actual query string is.
  12. Can you put the "echo $query" in so we can see what the string is that you are actually passing to mysql_query()?
  13. No, no, no......the first line should just be [code] $query = "INSERT INTO $table_users VALUES('$userid', $first_name', '$last_name', '$email_address', '$username', '$mdpwd', '$today')"; [/code]
  14. Change it to this and let's see what the query string actually is. [code] $query = "INSERT INTO $table_users VALUES('$userid', $first_name', '$last_name', '$email_address', '$username', '$mdpwd', '$today')"; echo $query; $sql = mysql_query($query); [/code]
  15. Ah, you've confused the poor PHP interpreter! You don't need some of those opening and closing PHP tags ( <?php and ?> ), and there is one missing. Remove the ones on lines 28, 43 and 45.
  16. Nothing wrong there, you'd better post the whole script again.
  17. Can you seed the random number that MySQL uses from some known point? If so you could just seed it from the same point twice, but I don't know enough about MySQL to know if you can.
  18. It would print whichever day corresponded to the number in $day. If it was 1 it would print Monday, if it was 6 it would print Saturday. The point is not why there is a particular number in $day, the point is how to print the name of the day starting only with a number.
  19. [quote author=draco2317 link=topic=103643.msg412828#msg412828 date=1155169954] Lets say someone declares an array in there php code for the days of the week, like  ["sunday","monday","tuesday"....]  Whats the point of that.  thats my question, because all the books i have been reading have been doing stuff like that, and i dont get the point. [/quote] Ok an example for you. Suppose you had the day of the week in a variable, $day. It holds the value 1 to 7, because there are seven days in a week. That's all you know, you just know that this variable holds a number from 1 to 7.  You now need to print which day of the week that is.  How would you do that? You would have an array, $days_of_week = array("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"); Then to print the day you just echo $days_of_week[$day - 1]; It's minus one because array elements are counted from zero. Pretty trivial but that's a very simple example of why we use arrays.
  20. Try the get_browser() function: [url=http://www.phpfreaks.com/phpmanual/page/function.get-browser.html]http://www.phpfreaks.com/phpmanual/page/function.get-browser.html[/url]
  21. So this is running the same script on the same machine with the same database?
  22. [quote author=Jill78 link=topic=103613.msg412730#msg412730 date=1155158832] Likw I said, I am pretty clueless about PHP. I can create the form just fine, but getting it to work is another story. I will try your suggestion. I thought I needed to set it up like that so it makes sense in the email. Perhaps I should just hire someone. [/quote] Well, what you have "created" is just a text file, it means nothing in PHP or even HTML. You will need to at least understand some of the basics of PHP syntax to start to get a script to do whatever it is you're trying to do.
  23. You can't. If someone has forgotten their password the only option is to enable them to choose a new one.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.