/    Sign up×
Community /Pin to ProfileBookmark

Parse query to display image (i think)

Hi all,

I am going to explain what I want to do as best I can.

I need to create a form that takes input and that input gets incerted in an image SRC on the next page or the page with the results. An example would be like this:

Joe comes to the page and wants to see the weather data for weather station cw2551. Joe then enters “cw2551” into an input form and clicks ok. The page then processes that info and displays the image on another page.

Just for the record, the server that requests the image is not the server that hosts the image. (not sure if that matters)

If you have any questions about what I am trying to do or need someting explained better, let me know.

to post a comment
PHP

8 Comments(s)

Copy linkTweet thisAlerts:
@chrysMay 26.2005 — You're going to have to try to be a little more detailed than that.

Let's start with the form, and go from there... our form:

<i>
</i>&lt;form method="post" action="page.php" name="myform"&gt;
&lt;input type="text" name="input"&gt; &lt;input type="submit" name="submit"&gt;
&lt;/form&gt;


Now what do you want to do when the user submit this code?
Copy linkTweet thisAlerts:
@ShmohelMay 26.2005 — Someone on a different thread pointed this out to me. Might want to check the image functions of PHP out.

http://www.php.net/manual/en/ref.image.php

There are some real neat and useful things that PHP can do to manipulate images.

Are you just trying to overlay text over an image?
Copy linkTweet thisAlerts:
@chrysMay 26.2005 — Someone on a different thread pointed this out to me. Might want to check the image functions of PHP out.

http://www.php.net/manual/en/ref.image.php

There are some real neat and useful things that PHP can do to manipulate images.

Are you just trying to overlay text over an image?[/QUOTE]


Yeah the image functions are great, I've played with them a little. You can snag images from any site and create an image handler locally and manipulate it all you want and then even save it locally for later use, or you can just discard it when you're done with the dynamic editing.

Best of luck.
Copy linkTweet thisAlerts:
@towerboyauthorMay 26.2005 — ok,

Let me try this again. Here is the form...

[CODE]<form method="post" action="page.php" name="myform">
<input type="text" name="input"> <input type="submit" name="submit">
</form>[/CODE]


What I need to do, is take the input text and insert that into the image src. That would look like this.

[CODE]<img src="http://www.findu.com/cgi-bin/plot.cgi?call=cw2551&degree=0.1&xsize=450&ysize=300">[/CODE]

Where "call=cw2551" is, I need to insert the text of the previous form. Just the part after the "=" though.

Does this make any sence?
Copy linkTweet thisAlerts:
@ShmohelMay 26.2005 — Use something like what I have below.

[code=php]
<form method="post" action="page.php" name="myform">
<input type="text" name="input"> <input type="submit" name="submit">
</form>
<?
$from_form = $_POST['input'];
echo "<img src='http://www.findu.com/cgi-bin/plot.cgi?call=".$from_form."&degree=0.1&xsize=450&ysize=300'>";
?>
[/code]
Copy linkTweet thisAlerts:
@towerboyauthorMay 26.2005 — Hey that works good. Is there any way to pass that info to another page?

Let's say the form is on "find.php" and I want the results diplayed on "results.php"? Can that be done?
Copy linkTweet thisAlerts:
@chrysMay 26.2005 — Hey that works good. Is there any way to pass that info to another page?

Let's say the form is on "find.php" and I want the results diplayed on "results.php"? Can that be done?[/QUOTE]


My boy, that is the point of PHP ?

if your form action on find.php is = to results.php, you can access all of the data on results.php from the form on find.php

try this code on results.php:

print_r( $_POST );
Copy linkTweet thisAlerts:
@towerboyauthorMay 26.2005 — I thank you all for your help. The first time a tried to send the info to another page, it didn't seem to work. It works fine now. Thanks again!!
×

Success!

Help @towerboy spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.15,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...