Jump to content

scootstah

Staff Alumni
  • Posts

    3,858
  • Joined

  • Last visited

  • Days Won

    29

Everything posted by scootstah

  1. Use single quotes. $query = 'LOWER(name)="$tabB"';
  2. if you are talking about manipulating the browsers back button, it can't be done with JS. It can, but it's a bit of a hack and not very reliable.
  3. Agreed. There are times when eval() is a good choice. Calculators are one of those few times.
  4. It can only be done with Javascript and has nothing to do with PHP.
  5. It's true that the file size is smaller without white space. But a few tabs isn't going to make a whole lot of difference. If you fully minified it you can shave a good chunk of file size off. But the performance gains are negligible.
  6. You said you want to call a function, so maybe you want preg_replace_callback()?
  7. You need to give your <select> a name, and then access it from the $_POST superglobal. So like echo $_POST['selectname'];
  8. This is his code: reply.php <?php include"header.php"; if(isset($_POST['submit'])) { $comment=mysql_real_escape_string(trim($_POST['comment'])); $name=mysql_real_escape_string(trim($_POST['name'])); if($comment!=='' && $name!=='') { $ins="INSERT INTO post(post_content,post_by)VALUES('$comment','$name')"; mysql_query($ins) or die(mysql_error()); if($ins)echo"succesfull, you can click back to view your comment and other new comments</a>"; } else { echo"You can not post an empty page or leave your name blank"; } } ?> comments.php <?php include"header.php"; $topicid=$_GET['id']; ///please note that i joined the two tables POST and TOPICS with a common id(topicsID); $sql="SELECT post_content,post_by FROM post WHERE $topicid=topicsID"; $result=mysql_query($sql)or die(mysql_error()); while($row=mysql_fetch_array($result)) { echo"<strong>{$row['post_by']}</strong>: {$row['post_content']}"."</br>"; } ?> So. This is wrong: $sql="SELECT post_content,post_by FROM post WHERE $topicid=topicsID"; It should be: $sql="SELECT post_content,post_by FROM post WHERE topicsID='$topicid'"; In reply.php you don't enter the topic ID, only the content and name...so you can never retrieve it. And you don't escape or validate the $topicid in comments.php.
  9. Why make the salt only numbers? It would be more secure with 0-9a-zA-Z. hash_hmac() is better too.
  10. What about Skype with the plan to call landlines? Or that magic jack thing.
  11. What are you trying to do with this?
  12. Don't use Javascript for image rollovers. Use CSS. <div id="hoverImg"></div> <style type="text/css"> #hoverImg { background:url(test_1.png) no-repeat; width:100px; height:100px; } #hoverImg:hover { background:url(test_1_hover.png); } </style>
  13. Personally I would create an RSS feed instead of iframe's. But I don't really understand your question.
  14. <?php echo "<td colspan='160'><div class='ex'>" . nl2br($message) . "</div></td></tr>"; ?>
  15. But did you add that code and then try?
  16. There's nothing wrong with using cookies. Just make it so if someone tries to spoof the cookie, they don't get away with it. PHP session's are safe if you take precautions. If you're on a shared server, store them in a database and not on the file system (it stores in the file system by default). This is because on a shared server other users could theoretically access the session data. Read up on session hijacking and how to avoid it. This is a good read.
  17. A proxy.
  18. String escaping and SQL sanitation has nothing to do with user authentication; it is necessary for any interaction with a database. User authentication is hard, and easy to do incorrectly. Use existing secure solutions. Look at the code to see what they are doing, and why they are doing it. With that said, these are the most important in my opinion (in no particular order): 1. Password storage 2. Persistent logins 3. Active sessions 4. User permissions
  19. It will work. You could try PEAR::Mail if you want a little more capability. when trying to use php's mail is there a way to avoid this? You can use mail headers to change the from.
  20. Most of the services have API's. To answer your original question, just use a loop to send an email X amount of times. If you send a large amount of mail within a short period of time you run the risk of being marked as a spammer, so it's advised to break up large amounts of mail into smaller chunks and spaced out a little.
  21. Only if it's called after the external css file.
  22. http://api.jquery.com/jQuery.post/
  23. Use a service designed for this. Like http://www.benchmarkemail.com/ There's a bunch more but I can't think of the names right now. Basically these services take a lot of steps to ensure mail is delivered. You won't ever have to worry about being black-listed or getting through spam filters.
  24. Not true at all. AJAX can access separate pages just fine.
  25. You would need AJAX to accomplish this. When you click the link you would send an AJAX request to a PHP script that ran the query and returned the results.
×
×
  • 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.