Hello,
I have a MySQL db were I store articles in.
I have a form to fill these articles, and in that form I can select images who are stored into a directory. Selecting the images works good but the problem is when I want to edit the stored article then the image is not saved and I again have to select it from the selectdropdown box. Basicly I want to match the stored value with the current value in my loop.
Is there a way that the earlier saved image into an article keeps up with the rest from the article but keep it dynamic so if I want to, I still van change the image easy.
My code:
<select name="content_img" id="content_img">
<option value="">
<?php
$dirPath = dir('media/images/content');
$imgArray = array();
while (($file = $dirPath->read()) !== false)
{
if ((substr($file, -3)=="gif") || (substr($file, -3)=="jpg") || (substr($file, -3)=="png"))
{
$imgArray[ ] = trim($file);
}
}
$dirPath->close();
sort($imgArray);
$c = count($imgArray);
for($i=0; $i<$c; $i++) {
$selected = (isset($image) && $image == $imgArray[$i]) ? "selected" : "";
echo "<option value='{$imgArray[$i]}' $selected>{$imgArray[$i]}</option>n";
}
?></option>
</select>
HELP...please
Add "width" check when upload
Hi!Can someone add a function that is checking if picture witdh is bigger then 800px whwn uploading, then echo "image oversized" to the code below?Code: <?php ###/ VARIABLES -
MySQL issue
I am taking sentences through a form on page. Then checking some condition and trying to insert them in database. I have issues while inserting...foreach ($sentences as $final) {......else {
jquery validation in codeIgniter
hai i need to add client side validation to my fiels which are selected in a forloop.the fields are auto incremented according to count.i need to add validation for a selected fields onlymy code is
Varible in trigger - refering to correct schema
Hello
Mouseover to edit (Ajax)
hi friends, can anyone help with the code behind to get this application working, please in VB (new biz) <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
Sessions Value Not Saved
Hi,Im making a login form and im using this code:Code: if($login=="true"){$_SESSION['mlvl']=1;if($username=="admin"){$_SESSION['admin']=1;}else{$_SESSION['admin']=0;}}but when the
Wierd echo error?
Hi, i got the most wierd php error ever and i don't know why..Code: echo "<td><strong>MP:</strong></td>"; echo
help countdown timers
hello every one,I'd like to know how to insert many countdowns in the same page.The duration of each must be different and defined by members with a form.
Variable passed to each() is not an array or object
Hi,This is a email a friend type of form, and it isn't working anymore.<? function validate_email($email, $location) { $valid_address = true; $mail_pat = '^(.+)@(.+)$'; $valid_chars =
How to login with SAPCPIC userid
I have changed the Password for SAPCPIC in Development Server for 000,001 and 100 client.