Results 1 to 5 of 5

Thread: Simple embed generator

  1. #1
    Join Date
    Dec 2010
    Posts
    18
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Simple embed generator

    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...


    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

  2. #2
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    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.
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  3. The Following User Says Thank You to Beverleyh For This Useful Post:

    hannah sofia (06-15-2011)

  4. #3
    Join Date
    Dec 2010
    Posts
    18
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    <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!
    Last edited by hannah sofia; 06-15-2011 at 05:32 PM.

  5. #4
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    You'll need to tweek the finer details, and add some sort of validation, but something like this should work;

    PHP Code:
    <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.
    Last edited by Beverleyh; 06-16-2011 at 07:51 AM. Reason: tip added
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  6. The Following User Says Thank You to Beverleyh For This Useful Post:

    hannah sofia (06-16-2011)

  7. #5
    Join Date
    Dec 2010
    Posts
    18
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    Thank you ma'am for your kind help! I'll keep that in mind. Tc always!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •