PDA

View Full Version : Need Help With A Code



nicefellow1234
09-13-2013, 02:53 AM
Hi..!

Friends..!

I an new here.Hoping you all will be fine..just wanted to get help of you guys...

Here is what i am looking for..!

i am using aviary photo editor here is the full implementation demo code just to get idea how it works...!

Aviary Implementation Code :

<!-- Load Feather code -->
<script type="text/javascript" src="http://feather.aviary.com/js/feather.js"></script>

<!-- Instantiate Feather -->
<script type='text/javascript'>
var featherEditor = new Aviary.Feather({
apiKey: 'ceegvx4siylhayrr',
apiVersion: 3,
theme: 'dark', // Check out our new 'light' and 'dark' themes!
tools: 'all',
appendTo: '',
onSave: function(imageID, newURL) {
var img = document.getElementById(imageID);
img.src = newURL;
},
onError: function(errorObj) {
alert(errorObj.message);
}
});
function launchEditor(id, src) {
featherEditor.launch({
image: id,
url: src
});
return false;
}
</script>

<div id='injection_site'></div>

<img id='image1' src='http://images.aviary.com/imagesv5/feather_default.jpg'/>

<!-- Add an edit button, passing the HTML id of the image and the public URL of the image -->
<p><input type='image' src='http://images.aviary.com/images/edit-photo.png' value='Edit photo' onclick="return launchEditor('image1', 'http://images.aviary.com/imagesv5/feather_default.jpg');" /></p>

Infact the problem is this that When someone edit the picture using this photo editor and then click on save button so it automaticaly generate a new link of image and save at their own server and also update the old image links with the new links in page so

i want to get that new image saved link when someone edit picture and then click on save button

like this first a user edit image and then click on save button so he will redirect to a page calling as "contact.php" or "contact.html" and automaticaly there an input field with type as text will get filled with that image new saved link.

here is that contact.html page code :


<!DOCTYPE html>
<html>
<head>

<title>HTML5 AJAX Contact Form</title>

<link href="assets/css/contact.css" rel="stylesheet" type="text/css" /> <!-- AJAX Contact Form Stylesheet -->

<script src="//code.jquery.com/jquery-latest.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/jquery-ui.min.js"></script>
<script src="assets/js/jquery.jigowatt.js"></script> <!-- AJAX Form Submit -->

<!--[if IE]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

</head>
<body>

<section id="contact">

<header>

<h1><abbr title="HyperText Markup Language">HTML</abbr>5 <abbr title="Asynchronous Javascript and XML">AJAX</abbr> Contact Form</h1>
<p>A form packed full of HTML5 and CSS3 awesomeness. With just 2 files this can be easily integrated into any <strong>HTML</strong> or <strong>PHP</strong> page!</p>

</header>

<mark id="message"></mark>

<form method="post" action="classes/contact.php" name="contactform" id="contactform" autocomplete="on">

<fieldset>

<legend>Contact Details</legend>

<div>
<label for="name" accesskey="U">Your Name</label>
<input name="name" type="text" id="name" placeholder="Enter your name" required="required" />
</div>
<div>
<label for="email" accesskey="E">Email</label>
<input name="email" type="email" id="email" placeholder="Enter your Email Address" pattern="^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,})$" required="required" />
</div>

<div>
<label for="phone" accesskey="P">Phone <small>(optional)</small></label>
<input name="phone" type="tel" id="phone" size="30" placeholder="Enter your phone number" />
</div>

<div>
<label for="website" accesskey="W">Website <small>(optional)</small></label>
<input name="website" type="url" id="website" placeholder="Enter your website address" />
</div>

</fieldset>

<fieldset>

<legend>Your Comments</legend>

<div>
<label for="subject" accesskey="S">Subject</label>
<select name="subject" id="subject" required="required">
<option value=""></option>
<option value="Support">Support</option>
<option value="A Sale">Sales</option>
<option value="A Bug fix">Report a bug</option>
</select>
</div>

<div>
<label for="comments" accesskey="C">Comments</label>
<textarea name="comments" cols="40" rows="3" id="comments" placeholder="Enter your comments" spellcheck="true" required="required"></textarea>
</div>

<div>
<label class="radio">
<input type="radio" name="optionsRadios" id="optionsRadios1" value="option1" checked>
Choose option one?
</label>
</div>

<div>
<label class="radio">
<input type="radio" name="optionsRadios" id="optionsRadios2" value="option2">
Or rather, option two?
</label>
</div>

<div>
<label for="agree" accesskey="A">Agree to terms</label>
<input name="agree" type="checkbox" id="agree"/>
</div>

</fieldset>

<fieldset>

<legend>Are you human?</legend>

<label for="verify" accesskey="V" class="verify"><img src="classes/image.php" alt="Verification code" /></label>
<input name="verify" type="text" id="verify" size="6" required="required" style="width: 50px;" title="This confirms you are a human user and not a spam-bot." />

</fieldset>

<input type="submit" class="submit" id="submit" value="Submit" />

</form>

</section>

</body>
</html>