Jump to content

steelerman99

Members
  • Posts

    30
  • Joined

  • Last visited

    Never

Everything posted by steelerman99

  1. I'm using cpanel on bluehost. How do I access my mail logs?
  2. Thanks. I do know that all the mail is sending successfully - when the mail function returns true, I print out on the page who the mail was sent to. I have not seen a failed message print out yet. Is there anything that I could put on the existing message (extra header or what not) that would not make it be flagged as spam? Also, how would I obtain the spam data from the other servers?
  3. Hey all! I have a database of users and their email addresses listed. One page sends each user some information that is unique to them. So, I have a loop that queries their record from a database, puts their unique information in an email, and sends it out. I can't send a mass email (eg with 100 addresses in the 'To:' header) because each email is different and unique to the user, so I'm calling the mail() function in a loop: (Pseudocode) foreach(record in db) { mail(unique message); } The code works fine, however, some users are not getting the email for one reason or another, even though the mail function executes successfully on EVERY iteration. I suppose their mail servers are considering it spam or something similar. Is there any way to prevent the messages from being considered spam and making sure they get through to the users? Thanks!!
  4. Hello! I recently ran into a bit of a problem and I'm not sure how to handle it. I was putting in some test data the other day, and in one of the boxes I wrote "Apartment #234", and my input to my php page got all messed up (truncated) since it treated the # like a hash and didn't convert the # to a %23. Likewise if I enter Steve & Mary, "Mary" is treated like i'm passing a variable named Mary. How do you deal with special characters like #, %, &, etc. that a user inputs to a form and is sent via an ajax url? Is there a better way to handle it than to do a string replace of every non-alphanumeric character imaginable? Thanks!
  5. Can anyone give a code snippet that would help me out? Thanks!
  6. Ah, I see. So basically that would be impossible to list it my way, huh?
  7. Hello everyone! Let's say I have the following tables: TABLE - SONGS ID - SONG 1 - Back in Black 2 - Evenflow 3 - Voodoo Child 4 - Jump Around ID is primary key TABLE FAVS ID - Person - Song1 - Song2 1 - Jeff - 1 - 3 2 - Steve - 2 - 1 3 - Brett - 3 - 4 ---------------------------------- What would be the SQL join query to show the song name in the FAVS table instead of the id so when the query is executed it looks like this: 1 - Jeff - Back in Black - Voodoo Child 2 - Steve - Evenflow - Back in Black 3 - Brett - Voodoo Child - Jump Around THANKS!
  8. have any ideas on what would cause this? thanks!
  9. Hey all! I'm getting an error when I send an HTML email Warning: mail() [function.mail]: SMTP server response: 503 5.5.0 need RCPT before DATA in .... Does anyone know what this is caused by? Here is my section of code that sends email: //($sendmailaddrs populated by a query earlier in code) $mymessage = <<<HERE <html> <body> <b><u><h2 align = 'center'>*****GAME ADDED TO YOUR SCHEDULE******</h2></u></b> <p> A game has been added to your schedule on $theday $fancydate: </p> <table border = '1'> <tr bgcolor = '#FF0000'><td><u><b><i>LEAGUE:</i></u></b></td> <td><u><b><i>$uschedule</u></b></i></td></tr> <tr><td><b>DATE:</b></td> <td>$theday $fancydate</td></tr> <tr><td><b>TIME:</b></td> <td>$time</td></tr> <tr><td><b>AWAY:</b></td> <td>$away</td></tr> <tr><td><b>HOME:</b></td> <td>$home</td></tr> <tr><td><b>FIELD:</b></td> <td>$field</td></tr> <tr><td><b>UMP1:</b></td> <td>$ump1</td></tr> <tr><td><b>UMP2:</b></td> <td>$ump2</td></tr> <tr><td><b>STATUS:</b></td> <td>$status</td></tr> </table> <p> <b>ASSIGNOR COMMENTS:</b> $comments </p> <p> Please confirm your receipt of this notification by replying to this email. </p> <p> If you have any questions, please contact the assignor of this game by phone or at $assaddr. </p> </body> </html> HERE; // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers .= 'To: $sendmailaddrs' . "\r\n"; if(mail($sendmailaddrs,'GAME ADDED on $theday $fancydate',$mymessage,$headers)) print"<br/>Mail sent to <b>$sendemailnames</b> at <b>$sendemailaddrs</b><br/>"; else print"<br/><b>ERROR:</b> Mail not successfully sent to <b>$sendemailnames</b> at <b>$sendemailaddrs</b>"; Thanks!
  10. Hey all! I'm making a schedule for employees and in my web interface, i want to give them the option (when they're logged on) to select dates which they want to "Close" so I know not to schedule them on that particular day. I already have an employees table and a schedule table... I just want to create a table (or two) that employees can input their closed dates. Another question which may be just as important- what do you think would be the best way to implement this on a php web page? Meaning, how should the user enter their closed dates into the database? It would be nice to have some kind of point-and-click calendar to close dates, but i'm not sure how to do that. I appreciate you help!!
  11. Got it. I needed to add a "group by" clause or it wouldn't work.
  12. it didn't work... it doesn't seem to like when I add multiple columns with the COUNT() function. i'm doing this sql through PHP, then displaying the results in a table on the page.
  13. I'm trying to make a query which would have 2 columns: the first column would be the person's name and the second column would be how many times that person's name appears in the table. How would I go about doing this? I've tried it using "Select name, COUNT(*) FROM...." but that doesn't seem to work. I appreciate your help! Thanks!
  14. Hello, I was wondering if you can modify a SELECT query to return all columns but just one or two. We know that doing " Select * " will display all columns of the table. What if we have say 50 columns, but we only want to exclude one or two columns? Would we have to type " SELECT col1, col2, col3, .......... , col 49, col50 FROM...." or is there an easier way to do this? Thanks!!
  15. Actually i'll use either post. If you can solve either of those, i'll take it!
  16. Edit: The above post is wrong. I only have one drop down box at the bottom of the page. What i want to do: when the user clicks one of the options in the box at the top of the page, i want the box at the bottom of the page with data that corresponds to the top. So for example. The top box choices are fruit and colors. If the user clicks on colors, box2 at the bottom will have choices of red, green, blue. If the user clicks on fruit at the top, the box will change to apple, banana, grape. Thanks!
  17. Hello again! I have a page with a drop down box at the top with 4 options. I have 4 drop down boxes further down the page with data that correspond to the choices in the first one (ie- the top box is a category and the 4 boxes further down the page correspond to those categories.) What i want to do is have the user select something from the top box, then enable one of the 4 drop downs down the page and disable the rest (or show/hide. whichever works). For example: if i choose option #2 in the top box, i want box #2 to be enabled and the others disabled (or show/hide). Can anyone tell me how i can accomplish this? I'm using php if that makes a difference. Thanks again!!
  18. Alright cool! The code works! Thanks again! I've never learned about 'literals' in SQL, so that was new to me.
  19. I probably did. I'll give my table structure here and my previous sql query and let me know what to change since i don't totally understand what's going on in btherl's post (sorry, bare with the newb here!!). I have 2 tables with the same structure named 'schedule' and 'newsched' Column names (in order): Date, Time, Away, Home, Field, Ump1, Ump2, Status Here is my sql query that i used before that is not currently doing what i want it to be doing. I'm trying to find all games that a particular umpire is scheduled to be on in 2 different leagues, which each have their own table (schedule and newsched, respectively): "select * from schedule where ump1 = '$name' or ump2 = '$name' UNION ALL select * from newsched where ump1 = '$name' or ump2 = '$name' order by date" So is there an object that i can reference to give me the name of the table as i'm printing it out (with code in original post), or how does this work? Thanks a billion once again!
  20. Perhaps i worded my original question poorly... I'm ok with the SQL and the Union statement. That's no problem. My question: when i am traversing through my query result and printing each record as a row in a table(as in the code snippet i provided), how do i know which table the particular row i'm printing belongs to? (because i use an 'order by' statement in my SQL query, which mixes up the rows between tables, so it's not just printing one table, then the next, etc all in order). Thanks
  21. darkfreaks, your function looks incredibly thurough. does this function have a chance of messing any regular input up that has characters that are not alphanumeric?
  22. i have a query that uses the union command with 2 tables. when i am printing out the values from the query in a table, i would like to print the table name that corresponds to the row/record i'm printing. i traverse through the result with: while ($field = mysql_fetch_field($result)) { //print table headers aka column names } while ($row = mysql_fetch_assoc($result)) { print "<tr>"; foreach ($row as $col=>$val) { //print each value in a <td> tag } print "</tr>"; } How do i know what table the specific row i'm on is from? Thanks!!
  23. I've made a simple function that i pass all my variables through when i process them with php code: function makesafe(&$var) { strip_tags($var); addslashes($var); trim($var); } Would this be enough to prevent most hackers from altering my form input from the previous page and injecting malicious code? What would you add to this function? Thanks!!
  24. Hey! I'm trying to check the data i'm getting from a form. I went to php.net and read what they had on how to work the preg_match function, and it was like reading greek. Since i'm so utterly confused, i'm taking the easy way out: Could someone please write the appropriate line of code to do the following: 1) Check to see that the input is all letters or numbers only. 2) Check to see that the input is all letters only. If you have an easier way, please let me know. Thanks again! This forum is a great help for this php green horn!!
  25. Thanks again guys. Also Ginger, i'm not very familiar with php security and what not. How would you go about checking input on the server-side?
×
×
  • 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.