Jump to content

azezah

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

azezah's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have a code line which is function register_update_image( $ITEM ){ $imagetitle = htmlspecialchars(strip_tags(nl2br($_POST["imagetitle"]))); $imagedesc = htmlspecialchars(strip_tags(nl2br($_POST["imagedesc"]))); $imagecredit = htmlspecialchars(strip_tags(nl2br($_POST["imagecredit"]))); $imagekeys = htmlspecialchars(strip_tags(nl2br($_POST["imagekeys"]))); $collectionurl = htmlspecialchars(strip_tags(nl2br($_POST["collectionurl"]))); $imageurl = htmlspecialchars(strip_tags(nl2br($_POST["imageurl"]))); if ($imageurl != "") { if (!preg_match("/^http/",$imageurl)) { $imageurl = "http://".$imageurl; } $imagefile = $imageurl; $success = $imageurl; } global $userid; $query = "UPDATE items SET url = '$collectionurl' where item = '$ITEM';"; $database->setQuery($query); $database->query(); the html form is function image_form1( $ITEM ) { echo "<form enctype='multipart/form-data' action='index.php?option=com_classification&task=register_image1' method='post' name='imageuploader' onsubmit='return validate1(this);'> <input type='hidden' name='MAX_FILE_SIZE' value='5242880' /> <table width='90%' border='0' cellspacing='1' cellpadding='1' align='center'> <td valign='top'>"; $itemval = $_GET['item']; echo "$itemval"; echo "</td> <tr><td colspan='2'>Fields marked with an asterisk (*) are required.</td></tr> <tr><td width='30%'><label for='editedimage'>Image path: *</label></td> <td><input name='editedimage' type='file' class='inputbox'/></td></tr> <tr><td colspan='2'>OR</td></tr> <tr><td><label for='imageurl'>Image URL: *</label></td> <td><input type='text' name='imageurl' value='' size='58' maxlength='150' class='inputbox'/></td></tr> <tr><td><label for='imagetitle'>Title: *</td> <td><input type='text' name='imagetitle' size='58' maxlength='150' class='inputbox'/></td></tr> <tr><td>Description:</td> <td><textarea name='imagedesc' rows='5' cols='50'></textarea></td></tr> <tr><td>Credit:</td> <td><input type='text' name='imagecredit' value='' size='58' maxlength='150' class='inputbox'/></td></tr> <tr><td>Keyword(s):</td> <td><input type='text' name='imagekeys' value='' size='58' maxlength='150' class='inputbox'/></td></tr> <tr><td>Collection URL:</td> <td><input type='text' name='collectionurl' size='58' maxlength='150' class='inputbox' /></td></tr> <tr><td colspan='2' align='center'><input type='submit' name='Edit Image' class='button' value='Edit'/> </td></tr> <tr><td> </td></tr></table> </form> <script type='text/javascript'> function validate1(frm) { if ((frm.uploadedimage.value == '') && (frm.imageurl.value == '')) { alert('Please, enter the image path or URL.'); return false; } if (frm.imagetitle.value=='') { alert('Please, enter title.'); return false; } return true; } the update query is not working.
×
×
  • 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.