Jump to content

blew

Members
  • Posts

    31
  • Joined

  • Last visited

    Never

Everything posted by blew

  1. For us Noobs, can someone please break down what's going on in this form?? (in Lamens terms?) Prepared Statements is just for PDO connections its better to use it than connecting straight to mysql in the beginning, its harder to use than mysql, but then its really easy, and safer http://www.php.net/manual/en/book.pdo.php for more informations google -> PHP PDO ftw
  2. maybe if you use "( )" instead of "{ }"... maybe gonna work.. but u have to set the $_SESSION first, as said above
  3. guys, im having a problem here... i tried too many ways to convert dates in american format, to brazilian format, but no one is working... how can i do that, to convert it to dd/mm/yyyy (it comes from my db in mysql)...
  4. $id = $_GET['id']; before the $sql = ...
  5. man , is the error in the $message? if so, just use <br>... post all ur code again, including the errors...
  6. try $variable = str_replace("<br>", "\r\n", $variable); and other thing... here: mail( "$to", "$subject","$message", "$headers"); you dont need to put double quotes in the variables...
  7. Thank you man, its working now... i just removed the single quotes and its worked! tks everybody its solved!!
  8. yep, the field is set as DATE, and i used NOW() , but this is still inserting as 0000-00-00 arrrghhh
  9. guys, im having a problem here thats making me crazy im making a system and i want to insert the current date in the mysql. I have the field called 'data' in the DB, but when i make the code to insert all the other fields, including the 'data', its work perfectly... unless that damn date! $query = "INSERT INTO news (id, titulo, mensagem, data) VALUES (NULL, '$titulo', '$mensagem', 'date(\"d/m/Y\")')"; whats wrong with that? its stores in DB as '0000-00-00'.
  10. <form name="news" method="post" action="<?php echo $PHP_SELF; ?>"> try changing the action="..." to <?php echo $_SERVER['PHP_SELF']; ?> displaynews.php -> try this code <?php include("dbconnect.php"); //include the file to connect to the database $getnews = mysql_query("SELECT * FROM mynews ORDER BY id DESC"); //query the database for all of the news while($r=mysql_fetch_array($getnews)){ //while there are rows in the table echo "<hr>"; echo "<font size=\"3\">$r['title'] added on $r['date']</font><br>"; echo "<font size=\"1\">Posted by $r['user']</font><br>"; echo "<font size=\"2\">$r['message']</font><p>"; } ?> see if this solves
  11. post all the code from postnew.php to see wheres the error
  12. you are not passing the fields to the code look $title = addslashes($title); $user = addslashes($user); $message = addslashes($message); $url = addslashes($url); $time = addslashes($time); $type = addslashes($type); see? try making this $title = addslashes($_POST['title']); $user = addslashes($_POST['user']); $message = addslashes($_POST['message']); $url = addslashes($_POST['url']); $time = addslashes($_POST['time']); $type = addslashes($_POST['type']); try it and let me know if worked properly
  13. arent you waiting for someone to do this for you, huh?
  14. No, that won't work. By virtue of the fact that a print() has been issued, we can assume that we are already inside the opening <?php tag, therefore there is no reason to reissue a <?php tag, nor is there reason to use an echo within a print(). What you need to do is view the html source in the first script to make sure the value is actually echoed into the to the hidden field's name= attribute, then print_r($_POST) to see if the value is in the post array. EDIT: Just saw the above note about the value being present . . . oh well, but in my see, he used print just to show the "hidden button", just like he did to the others parts of the form... i always use that way <?php echo $id; ?> and it always worked fine to me!
  15. print "<input type='hidden' name='id' value=\"$id\" />"; change it to print "<input type='hidden' name='id' value=\"<?php echo $id; ?>\" />"; this might work
  16. man, take attention to your code you're using double in single quotes in diferents ways $grabber = $this->pdo->query('SELECT * FROM tasks WHERE user_id = ' . $userid . "ORDER BY 'task_position'"); do you see? you started with single quote, then, after the . $userid . , you used double quote... or you use double, or you use single
  17. yep $verif = mysql_query ("select * from usr where login = $login") shall be $verif = mysql_query ("select * from usr where login = '$login'")
  18. well, i did not know hehe my bad.. so thats not the error lol
  19. dont you forget to edit in the form (action = "").. you shall put it something like (action = "<?php echo $_SERVER['PHP_SELF']; ?>" if you dont expecify the url in the action, you PHP code never gonna work
  20. good catch! ay caramba! such a simple thing, and I missed it, even using single-quotes in my suggestion... oh yeah but lets wait for the mark's answer
  21. try using double quotes $header = "From: $name etc"; it should work, cuz a variable only works in double quote, not in a single quote
  22. you need to validate your form first, like: $email = filter_var($_POST['email'], FILTER_VALIDATE_EMAIL); then, in the end of the form, you shall put the echo error
×
×
  • 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.