Solved

how to create a post link

Posted on 2014-04-03
9
273 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

 

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

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

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

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
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.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

729 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