473,769 Members | 5,131 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
23 12289
In article <11************ **********@z14g 2000cwz.googleg roups.com>,
Go************* *****@gmail.com enlightened us with...
<%@ LANGUAGE="VBSCR IPT" %>

<% Dim First
Dim FilNam
First = Request.form("f irst")
That's for form submissions (i.e.POST).
You want querystring for ASP URL params.
First = Request.QuerySt ring("first")

I'm guessing that you might be able to help me with passing parameters
with the URL???
Just link like
http://www.godloveseveryone.org/godl...sp?first=kaeli
I also couldn't figure out how to test to see if the
file existed. DIR$ is the function I'm used to, I couldn't find either
it or anything starting with file like in your File_Exists example.

No, for VBScript you want FileSystemObjec t, I believe.
Lemme go look...
Yup.
Set filesys = CreateObject("S cripting.FileSy stemObject")
If filesys.FileExi sts(path) Then
End If

See:
http://msdn.microsoft.com/library/de...stemobject.asp

Note: vbscript syntax and functions are pretty much the same as full VB. Some
minor differences, but nothing that should screw up something this small.
I do appreciate all your help, even all the "wasted time" on PHP helped
me get this one done much faster.

Hey, no problem.
By the way, I didn't think your name was there, but I tested the page
with KAELI and guess what popped up? Hope that's a small thank you.


Thanks. :)

--
--
~kaeli~
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

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

In addition to the page that is "mostly working", I'm trying to work on
a slightly different version to strip out spaces and other
non-dash-non-letter characters from the filename, and possibly display
two mazes if they happen to put in a name with a space, first and all.
A space is not a valid character in the URL. It would be encoded as %20.

BUT I'm getting page not found, and getting no errors at all when I try
to load that particular page. Here is the ASP code if you can see
what's causing the error. I've tried breaking down the statements,
changing OR to +,
VBScript/VB does not support/overload the plus operator (+) for string
concatenation.
It's an ampersand. (&)

You might want to peruse the documentation. It has the operators in there.
http://msdn.microsoft.com/library/de...bscripttoc.asp
First = trim(Request.fo rm("first"))
if First<"A" then First="John"
I'm not sure if this is really what you want.
Many languages will convert this to number comparisons, but VB isn't the
brightest thing I've ever used. You may want to see what other string
functions might do a better job.
It looks like you're trying to make sure the name is an alphabetic string.

Google is my friend. :)

<%
Private Function IsAlpha(byVal string)
dim regExp, match, i, spec
For i = 1 to Len( string )
spec = Mid(string, i, 1)
Set regExp = New RegExp
regExp.Global = True
regExp.IgnoreCa se = True
regExp.Pattern = "[A-Z]|[a-z]|\s|[_]"
set match = regExp.Execute( spec)
If match.count = 0 then
IsAlpha = False
Exit Function
End If
Set regExp = Nothing
Next
IsAlpha = True
End Function

If IsNull(First) Or IsEmpty(First) Or Not IsAlpha(First)
First = "John"
End If
%>
FilNam2 = left(First,1)+"/"+left$(First,i nstr(First+" "," ")-1)+".gif"
Ampersands. Not pluses. And take out the dollar sign.

FilNam2 = left(First,1) & "/"+left(First,in str(First+" "," ")-1) & ".gif"
for i=len(FilNam)-4 to 3 step -1
j=asc(ucase(mid (FilNam,i,1)))
if j<>45 then
if (j<65)+(j>90) then FilNam=left(Fil Nam,i-1)+mid(FilNam,i +1)
end if
What is that supposed to be doing?
next
if FilNam2<>FilNam then
FilNam3="<img src="+chr$(34)+ FilNam2+chr$(34 )+"><P>"
And again, use ampersands.
You've got pluses throughout. Change them all to ampersands.
<Table bgcolor=#ffff77 ">
Unbalanced quote. Will mess things up.
<Table bgcolor="#ffff7 7">

<TR><TD align=center>
<form action="godlove s3.asp" name="form" method="post">
You can just use GET for the method (passes via the URL). Save yourself the
hassle of having to check incoming params of both get and post.

the occurrence of <%=FilNam3%> and 4%> should, most of the time, just
result in a null string, but when the user puts in "JOHN WILLIAM" for
example, it should attempt to load both "JOHN" and "JOHNWILLIA M" .


There will be no space in the actual URL. It will be displayed as %20. I
believe vbscript changes it back to a space for you when you grab the param,
but I am not certain. You'll need to test this.

Good luck with the meeting.

--
--
~kaeli~
He's your God, they're your rules - you burn in Hell.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #22
> VBScript/VB does not support/overload the plus operator (+) for
string
concatenation. It's an ampersand. (&)


Actually, it appears to support it, because I'm using + on the working
"godloves2. asp" page.

<%@ LANGUAGE="VBSCR IPT" %>

<% Dim First, FilNam, FilNam2, i, j
First = trim(Request.fo rm("first"))
if First<"A" or First>"zza" then First="John"
First = ucase(left(Firs t,1))+mid(First ,2)
FilNam = left(First,1)+"/"+First+".g if"
FilNam2 = left$(First,ins tr(First+" "," ")-1)
for i=Len(FilNam)-4 to 3 step -1
j=asc(ucase(mid (FilNam,i,1)))
if j<>45 then if j<65 or j>90 then
FilNam=left(Fil Nam,i-1)+mid(FilNam,i +1)
next
if ucase(First)="C ON" then FilNam="C/Con-.gif"
%>

the above comes from www.GodLovesEveryone.org/godloves2.asp

I'm briefly perusing the rest of your comments before leaving for my
meeting. I won't be testing page "3" until later this afternoon or
evening.

John

Jul 23 '05 #23
In article <11************ *********@l41g2 000cwc.googlegr oups.com>,
Go************* *****@gmail.com enlightened us with...
VBScript/VB does not support/overload the plus operator (+) for

string
concatenation. It's an ampersand. (&)


Actually, it appears to support it, because I'm using + on the working
"godloves2. asp" page.


It won't give an error.
Use the ampersand. Trust me. :)

It was old syntax before they even added support for constants. That was
1996.
"Arithmetic Operators
The arithmetic operators are used with numeric variables and literals and
expressions. (Since VBS at the moment has no constants, they are not an issue
here.) The plus sign (+) can also be used as a string concatenation operator,
but this usage is obsolete and should be used sparingly."

Remember, just because you CAN do something doesn't mean you SHOULD. *heh*
Especially when you're using a non-strongly-typed language. Things tend to
get converted to another data type when you're not looking.

Normal VB is typed, but I'm pretty sure VBS isn't. I think everything is a
Variant in VBS. That can lead to issues.
Are you using ASP classic or ASP.NET? 'Cuz I think they changed a lot between
the two.

--
--
~kaeli~
You feel stuck with your debt if you can't budge it.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #24

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

Similar topics

3
2354
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
11373
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
20457
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
2014
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
2419
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
7349
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
12841
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
8517
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
2075
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
9363
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
9583
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
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
10210
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10039
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...
0
9860
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...
1
7406
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5445
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3955
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
2
3560
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.