Jump to content

Asday

Members
  • Posts

    77
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Asday's Achievements

Member

Member (2/5)

0

Reputation

  1. Because I'll be just pulling the raw text straight from the table, and echoing it, so if I want to output "03/11/91 - 2 (Hellsyeah, awesomeness.)" I can.
  2. (Sorry for the doublepost, the edit button's gone AWOL.) Ok, I got it to submit the data now, but it's still appearing as blobs in the database. I now have one BLOB - 8B as the date, and one BLOB - 6B as the content. What's going on, and how do I fix it?
  3. I set them to "text" and "longtext" under the pretence I'd be having multiple entries in a single day. I got rid of the two blank rows, and modified the PHP to your suggestions, same result, only no change in the table this time.
  4. That's fairly weird. Now I get "Query failed: " and nothing else. The table now has this in it. No idea what it means, though.
  5. I thought that $_POST[date] needed to be $_POST["date"], but things weren't working, so I changed it, and things stayed the same (and when asked to echo $_POST[date] after I'd set it, it echoed the right thing.) Anyway, now I'm left with a blank screen. It appears to be attempting to execute the second block of code.
  6. MySQL version: 5.0.51b-community-nt Error given: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1" At the moment, I've been wrestling with this code for quite a while. I want it to show a simple form when $_POST isn't set (and for some reason, it's always set, so I've used $_POST[date]) and when it is set, write $_POST[date] and $_POST[content] to the relevant places in the sql table. For some reason, it's failing now, and I'm well and truly stuck. <?php $html = "<html><head></head><body><p><form action=\"newspost.php\" method=\"post\">Datemarker: <input type=\"text\" name=\"date\" />Content: <input type=\"text\" name=\"content\" /><input type=\"submit\" /></form></p></body></html>"; if($_POST[date] == "") { echo $html; } if(isset($_POST)) { echo $_POST[date]; $con = mysql_connect("localhost","user","pass"); mysql_select_db("sg194", $con); $date194 = $_POST[date]; $content194 = $_POST[content]; $query = "INSERT INTO frontpage_news (date,content) VALUES (".$date194.",".$content194.")"; mysql_query($sql, $con); mysql_close($con); } ?> Apologies if this is in the wrong section.
  7. Asday

    Zebra

    This code: <?php $j=0; function shade($mode) { if ($mode == 0) { echo '</tr><tr style="background-color:#DDDDDD">'; $j = 1; } else { echo '</tr><tr>'; $j = 0; } } $i=0; foreach(scandir("upld194") as $x) { if ($i == "2") { shade($j); //echo '</tr><tr>'; echo '<td><a href="upld194/' . $x . '">' . '<img src="upld194/' . $x . '">' . '</a></td>'; $i = 0; } else { echo '<td><a href="upld194/' . $x . '">' . '<img src="upld194/' . $x . '">' . '</a></td>'; $i++; } } ?> which is meant to shade every other row in grey, shades every row but the first grey. Why?
  8. Haha, fixed it. Missed a ". Code fixed.
  9. <table border="3" width="100%"> <tr> <td align="center"> <form action="gallery.php" method="post" enctype="multipart/form-data"> <input type="file" name="file" id="file" /> <input type="submit" name="submit" value="Post!" /> </td> </tr> <tr> <?php echo '<td align="center">Browse for a picture here, or alternatively, type in the URL, and click the appropriate button to upload the said picture.</td>'; ?> </tr> </table><br /> <table border="1" width="100%"> <tr> <?php $i=0; foreach(scandir("upld194") as $x) { if ($i == "2") { echo '</tr><tr>'; echo '<td><a href="upld194/' . $x . '>' . $x . '</a></td>'; $i = 0; } else { echo '<td><a href="upld194/' . $x . '>' . $x . '</a></td>'; $i++; } } ?> </tr> </table> On all but the last file link, it comes out with the wrong link, with a suffix of lots of percent signs, and other such nonsense. Any help would be appreciated.
  10. That was the problem, thanks. It all werks now.
  11. <?php // ... for($x=($piccies=(scandir("upld194")))) // line 22 // ... ?> Produces: Parse error: syntax error, unexpected ')', expecting ';' in C:\xampp\htdocs\new\index.php on line 22 And I can't, for the life of me, work out where to put the stuff. Halp, please.
  12. Plech. Give me a moment. <span style="background-color:#CCCCCC;"> <?php echo "This is another paragraph"; ?> </span>
  13. You might just want to go into werd itself, and save it as an .htm. You can tidy up the html at a later date. Why's it urgent?
  14. Asday

    tooltip

    Blast! Thanks. With js, AJAX or CSS, how would I go about it? If someone could just post the code (or the trick I need to learn) I can probably take it from there.
×
×
  • 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.