473,597 Members | 2,050 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I pass an image parameter in HTML? Is it possible???

Last year, I remember finding a web page describing how to pass the
name of a file to another web page, and have that web page load that
image file.

Now, I can't find my record of that (it was saved on another computer
that I can't get to right now), and I can't remember what search
parameters I used to find it when I googled the topic.

Can anyone point me the right direction? I'd like to use a method that
would be accessible to the most people, and a barrier to as few as
possible.

What I want to do, if possible, is pass the image URL to the web page
as part of the link, and have that page automatically use that image
URL in place of the default image. If you want to see a sample page,
look at http://www.godloveseveryone.org/sample/Personlz.htm ... where
you see the "GOD LOVES JOHN" maze, I'd like to have the link to that
page specify a specific image URL, and have that image show up both
places that the JOHN maze is displayed.

I hope it's possible, otherwise, I'm going to have to have 39,000
different html pages to do the same thing.

And yes, eventually, i need to learn JAVA so that I can write a program
to create those mazes on the fly. Or is there something else that this
old BASIC programmer should learn in order to do it?

John

Jul 23 '05 #1
23 12256
In article <11************ **********@f14g 2000cwb.googleg roups.com>,
Go************* *****@gmail.com enlightened us with...

What I want to do, if possible, is pass the image URL to the web page
as part of the link, and have that page automatically use that image
URL in place of the default image.


Is it your page accepting tha parameter? If so, that's easy. Just code it to
do it. Server-side scripting is best, as it won't rely on client-side
scripting support (which not all users have, plus browser issues, etc). You
could use javascript (client-side) for it, but I consider that a last resort.

If it's NOT your page, I have no idea how you could do this. Most scripting
languages don't allow you to change someone else's page. Security.

--
--
~kaeli~
Join the Army, meet interesting people, kill them.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #2
Hi, Kaeli,

The problem is that I know basic HTML, but I have no idea what to do
without an example. The page I referred to is simply what the final
page might look like, but I don't know how to pass parameters.

What do you consider the easiest method to learn, and where do I learn
what I need to learn? I'm guessing that the company hosting my page
allows a number of server-side solutions, if I can learn to use them.
(I know they have several available, but I don't have the list handy
.... that little piece of paper disappeared shortly after I jotted it
down.)

John

Jul 23 '05 #3
In article <11************ **********@l41g 2000cwc.googleg roups.com>,
Go************* *****@gmail.com enlightened us with...

The problem is that I know basic HTML, but I have no idea what to do
without an example. The page I referred to is simply what the final
page might look like, but I don't know how to pass parameters.
Oh, that's easy as pie. Just stick it on the end of the URL after a question
mark as a name=value pair. Note that you cannot use special characters
without URL encoding them, but a simple image name should not have this
problem, assuming it doesn't have spaces in it.

<a href="someUrlTh atTakesAnImageP aram.html?image Src=someImage.g if">link</a>

What do you consider the easiest method to learn,


Depends. Ever coded before?
Also depends on what is available.

If you need help, I've coded in all the major ones (perl, PHP, JSP, servlets,
cold fusion, ASP [vbscrip/jscript], and ASP.net[C#, VB, and C++]). I'm sure I
could whip up a simple script to load an image based on the input param for
any of them.

The easiest for something this simple is PHP. That would be as simple as
<?php
$imgSrc = $HTTP_GET_VARS["imgSrc"];
if ($imgSrc == "") $imgSrc="defaul tImg.jpg";
echo "<img src='" . $imgSrc . "'>";
?>

That would write out
<img src='defaultImg .jpg'>
or
<img src='someImage. gif'>
depending on what was passed.

If you wanted to get really fancy, you could check that the file existed
before writing it. :)

--
--
~kaeli~
Hey, if you got it flaunt it! If you don't, stare at
someone who does. Just don't lick the TV screen, it leaves
streaks.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #4
I would love some help, since you ask.

Literally, I pretty much just know the basic HTML (or you could say
that I know the BASIC html, since my current ability is writing a basic
program to create all the similar HTML pages, but that's a
space-intensive method of writing pages.

My "template" of the HTML file has a few occurrences of "@name@" which
my BASIC program then just substitutes the name, either as part of the
text, or as part of the file name.

Here is a stripped down version of that template. Perhaps looking at it
will give you an idea of what to recommend.

< sample HTML file >

<HTML>
<HEAD><TITLE>Go d Loves @name@, a solvable puzzle personalized with
@name@'s name</title>
</head>
<BODY><CENTER >
<Table width=99%>
<TR valign=top>
<TD width=170 align=center>
<!-- assorted HTML for left column -->
</td>
<TD align=center>
<!-- center column, some HTML deleted -->
<h1>God Loves @name@<small><s mall><small><sm all><BR>
Look for <a href="../god-loves-name.htm"><B>Yo ur Name</b></a> (we now
have over thirty thousand names to choose
from)</small></small></small></small>
</h1>
<img src="@name@.gif ">
</td>
<td width=170 align=center>
<!-- assorted HTML for right column -->
</td>
</tr>
</table>
<font color=#FF4400 size=5>Scroll down<small> <small>to see a
<B>LARGE</B> copy of this actual</small> </small>solvable maze</font>
<!-- assorted HTML deleted for readability -->
<h1>God Loves @name@</h1>
<!-- assorted HTML deleted -->
You can solve this maze many times. Just mark new entrances and exits,
and solve it again.
<P>
<img src="@name@.gif " width="100%"><f ont face="Arial" size=2><BR>
This is an actual solvable maze. There is exactly one solution leading
from entrance to exit.<BR>
No matter where you start, no matter where you finish, there will be
exactly one answer.
<!-- assorted HTML for left column -->
</center>
</body>
</html>

< / sample HTML file >

By the way, if you have some puzzle lovers in your family, I'll be glad
to make you some personalized mazes as a thank you for your advice. For
example, "KAELI IS AMAZING" but with the names and messages of your
choice.

John

Jul 23 '05 #5
In article <11************ **********@g14g 2000cwa.googleg roups.com>,
Go************* *****@gmail.com enlightened us with...

My "template" of the HTML file has a few occurrences of "@name@" which
my BASIC program then just substitutes the name, either as part of the
text, or as part of the file name.

This is dynamic HTML, as in each request to the server generates a unique
page? Or is it a template system that you run when you need to in order to
generate static HTML pages?

I didn't know BASIC was still around, other than in VB form...
<img src="@name@.gif ">


Where does @name@ come from?
Is it passed into your BASIC program?

And is this stuff meant to run on the internet, or on a CD?

--
--
~kaeli~
If a turtle doesn't have a shell, is he homeless or naked?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #6
Yes, old BASIC is still around, and still preferred by some of us. I
use QBX 7.1 (Quick Basic Extended Professional) and like it better than
VB because it is quite a bit faster and because the ability to step
through the execution one line at a time and watch the values change
without having to go to a different window and execute statements.

Right now, I'm using my own program to generate static HTML pages. I
created a "template" of what I wanted each page to look like, then used
BASIC to create all the static pages. You can see what I mean if you
glance at www.GodLovesEveryone.org/a/arleen.htm, ...org/b/bill.htm, and
....org/c/charles.htm

The "@name@" was just my text string so that I could have BASIC search
for that string and substitute the actual name.

I'm actually wanting to create something that lets people find these
puzzles on the Internet. I'm basically giving the puzzles away, but
hoping to eventually make money by receiving donations, getting people
to use my links, and maybe even eventually sell some products if I ever
find a way to do it without having to create the products one at a time
(which is why I don't use CafePress.com, the only such site I've found
so far).

The problem as you know with the HTML solution is that it takes
hundreds of megabytes of storage space to actually store the pages, so
I was hoping to find some kind of dynamic solution, one that would
allow one HTML or similar page to handle the coding part of the page.

I'm not wed to the actual pages in question. If you have some ideas
that would let me load the images on request without using lots of
space, I'd love to hear it. The only reason I don't just load the image
in a new browser is because I wanted to load an enlarged image. If you
go to www.GodLovesEveryone.org/j/john.htm you'll see that it displays
the image twice, once at regular size, and once enlarged to the full
size of the window. (Or is there a way I can do that with <a
href="imagename .gif" width="100%"> for example (I'm doubting that
example would work, I just throw it out as a sample).)

John

P.S. I'm in process of uploading the pages, if your first name starts
with A-K, the html page should load your name ...
www.GodLovesEveryone.org/j/john.htm

If you get a page not found, your name will load if you load
www.GodLovesEveryone.org/j/john.gif, just changing j and john to the
appropriate initial and letter.

(it's slow uploading ... I'm on a dial-up connection ... I'm in rural
Arkansas with no broadband connections available unless I want to spend
lots of money per month and right now, my budget can't even afford the
$100 a month it would take to do satellite internet.)

Jul 23 '05 #7
In article <11************ **********@o13g 2000cwo.googleg roups.com>,
Go************* *****@gmail.com enlightened us with...
Yes, old BASIC is still around, and still preferred by some of us. I
use QBX 7.1 (Quick Basic Extended Professional) and like it better than
VB because it is quite a bit faster and because the ability to step
through the execution one line at a time and watch the values change
without having to go to a different window and execute statements.

You can do that with VB...if you use Visual Studio / VS.NET.
I do it all the time. You can set watches, breakpoints, and everything, too.
I mostly use C# for .NET, but I've done some dabbling with VB6. Not that I do
overmuch with C#, either, but I like to putz with new stuff. On the job, I
use Java / J2EE.
Right now, I'm using my own program to generate static HTML pages. I
created a "template" of what I wanted each page to look like, then used
BASIC to create all the static pages.
Okay, what you want can't really be done with static pages unless you do it
with javascript. Since you DO code, you might as well pick up a new server-
side scripting language (less hassle than javascript, since you won't have to
worry about browser support etc). Hosts don't tend to support .NET for free,
so you're probably limited to Perl CGI and/or PHP. Check with your host to
see what they allow and I'll walk you through how to make your pages dynamic
instead of static. That will save a ton of space for you, too.

The "@name@" was just my text string so that I could have BASIC search
for that string and substitute the actual name.
That's what I thought.

The problem as you know with the HTML solution is that it takes
hundreds of megabytes of storage space to actually store the pages, so
I was hoping to find some kind of dynamic solution, one that would
allow one HTML or similar page to handle the coding part of the page.

Yeah, that's what I'm talking about.
BASIC can't do server-side scripting as far as I know. I've never heard of it
being able to. I suppose if you had your own web server set up you could
configure it to (as a cgi-bin executable), but most hosts don't let you dick
around THAT much.
It's always good to learn new things, anyway. :)
I'm not wed to the actual pages in question. If you have some ideas
that would let me load the images on request without using lots of
space, I'd love to hear it.
Sure. Just find out what your hosts allows and I'll show you how to make that
stuff dynamic. People can even enter their own name and it will generate a
page just for them.
Or is there a way I can do that with <a
href="imagename .gif" width="100%"> for example (I'm doubting that
example would work, I just throw it out as a sample).)
You can do that. You can set image sizes to whatever you want.
But don't compress your images as lossy (jpg) if you're going to do that or
the enlarged ones will look awful. I see you use gif, so that should be fine.
A .png might be even better, but I'm not sure of browser support for that
image type. I know my Firefox and MSIE6 do fine with it, but I'm not sure for
other browsers (safari, konqueror, etc).

(it's slow uploading ... I'm on a dial-up connection ... I'm in rural
Arkansas with no broadband connections available unless I want to spend
lots of money per month and right now, my budget can't even afford the
$100 a month it would take to do satellite internet.)


$100 a month!!
Yikes. And I complain about the $40 a month for my broadband...

--
--
~kaeli~
Why do people who know the least know it the loudest?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #8
I'm going to call my support person to ask if they support PHP (I'm
guessing it was one of the acronyms he told me about six months ago
when I moved my pages to his server).

Meanwhile, based on what you've been saying, I've mocked up some ideas
and wanted to bounce them off you:
<a href="someUrl.h tml?imageSrc=so meImage.gif">li nk</a>
I'm assuming this can be in any subdirectory on the page, not just in
the root directory.
The easiest for something this simple is PHP. That would be as simple as <?php
$imgSrc = $HTTP_GET_VARS["imgSrc"];
if ($imgSrc == "") $imgSrc="defaul tImg.jpg";
echo "<img src='" . $imgSrc . "'>";
?>
Does PHP remember the values from one PHP string to the next? Can I do
this in the heading?

<HEAD><TITLE>Go d Loves
<?php
$name = $HTTP_GET_VARS["name"];
if ($name == "") $name="John";
echo $name;
?>, a solvable puzzle personalized with <?php echo $name; ?>'s
name</title>
</head>

then have these snippets of code in different places in the body:

<h1>God Loves <?php echo $name; ?></h1>

<img src="<?php echo $name; ?>.gif">

<h1>God Loves <?php echo $name; ?></h1>

<img src="<?php echo $name; ?>.gif" width="100%">

Or do I need to do the name-retrieval each place?
If you wanted to get really fancy, you could check that
the file existed before writing it. :)


How would I do that?

Thanks for all the help, and now that I've done the research, I'll have
to contact Brent and hope I haven't wasted your time.

John

Jul 23 '05 #9
> People can even enter their own name and it will generate a
page just for them.
Hi, Kaeli,

I'd love to know how to do that also.
$100 a month!!
Yikes. And I complain about the $40 a month for my broadband...


You don't know the worst of it. I have to pay extra on my telephone
bill in order to even get unlimited calls to my dialup, and that's only
for certain communities served by our phone company. When I had an
office in a town served by the local "ma bell", I had an actual local
phone number for my ISP, but now that I'm working at home, I can't even
call his ISP # because that town five miles away is long distance with
no unlimited calling option. Instead, I pay $12.70 per month to get
sixty minutes to that town and unlimited dialing to a few other towns
further away.

Fortunately, they do have "call forward busy" so when I'm online, my
calls route over to my mother's phone number, which I have an extension
of in my house, so I don't miss calls. (She's 83 ... before my dad
died, he asked me to move to the house near her so I'd be around to
help when she needed a hand).

John

Jul 23 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2341
by: Mark Horton | last post by:
I thought would be a super simple project, but I was wrong. I need Help!!!! I am using the Word.Application.Mailmerge.OpenDataSource to try and send a Dynamic Query to my stated Document.Open File. For the life of me I cannot fiqure out how to pass a parameter from this code to the "Proposal" Query in the Access Front End. If I do not add the param variable then everthing works fine except that it pulls all of the matching records...
9
11356
by: Martoon | last post by:
I want to instantiate an STL map with my own compare function, and I want to pass a parameter to the compare function that will be stored and used for all comparisons in that map instance. As an example, let's say the map key is char* strings, and I want the comparison based on the nth character in the string. When the map is instantiated, I need to somehow specify n. So I might have something like this: class MyClass
2
20428
by: Dud Bug | last post by:
I have a query in an Access db that prompts the user for info. (e.g. a primary key representing a company) before compiling the relevant table of results. This works fine in Access but I want to use this query from within VB.Net. But how do I, in code, pass a parameter to the Access query?
2
2003
by: indhu | last post by:
hi all, Any idea of how to pass image value to shape. i ve 10 image boxes with differnt color gif associated to each image box. when i click image that color has to reflect in shape. pls help me in this. thanks in advance
3
2410
by: Angus | last post by:
I have a program which when downloaded from a server downloads another program from the same web server and then configures the downloaded program. The trouble is I have to hard code in the program the URL to download the other program from. So I need to work out how I can do the same thing without having a hard coded URL in the file. It is an executable generated from a C compiler so I don't want customers to have to edit a C source...
3
7335
by: John Dalberg | last post by:
I have seen examples for List<T>.FindAll(findthis)where findthis is a predicate. How do I pass a parameter to this predicate so that I have different values to search for? I don't want to use global variables.
13
12815
polymorphic
by: polymorphic | last post by:
I need to pass a parameter to an executable either via URL or link or script or whatever but nothing is working. The .exe is: \\CL001\Mart\OP2\Test1.exe The parameter is: '\\CL001\mart\op2\Test' A direct type of this in the URL works: \\CL001\Mart\OP2\Test1.exe /p '\\CL001\mart\op2\Test'
2
8501
by: | last post by:
I have a gridview with a textbox in an ItemTemplate, as below. The OnTextChanged event fires okay but how do I pass a parameter to it, I get an error when I try "OnTextChanged(""SomeData"")". I would also like to pass in the value of column 1. I would also like to be able to get the row the user is on when this event fires. Thank you for your help. <asp:GridView ID="gv" /> <Columns> <asp:BoundField DataField="Col1"...
6
2065
by: Max | last post by:
i have a event bind function like this(though it is not so robust): bind$=function(o,evt,fn,cb){ var aE='attachEvent'; var aEL='addEventListener'; if(!o&&o){ return o(evt,fn,!!cb); } return o('on'+evt,fn); };
1
9330
by: Jorge | last post by:
On Oct 23, 10:36 am, Tuxedo <tux...@mailinator.comwrote: Yes: function first_function (PARAMETER) { preload_image = new Image(800,600); preload_image.onload = function () { photo_preloaded(PARAMETER); }; preload_image.src = 'images/photo.jpg'; }
0
7885
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8380
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8031
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8258
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
3881
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3923
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2399
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1493
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1231
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.