View Full Version : Simple embed generator
hannah sofia
06-15-2011, 05:54 AM
Hello good people,
I have a "widget" to let users embed it to their site. my codes is:
<iframe src="http://mysite.com/category/index.php?cat=category&site=otherwebsite.com" width="300" height="250" scrolling="no" frameborder="0"></iframe>
I want user to edit the text highlighted with red.
...and want to have a generator...
http://i53.tinypic.com/2vd5mc1.jpg
The category directory is always the same with the cat= value.
Please help me realize this goal.... been searching for 3 hours on the net but can't find anything near or related to it :(
Beverleyh
06-15-2011, 11:48 AM
I think we might need a bit more information so we can start you off.
Is it part of a link exchange system? Is there some existing code already prepared that you just want to alter? Are you trying to develop this widget from scratch? What's going to appear in the large field after submit? Are submit results going to be stored in a database or text file? Are user accounts involved? Is this a javascript code generator widget?
Please give as much information as possible and also a demo page if you can so we can get a feel for what you're wanting to achieve.
hannah sofia
06-15-2011, 05:20 PM
<iframe src="http://mysite.com/category/index.php?cat=category&site=otherwebsite.com" width="300" height="250" scrolling="no" frameborder="0"></iframe>
I just want the iframe code to appear after clicking the submit button :)
I have already the widget and just want to have a url like this : http://mysite.com/category/index.php?cat=category&site=otherwebsite.com as an iframe source.
The category chose on the dropdown will be same text for the category on the subfolder highlighted with yellow :)
if user choose a category "computer" from dropdown, generated text on the subfolder part is "computer" too>>url will be like>>> http://mysite.com/computer/index.php?cat=computer&site=otherwebsite.com
Thanks in advance!
Beverleyh
06-16-2011, 07:42 AM
You'll need to tweek the finer details, and add some sort of validation, but something like this should work;
<form action="" method="post">
Website: <input type="text" name="website" /><br/>
Category:
<select name="category">
<option value="category1">Category 1</option>
<option value="category2">Category 2</option>
<option value="category3">Category 3</option>
</select><br/>
Width: <input type="text" name="width" /><br/>
Height: <input type="text" name="height" /><br/>
<input type="submit" /><br/>
<textarea rows="10" cols="50">
<iframe src="http://mysite.com/<?php echo $_POST['category'];?>/index.php?cat=<?php echo $_POST['category'];?>&site=<?php echo $_POST['website'];?>" width="<?php echo $_POST['width'];?>" height="<?php echo $_POST['height'];?>" scrolling="no" frameborder="0"></iframe>
</textarea>
</form>
[TIP] - When you need to develop small scripts/apps like this, first try and think about the processes you might need and then think about what existing scripts/apps also use the same processes. Thats usually the most logical thought pattern to help somebody achieve something. This first thing that sprung to mind here for me was a contact form that prints your form input details on a web page after submit - its the same principle for what you want but the input is just echo'd into a textarea. From there you'll be able to search for tutorials and examples and build your own code more easily.
hannah sofia
06-16-2011, 07:42 PM
Thank you ma'am for your kind help! I'll keep that in mind. Tc always! :)
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.