Solved

how to create a post link

Posted on 2014-04-03
9
272 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 110

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 110

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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

Author Comment

by:milkywaystudios
ID: 39976365
0
 

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 110

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 110

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article discusses how to create an extensible mechanism for linked drop downs.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

730 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