Php sql image editor - help with submit buttons!

Hi,
I have recently setup a website for my real-estate company, with a makeshift CMS behind it for my staff to use when updating properties.
I have a slideshow on my site for each property, which is populated through sql blobs (I know alot of people dont think this is the best method but I have managed to get it working so I am happy with it!).
Assuming the database has 4 fields - id, image1, image2, and image3 - I have managed to build separate pages to edit image1, image2 or image3 based on the id as per:
<?php
$db_host = 'xx'; 
$db_user = 'xx';
$db_pwd = 'xx';
$database = 'xx';
$id=$_GET['id'];
?>
<?php
if (!mysql_connect($db_host, $db_user, $db_pwd))
    die("Can't connect to database");
if (!mysql_select_db($database))
    die("Can't select database");  
function sql_safe($s)
    if (get_magic_quotes_gpc())
        $s = stripslashes($s);
    return mysql_real_escape_string($s);
if ($_SERVER['REQUEST_METHOD'] == 'POST')
          if (!isset($msg))
                $data = file_get_contents($_FILES['photo']['tmp_name']);
                $data = mysql_real_escape_string($data);
                mysql_query("UPDATE slideshow SET image1='$data' WHERE id='$id'");
                $msg = 'Success: image uploaded';
        ?>
<html><head>
<title>Slideshow Images</title>
<meta http-equiv="content-type" content="text/plain; charset=utf-8" />
</head>
<body>
<table width="974" border="1">
    <tr>
      <td width="158"><img src="ss/show_slideshow1.php?id=<?php echo $id ?>" alt="Image1"></td>
      <td><?php
if (isset($msg))
?><?=$msg?><?php
?>
</td>
<td width="664"><form action="<?=$PHP_SELF?>" method="POST" enctype="multipart/form-data">
<input type="file" name="photo" id="photo">
<input type="submit" value="upload">
</form></td></tr></table>
The above code will display image1, and let me edit it using a simple submit button.
What I am trying to do though, it to get all the images for the property where id ='$id' on one page with respective edit buttons. I can display them all on the same page easily, but cannot seem to crack the UPDATE form for each image.
Appreciate any advice or help in solving this!!
Thanks
Jack

Your code has been been copied to the end of the style rules.. not the rest of the html.
It would actually be better if you could provide a link to the live site, it's always much better for troubleshooting purposes to see the live page.
Can you do that?

Similar Messages

  • Need help with Submit button

    I'm needing a script that locks all of the fields once the submit button is pressed and it's emailed to someone else. Is that possible? Thanks in advance for your help.

    Right now I'm using javascript to submit the form. I'm using
         this.mailDoc({
         bUI: true,
         cTo: [email protected],
         cSubject: ""
    So I need to incorporate the script you gave me with this script that I'm already using?

  • Help with submit button remove null value

    Hello,
      First of all I dont know much about java, but I wanted to create a submit button and I did alot of research.  I want a button that will email some pdf files I have created in LiveCycle.  So far everyting works but my code needs help.
    There are a few fields I want to be place in the body of the e-mail, but if left blank I dont want null to apear on the email subject or body.
    Here is what I have so far *this is a work around I like to konw the proper code.
    var 
    strToAddress, strCCAddress, strSubject, strMessagestrToAddress
    = myemail@atwork;strCCAddress
    = myemail@atwork;
    strSubject
    = "Account "+DropDownList1.rawValue+" For: " +last.rawValue +", " +first.rawValue +" " +mi.rawValue;
    if 
    (mi.rawValue ==null || mi.rawValue =="")strSubject = "Account "+DropDownList1.rawValue+" For: " +last.rawValue +", " +first.rawValue;
    strMessage
    = "Please " +DropDownList1.rawValue +" account for " +"\n"+first.rawValue +" " +mi.rawValue +". " +last.rawValue +"\n\n*All provisions in  have been met" +"\n\n Comments: " +com.rawValue;
    if 
    (mi.rawValue ==null || mi.rawValue =="")strMessage = "Please " +DropDownList1.rawValue +" account for " +"\n"+first.rawValue +" " +last.rawValue +"\n\n*All provisions in have been met" +"\n\n Comments: " +com.rawValue;
    event.target.submitForm({cURL
    :"mailto:"+ strToAddress + "?cc=" + strCCAddress + "&subject=" + strSubject + "&body=" + strMessage,cSubmitAs:"PDF",cCharset:"utf-8"});
    //this.resolveNode("#event").submit.target = "mailto:"+ strToAddress + "?cc=" + strCCAddress + "&subject=" + strSubject + "&body=" + strMessage;
    The 4 fields am working on are First name, last name, Mi and comments.  First and last are alwasy used, but if MI is not I dont want Null in there, with what I have above it works but its messy.  I wanted to do the same with Comments if its left blank I like for it to read "Comments: None" not null
    on the If statement I just re did the whole deal with out the  mi.rawvalue but i now that is not right way... any help would be great.
    Thanks

    I believe that you should re-post this in either the Forms or the Designer forum.  You are more likely to get the right folks to look at it there.
    Generally this forum is for building custom Document Service Component (DSC) plugins that extend the LiveCycle ES server side product.

  • Help with submit button, signatures and locking fields

    https://acrobat.com/#d=sCcToPsLqquP0uePmVL1pQhttp://https://acrobat.com/#d=ZsRL5CeME*4iV3VHnvUFXw
    Well here's a doozy for ya. I have no idea what I'm doing as you will be able to see when you look at my form.
    What I want to happen is to have the user fill out the form, choose the operations manager and select submit button associated with the drop down box. All other dropdown boxes and submit buttons should be hidden. I need the form to lock so there are no edits except the signature field, the next dropdown box and submit button. I'd like to customize the email with a specific subject line and specify the email address based on the person selected from the drop down box. I'd like this to repeat itself until there are no more signature fields left. It is very important that this document follow the order specified.
    I tried to use an example Niall put out there to use regular buttons as submit buttons with script. I changed a couple things and it worked to submit the form based on the person selected but I still do not know how to lock the fields. Long story short, I broke what did work and don't know how to do what I really want to do or fix what had once worked. I don't understand javascript so please, if you're willing to help teach me, be patient and spell it out like i'm speaking a foreign language.
    Oh boy, even I don't want to do this. What a mess!

    I believe that you should re-post this in either the Forms or the Designer forum.  You are more likely to get the right folks to look at it there.
    Generally this forum is for building custom Document Service Component (DSC) plugins that extend the LiveCycle ES server side product.

  • Help with submit button on PDF form

    I created a form via the Forms Central desktop app then saved it as a PDF to my desktop.  When opening in Adobe Acrobat XI Pro, I noticed that I am unable to include a submit button - it does not let me edit the PDF.  I've tried going back into Forms Central and adding a submit button, but that feature is not available anywhere.  Any suggestions?
    PS - My preference is to have the responses returned to me, not my Forms Central account.
    Thanks so much.

    Hi;
    OK - I can clarify some things and tell you how to do what your looking for. 
    The desktop FormsCentral application tools are really designed towards create forms that do collect data on FormsCentral servers.  You can still easily create PDFs that do not submit data to FormsCentral, but you'll have to add any alternative submit functionality using the Forms tools in Acrobat.  You can create a PDF without the submit button in either case, signed in/out of the Desktop Application from the "File" - "Save as PDF Form" menu item.  You can then modify the PDF in Acrobat XI Pro by doing a "Save A Copy", when you open the copy you can edit it any way you like, adding a "Submit" button that email's the PDF/Responses back to you...
    Here's how: In Acrobat open the PDF you saved from the FormsCentral Desktop application and go to "File" - "Save a Copy" and choose a location, this will remove the security.  Open up the copy you just created and you can now edit it, here is a YouTube video tutorial using Acrobat XI, he covers the email button in about two minutes, there are lots of tutorials out there but this one is easy to follow:,
    http://www.youtube.com/watch?v=Jql1wp5Gofs
    Thanks,
    Josh Corey
    FormsCentral Team

  • I have an InfoPath with submit button, publish the same to form library.

    Hi All,
    i have an InfoPath with submit button, publish the same to form library.
    Now, i open the form  fill it and attach some files, when i press submit button, that attachments will go to the particular document library.
    Can any one help me out.
    Thanks in Advance!

    Hi Anil,
    According to your description, my understanding is that the attachments attached to the form were submitted to an documents library.
    By default, the attachments should be attached with the InfoPath form and will not be submitted anywhere.
    There may be some customizations on the form that is to submit the attachments to the document library.
    Please check the links below if the customizations are made in the form.
    http://www.bizsupportonline.net/blog/2010/01/upload-document-sharepoint-infopath-form/
    http://www.bizsupportonline.net/blog/2010/04/top-10-questions-infopath-file-attachments/
     Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • Need help with a button

    Hello,
    I need help with a button. I created a button and set it up
    so that when you click and hold it, the button becomes lighter in
    color (I used Alpha). I want the button to stay this light color
    after i release the click. Right now it goes back to the normal
    color when I release the click. Can somone help we this?
    Thanks!

    rpofclt wrote:
    > Hello,
    >
    > I need help with a button. I created a button and set it
    up so that when you
    > click and hold it, the button becomes lighter in color
    (I used Alpha). I want
    > the button to stay this light color after i release the
    click. Right now it
    > goes back to the normal color when I release the click.
    Can somone help we
    > this?
    you can't use the button itself if you want to maintain the
    DOWN state after
    release as button automatically resets itself once the mouse
    lives the HIT zone.
    Use movie clip instead and on press simply send it to a frame
    where there
    is DOWN state like image.
    Best Regards
    Urami
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • Associating two events with submit button using  javascript in jsp

    Hi
    How can i Associate two events with submit button using javascript in jsp. Firstly it should insert the data to database and secondly it should close the same pop-up window

    Have something like :
    <input type="submit" name="submitbtn" value="Click me" onClick="function1(); function2(); " />
    You just call both functions sequentially, it's that simple. Although using javascript to work with a database, that seems a bit tricky.

  • I was online earlier this week and liked the forms with submit buttons and the Adobe site directed me to upgrade to Adobe PRO XI in order to use forms so I bought five licenses. Just had it installed today and it is now asking me to sign up for forms Cent

    I was online earlier this week and liked the forms with submit buttons and the Adobe site directed me to upgrade to Adobe PRO XI in order to use forms so I bought five licenses. Just had it installed today and it is now asking me to sign up for forms Central in order to use this feature. What gives? The Adobe site gave me the impression that I would have this feature after purchasing the new upgrade. I would not have purchased the upgrade, let alone five of them had I know this. Am I missing something?

    Acrobat XI comes with the Fromscentral AIR application and the ability to create PDF forms authored in Formscentral. To have more than the free (1 form with 50 responses) level account you need to sign up for a Formscentral subscription.
    Andrew

  • Help with linking buttons to Scenes

    Hey,
    Rookie to Flash and AS3. Just needed some help with my buttons. Im making a flash program about pancakes (random I know). I have a "Mainmenu" scene and then a "Recipe" scene. I have a button on my mainmenu which takes me to the recipe page when I click it, the code behind the button is
    "stop();btn_recipe.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);function mouseDownHandler(event:MouseEvent):void {
    gotoAndStop(1, "Recipe");
    Then when I arrive at my recipe page I have a button which will take me back to my MainMenu, the code behind that button is:
    "stop();btn_home.addEventListener(MouseEvent.MOUSE_DOWN, mouse5DownHandler);function mouse5DownHandler(event:MouseEvent):void {
    gotoAndPlay(1, "MainMenu");
    So I run my program and the first button works and takes me to recipe page but the button to get to the main menu does nothing, click it and no response or anything
    Please help

    First, hopefully having all your code mushed onto the same line is a copy/paste error, otherwise it should look like...
    stop();
    btn_recipe.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
    function mouseDownHandler(event:MouseEvent):void {
         gotoAndStop(1, "Recipe");
    If the intention is to click the buttons to make them work, then you should use CLICK instead of MOUSE_DOWN.  MOUSE_DOWN can be a persistent state whereas CLICK involves releasing it afterwards.
    As for the code to get you back home, where is it located on the timeline?  Are you getting any error messages when you try to use it?
    One thing you should learn to use is the trace() function.  It is useful for troubleshooting.  You can use it now to see if your second button is talking to the function at all...
    stop();
    btn_home.addEventListener(MouseEvent.CLICK, mouse5DownHandler);
    function mouse5DownHandler(event:MouseEvent):void {
         trace("the button works okay");
         gotoAndPlay(1, "MainMenu");
    If you don't get that message in the output panel, you'll know the button is not properly coded to work.
    Most folks here will recommend you get away from using scenes in a design that includes navigation--they have a history of being problematic.  Instead of using scenes, divide the one main timeline up into sections or use movieclips for the sections and manage their visibility... or do a bit of both.

  • Help required with submit button

    Hi,
    I need a little help with the submit button. The user submits the form as PDf to a servelt using submit button. The form submitted is validated at server side. If there are any errors the error messages are to be displayed to the user as a part of Form.
    My approach was to have a hidden field present in the form. Once the error messages are recieved the field is to be populated with these messages and made visible true.
    Problem with my approach:
    1) How to send back data to the field using the servlet code which we have?

    Unless if you use a Webservice, sending data back to form from the Servlet may not possible.
    Once the form submits the data to the Servlet, the connection will be lost between the form and Servlet.
    But if you use a Webservice, you can trap the response and display it to the user.
    Other alternative to Servlet approach is, display a another page in the browser with the response.
    So the user after submits will be notified of the result in a new window.
    Thanks
    Srini 

  • Help with SUBMIT BY EMAIL, radio buttons

    Hi guys:
    I have a two parter. I sincerely appreciate any advice!
    1. Using Adobe Acrobat/Adobe LiveCycle Designer (mostly LiveCycle) I want to somehow pull a user-entered value from the PDF into the subject line of the email, created when the user clicks on "SUBMIT BY EMAIL".
    Specifically, when the end-user fills in the "Employee ID" line in the PDF form, and submits the form, I'd like the subject line of the Submit by Email -email to read "Employee #___" with the ___ obviously being the employee ID.
    Any help would be great; thanks!
    2. I am aware of how to prevent a PDF being submitted via email if the enduser hasn't filled out a certain part of it -- a message pops up saying that the user hasn't filled in a required line, and the line is highlighted with a red box, etc.
    What I can't figure out is as follows: I have two radio buttons, one (and only one) of which MUST be slected by the user. How do I set it up so that either one or the other must be selected in order to submit? Currently the form will only submit if you have both selected.
    Thanks!

    David,
    I can help with the first part I think. I just tried this out using Designer and Acrobat 8, and it worked. (I saved my form as a dynamic acrobat 8 pdf)
    I got this script from searching the forum and then tweaked it a tiny bit so that it works for the subject line. (http://www.adobeforums.com/cgi-bin/webx?addBookmark@@.3bc34abf/44)
    Using a regular button for submitting, I added this javascript as a click event:
    var Comment = EmployeeID.rawValue;
    if (EmployeeID.rawValue == null){ Comment = " "} else {Comment = EmployeeID.rawValue};
    event.target.submitForm({cURL:"mailto:[email protected]?subject=Employee#"+Comment+"&bo dy=Write whatever you want to go here.",cSubmitAs:"XML",cCharset:"utf-8"});
    So, my variable "Comment" will return the number typed into the EmployeeID field and put it in the subject line after "Employee #". If you copy/paste the code, make sure you change the email address and body message to be what you want.
    Kristi
    (oh, and if you want it to come back as pdf, change the cSubmitAs:"XML" to "PDF" and then enable user rights in Acrobat 8.)

  • SQL Insert with submit button

    Hey i was just wondering if any of yous knew how to get a html submit button to insert new information into a database table??
    i.e. Insert into Photo(PhooName) Values("hello")
    Im using jsp and htm. And im not using beans!!

    Hey i was just wondering if any of yous knew how to get a html submit button to insert new information into a database table??
    i.e. Insert into Photo(PhooName) Values("hello")
    Im using jsp and htm. And im not using beans!!

  • Created a form in Forms Central. Exported the PDF with Submit Button Option. When the PDF is filled out and submit clicked, it comes back asking for required fields to be filled but they already are. Any Help?

    b

    Hi;
    OK - I can clarify some things and tell you how to do what your looking for. 
    The desktop FormsCentral application tools are really designed towards create forms that do collect data on FormsCentral servers.  You can still easily create PDFs that do not submit data to FormsCentral, but you'll have to add any alternative submit functionality using the Forms tools in Acrobat.  You can create a PDF without the submit button in either case, signed in/out of the Desktop Application from the "File" - "Save as PDF Form" menu item.  You can then modify the PDF in Acrobat XI Pro by doing a "Save A Copy", when you open the copy you can edit it any way you like, adding a "Submit" button that email's the PDF/Responses back to you...
    Here's how: In Acrobat open the PDF you saved from the FormsCentral Desktop application and go to "File" - "Save a Copy" and choose a location, this will remove the security.  Open up the copy you just created and you can now edit it, here is a YouTube video tutorial using Acrobat XI, he covers the email button in about two minutes, there are lots of tutorials out there but this one is easy to follow:,
    http://www.youtube.com/watch?v=Jql1wp5Gofs
    Thanks,
    Josh Corey
    FormsCentral Team

  • Spry validation issue with submit button

    Hi,
    I'm new to Spry but am having an issue getting it to work at all.  I created a very simply form (i.e. table with Spry text field and submit button).  I've read many articles and been to several forums, but I can't seem to find the issue I'm having.  Basically, when I go to preview the page in a browser, the table with the Spy text field and submit button comes up fine, but when I hit the submit button, I see the page refresh and any values I had in the text field disappear, but nothing ever comes up saying "A value is required," which is what I'm looking for. This happens even if I don't have any values in the text field.  Below are images of what I'm describing and also the code.  I verified that the "Required" check box is checked in the SpryTextField and the submit button action is selected to "Submit Form."  My setup is Win 7, DW6, & XAMPP.  Any help you can provide would be greatly appreciated.
    Before Submit Button pressed:
    Browser after button pressed: (same as above but no message saying "A value is required.")
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    test
    <table width="600" border="1">
      <tr>
        <td><form id="form1" name="form1" method="post" action="">
          <span id="sprytextfield1">
          <label for="test"></label>
          <input type="text" name="test" id="test" />
          <span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span>
        </form></td>
      </tr>
      <tr>
        <td> </td>
      </tr>
      <tr>
        <td> </td>
      </tr>
      <tr>
        <td> </td>
      </tr>
      <tr>
        <td><form id="form2" name="form2" method="post" action="">
          <input type="submit" name="submit" id="submit" value="Submit" />
        </form></td>
      </tr>
      <tr>
        <td> </td>
      </tr>
    </table>
    <script type="text/javascript">
    var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "email");
    </script>
    </body>
    </html>

    Do yourself a big favor and don't waste time with Spry Validation.  Most modern browsers support HTML5 forms with the required attribute. 
    If you must placate older browsers, use jQuery validate script.  It's lightweight and works when HTML5 support is missing.  You can see an example below. If you hit submit with empty form fields, the required fields pop-up with messages.  View source in browser to see the code. 
    HTML5 Form with jQuery Validation
    Nancy O.

Maybe you are looking for