Jump to content

Stephen

Members
  • Posts

    200
  • Joined

  • Last visited

    Never

Contact Methods

  • MSN
    aadude@live.com

Profile Information

  • Gender
    Male
  • Location
    USA

Stephen's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks a lot, that worked . (off topic, but I remember you from when I frequented phpfreaks ^^)
  2. As I am not skilled in Regex, I am having trouble with this line of code. I use this: preg_match_all('/f_[a-zA-Z0-9]*_/', $string, $match); to locate the string (including f_ and _). For example, I have a function named f_get_value_ and f_set_value_ and I would like to locate these function names. However, when I do print_r($match[0]), it returns with: Array ( [0] => f_set_ [1] => f_get_ ) Obviously it is cutting it off at the first underscore it comes across (after f_) rather than what I want it to do (cut it off at the final underscore). I cannot guarantee that there will be only 1 underscore between the words (get/set_value). There could be 2, 3, 4, or more. I am looking for a regular expression that will accomplish this goal and I thank anyone who attempts to help.
  3. You didn't use $ before the variable names... and I recommend using brackets when directly using variables within double quotes: for ($i=1; $i<11; $i++) { echo "<tr>"; echo"<td><p><strong>[{$i}]</strong></p></td> "; echo"<td><textarea name='causes[{$i}]' cols='30' id='causes' value='{$causes[$i]}'></textarea></td>"; echo"<td><textarea name='corrective_action[{$i}]' cols='50' id='corrective_action' value='{$corrective_action[$i]}'></textarea></td>"; echo"<td><input name='name[{$i}]' type='text' id='name' value='{$name[$i]}' /></td>"; echo "<td><input name='date[{$i}]' type='text' id='date' value='{$date[$i]}' /></td>"; echo "<td><textarea name='remarks[{$i}]' cols='50' id='remarks' value='{$remarks[$i]}'></textarea></td>"; echo"</tr>"; } I guess you already solved this though? o.O
  4. You're missing a double quote in your array: 15 => "fiften): to 15 => "fiften"
  5. Something like: <?php $thisYear = date("Y", time()); $i = 0; do { echo intval($thisYear)+$i; $i++; } while(true); ?>
  6. I'm thinking it's this line: $resultv = mysqli_query($cxn,$sqv) or die (mysqli_error($result)); Try changing it to: $resultv = mysqli_query($cxn,$sqv) or die (mysqli_error($cxn));
  7. See what happens when you do (instead of the foreach): print_r($_POST['manager']);
  8. You could try something like: Sorting Order</span><br> <select name="sort" class="textBox_center" id="sort" style="width:150px;"> <option value="1" onclick="newestentries.display='block';youngesttrees.display='none'">Newest Entries</option> <option value="2" onclick="newestentries.display='none';youngesttrees.display='block'">Youngest Trees</option> </select> And have two sections that would correspond to this: <div id="newestentries" style="display: none"> <?php $result = mysql_query("SELECT * FROM album ORDER BY dtime DESC",$connect); while ($row = mysql_fetch_assoc($result)) { echo(" <a href=\"image_script.php?albumid=" . $row["albumid"] . "\">" . $row["title"] . "</a><br />"); } ?> </div> <div id="youngesttrees" style="display: none"> <?php $result = mysql_query("SELECT * FROM album ORDER BY age DESC",$connect); while ($row = mysql_fetch_assoc($result)) { echo(" <a href=\"image_script.php?albumid=" . $row["albumid"] . "\">" . $row["title"] . "</a><br />"); } ?> </div> Not sure if that's what you're looking for though.
  9. I chose right, but I don't think a button is needed - it's just as easy, if not easier, to type in the bbcode manually.
  10. Can't think of anything else, but I recommend you check your personal messages. Also, there is a "Solved" button somewhere around your topic you can press xD. I think it's at the very bottom, but I haven't posted any topics too recently so I don't remember.
  11. Ah, I meant the actual data itself (like the base64_encrypted data). Right now you could try using this code instead of the old one: (below) Try creating another album and see if you get the same little icon (and check if the information is different in the table for the two different images). EDIT: Actually, after looking at it, this ($result = mysql_query("select * from album where albumid='".addslashes($image).".jpg'") would not work if your "albumid" is an auto_incrementing integer. Try using these: <?php include("config.php"); $image = stripslashes($_GET['image']); $result = mysql_query("select * from album where albumid='". addslashes($image)."'"); $myrow = mysql_fetch_assoc($result); $imagebytes = $myrow['imgdata']; header("Content-type: image/jpeg"); print base64_decode($imagebytes); ?> (the display script): <?php include("config.php"); $albumid = $_GET['albumid']; $result = mysql_query("SELECT * FROM album WHERE albumid='$albumid' ",$connect); while($myrow = mysql_fetch_assoc($result)) { echo "<b>Title: </b>"; echo $myrow['title']; echo "<b><br>Posted: </b><i>"; echo $myrow['dtime']; echo "</i><b><br>Age (Years):</b>: "; echo $myrow['age']; echo "<br><br><a href=\"javascript:self.history.back();\"><-- Go Back</a>"; echo "<b><br><br><br><br>Image: <br><br></b>"; echo "<img src=\"get_image.php?image={$myrow['albumid']}\">"; } ?>
  12. I was getting confused on your display image script (because I thought it actually took image data through the url, which couldn't have worked), but basically what premiso said is correct. Not sure why it outputs a small icon :\ Can you PM or post some of your data in the album table?
  13. For uploading image data, try using base64_encode (on the image data before you insert it into the database) and to display it use base64_decode.
  14. I agree with thorpe... Have you already implemented a commenting system and want to be able to somehow tell the forum that a new reply has been posted, or are you having trouble creating a script that allows users to reply to threads?
  15. You could replace: $username=$_POST['username']; $password=$_POST['password']; With: $username=get_magic_quotes_gpc() ? stripslashes($_POST['username']) : $_POST['username']; $password=get_magic_quotes_gpc() ? stripslashes($_POST['password']) : $_POST['password']; To make sure slashes have not already been added. Also, you forgot to put $ before your variable name for the "query" variable.
×
×
  • 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.