Jump to content

blew

Members
  • Posts

    31
  • Joined

  • Last visited

    Never

About blew

  • Birthday 02/24/1986

Profile Information

  • Gender
    Male
  • Location
    São Paulo/SP/BR

blew's Achievements

Newbie

Newbie (1/5)

0

Reputation

  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
×
×
  • 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.