Solved

how to create a post link

Posted on 2014-04-03
9
268 Views
Last Modified: 2014-04-03
Hi, I want to basically show a search box in the middle of my page, but its not really a search box, more of a post info box.
The user pastes a URL into the box and click show... then the page will show the image.
So... user pastes for example  http://ir.ebaystatic.com/pictures/aw/pics/globalheader/spr14.png into the box and clicks go and the page would convert that tp <img src="http://ir.ebaystatic.com/pictures/aw/pics/globalheader/spr14.png"> and then show the image.

can someone help me with this...
Please remmeber iphones ipads need to use this also.
0
Comment
Question by:milkywaystudios
  • 5
  • 4
9 Comments
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 39976133
Please see these links.   You can add your desired CSS for the paragraph:
http://iconoun.com/demo/temp_milkywaystudios.php
http://iconoun.com/demo/temp_milkywaystudios.php?q=http%3A%2F%2Fir.ebaystatic.com%2Fpictures%2Faw%2Fpics%2Fglobalheader%2Fspr14.png

<?php // demo/temp_milkywaystudios.php
error_reporting(E_ALL);

// CREATE VARIABLES FOR OUR HTML
if (empty($_GET['q']))
{
    // CREATE THE FORM FOR INPUT
    $out = '<form><input name="q" /><input type="submit" value="Go" /></form>';
}
else
{
    // CREATE THE IMAGE TAG FOR OUTPUT
    $out = '<img src="' . $_GET['q'] . '" />';
}

// CREATE OUR WEB PAGE IN HTML5 FORMAT
$htm = <<<HTML5
<!DOCTYPE html>
<html dir="ltr" lang="en-US">
<head>
<meta charset="utf-8" />
<meta name="robots" content="noindex, nofollow" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<title>HTML5 Page in UTF-8 Encoding</title>
</head>
<body>

<p id="centrum">$out</p>

</body>
</html>
HTML5;

// RENDER THE WEB PAGE
echo $htm;

Open in new window

If you're new to PHP programming and want to get a foundation, this article may be helpful.
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_11769-And-by-the-way-I-am-new-to-PHP.html

Best of luck with the project, ~Ray
0
 

Author Comment

by:milkywaystudios
ID: 39976232
Hi sir your example works fine, when I put it on my server it does not load for me the image, do I need to change milkywaystudios?
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 39976360
I'm not sure I understand the problem.  Following the example in the question, I visited
http://iconoun.com/demo/temp_milkywaystudios.php

Then I copied this URL: http://ir.ebaystatic.com/pictures/aw/pics/globalheader/spr14.png and pasted it into the input control.  

Then I clicked "Go" to see the image.

What is the URL of the script on your server?
0
 

Author Comment

by:milkywaystudios
ID: 39976365
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:milkywaystudios
ID: 39976369
I get:

Request Entity Too Large
The requested resource
/testdavid.php
does not allow request data with GET requests, or the amount of data provided in the request exceeds the capacity limit.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
0
 
LVL 108

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 39976467
Yes, I do, too.  That's bizarre.  Never saw anything like that.  Since this is an information-only request I cannot imagine why a POST-method request would be required, but we can try it this way.

<?php // demo/temp_milkywaystudios.php
error_reporting(E_ALL);

// CREATE VARIABLES FOR OUR HTML
if (empty($_POST['q']))
{
    // CREATE THE FORM FOR INPUT
    $out = '<form method="post"><input name="q" /><input type="submit" value="Go" /></form>';
}
else
{
    // CREATE THE IMAGE TAG FOR OUTPUT
    $out = '<img src="' . $_POST['q'] . '" />';
}

// CREATE OUR WEB PAGE IN HTML5 FORMAT
$htm = <<<HTML5
<!DOCTYPE html>
<html dir="ltr" lang="en-US">
<head>
<meta charset="utf-8" />
<meta name="robots" content="noindex, nofollow" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
<title>HTML5 Page in UTF-8 Encoding (POST)</title>
</head>
<body>

<p id="centrum">$out</p>

</body>
</html>
HTML5;

// RENDER THE WEB PAGE
echo $htm;

Open in new window

0
 

Author Comment

by:milkywaystudios
ID: 39976495
ahhh excellent work my friend, I cant thankyou enough!
Now I can try and skin it, I have no idea but I will work on it haha, thanks so much
0
 

Author Closing Comment

by:milkywaystudios
ID: 39976500
worked on this for me and helped me all the way, true gem!
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 39976529
Thanks for your kind words and thanks for using EE.  Best of luck with the project, ~Ray
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now