Solved

how to create a post link

Posted on 2014-04-03
9
270 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 109

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 109

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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

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 109

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 109

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
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 how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

809 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