473,486 Members | 2,277 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Passing a parameter in PHP


Hi All,

I am writing some screen strictly in PHP. I have a screen with a
combo box in it. I do not want to use forms, just links on the page.

What I want to do, is when the user selects the value from the combo
box, and clicks on the link, I want the value in the combo box to be
passed as a parameter to another PHP page, and be used in that page.

I really want to avoid forms and the whole GET/POST stuff.

Is there any way to do this? Javascript maybe? I'm terrible at
Javascript, so if this is the way, if you could include and example,
I'd greatly appreciate it.

Thanks!

Sep 4 '07 #1
10 2136
am****@iwc.net wrote:
Hi All,

I am writing some screen strictly in PHP. I have a screen with a
combo box in it. I do not want to use forms, just links on the page.

What I want to do, is when the user selects the value from the combo
box, and clicks on the link, I want the value in the combo box to be
passed as a parameter to another PHP page, and be used in that page.
Well, you should rewrite all <a href=""in your page on the fly if the
value in the box is changed.
Add the comboboxselection to the current URL.
But you said you suck at javascript, so this maight be over your head.
(read on)
I really want to avoid forms and the whole GET/POST stuff.

Is there any way to do this? Javascript maybe? I'm terrible at
Javascript, so if this is the way, if you could include and example,
I'd greatly appreciate it.
Maybe you could set a cookie when the combobox is changed that holds the
value of the element choosen.
You do not have to refresh the page or anything, just set a cookie.

Cookies are send to PHP on each request.
eg:

<?php
// cookie received for combobox?
if (isset($_COOKIE["mycombobox"])){
// do stuff with the value in $_COOKIE["mycombobox"]
}
?>

Maybe that helps.

Personally, if I see a combobox (or any formelement) without a
submitbutton, I will be confused.
Are you sure you want this?

Regards,
Erwin Moller
>
Thanks!
Sep 4 '07 #2
On Sep 4, 11:25 am, Erwin Moller
<Since_humans_read_this_I_am_spammed_too_m...@spam yourself.comwrote:
ame...@iwc.net wrote:
Hi All,
I am writing some screen strictly in PHP. I have a screen with a
combo box in it. I do not want to use forms, just links on the page.
What I want to do, is when the user selects the value from the combo
box, and clicks on the link, I want the value in the combo box to be
passed as a parameter to another PHP page, and be used in that page.

Well, you should rewrite all <a href=""in your page on the fly if the
value in the box is changed.
Add the comboboxselection to the current URL.
But you said you suck at javascript, so this maight be over your head.
(read on)
I really want to avoid forms and the whole GET/POST stuff.
Is there any way to do this? Javascript maybe? I'm terrible at
Javascript, so if this is the way, if you could include and example,
I'd greatly appreciate it.

Maybe you could set a cookie when the combobox is changed that holds the
value of the element choosen.
You do not have to refresh the page or anything, just set a cookie.

Cookies are send to PHP on each request.
eg:

<?php
// cookie received for combobox?
if (isset($_COOKIE["mycombobox"])){
// do stuff with the value in $_COOKIE["mycombobox"]
}
?>

Maybe that helps.

Personally, if I see a combobox (or any formelement) without a
submitbutton, I will be confused.
Are you sure you want this?

Regards,
Erwin Moller
Thanks!
Well, the reason I do not want to use a form and submit and all is
because I am using styles to make the limk 'pretty' and such with
colors and all.......so, if I use a form, I have to use the boring
standard grey buttons.
Sep 4 '07 #3
On Sep 4, 11:36 am, "ame...@iwc.net" <ame...@iwc.netwrote:
On Sep 4, 11:25 am, Erwin Moller

<Since_humans_read_this_I_am_spammed_too_m...@spam yourself.comwrote:
ame...@iwc.net wrote:
Hi All,
I am writing some screen strictly in PHP. I have a screen with a
combo box in it. I do not want to use forms, just links on the page.
What I want to do, is when the user selects the value from the combo
box, and clicks on the link, I want the value in the combo box to be
passed as a parameter to another PHP page, and be used in that page.
Well, you should rewrite all <a href=""in your page on the fly if the
value in the box is changed.
Add the comboboxselection to the current URL.
But you said you suck at javascript, so this maight be over your head.
(read on)
I really want to avoid forms and the whole GET/POST stuff.
Is there any way to do this? Javascript maybe? I'm terrible at
Javascript, so if this is the way, if you could include and example,
I'd greatly appreciate it.
Maybe you could set a cookie when the combobox is changed that holds the
value of the element choosen.
You do not have to refresh the page or anything, just set a cookie.
Cookies are send to PHP on each request.
eg:
<?php
// cookie received for combobox?
if (isset($_COOKIE["mycombobox"])){
// do stuff with the value in $_COOKIE["mycombobox"]
}
?>
Maybe that helps.
Personally, if I see a combobox (or any formelement) without a
submitbutton, I will be confused.
Are you sure you want this?
Regards,
Erwin Moller
Thanks!

Well, the reason I do not want to use a form and submit and all is
because I am using styles to make the limk 'pretty' and such with
colors and all.......so, if I use a form, I have to use the boring
standard grey buttons.
And I might add, that there are several links on this page. Each
needing the value of the combo box. So, I was hoping I can use
something with the $_SESSION technique.....
Sep 4 '07 #4
am****@iwc.net wrote:
On Sep 4, 11:36 am, "ame...@iwc.net" <ame...@iwc.netwrote:
>On Sep 4, 11:25 am, Erwin Moller

<Since_humans_read_this_I_am_spammed_too_m...@spa myourself.comwrote:
>>ame...@iwc.net wrote:
Hi All,
I am writing some screen strictly in PHP. I have a screen with a
combo box in it. I do not want to use forms, just links on the page.
What I want to do, is when the user selects the value from the combo
box, and clicks on the link, I want the value in the combo box to be
passed as a parameter to another PHP page, and be used in that page.
Well, you should rewrite all <a href=""in your page on the fly if the
value in the box is changed.
Add the comboboxselection to the current URL.
But you said you suck at javascript, so this maight be over your head.
(read on)
I really want to avoid forms and the whole GET/POST stuff.
Is there any way to do this? Javascript maybe? I'm terrible at
Javascript, so if this is the way, if you could include and example,
I'd greatly appreciate it.
Maybe you could set a cookie when the combobox is changed that holds the
value of the element choosen.
You do not have to refresh the page or anything, just set a cookie.
Cookies are send to PHP on each request.
eg:
<?php
// cookie received for combobox?
if (isset($_COOKIE["mycombobox"])){
// do stuff with the value in $_COOKIE["mycombobox"]
}
?>
Maybe that helps.
Personally, if I see a combobox (or any formelement) without a
submitbutton, I will be confused.
Are you sure you want this?
Regards,
Erwin Moller
Thanks!
Well, the reason I do not want to use a form and submit and all is
because I am using styles to make the limk 'pretty' and such with
colors and all.......so, if I use a form, I have to use the boring
standard grey buttons.

And I might add, that there are several links on this page. Each
needing the value of the combo box. So, I was hoping I can use
something with the $_SESSION technique.....

Yes, you could use an Ajaxoid approach to set the value of the combobox
into a session. It is easy.

But what happened with my cookie suggestion?
Don't you like cookies?

Erwin Moller
Sep 4 '07 #5
On Sep 4, 11:41 am, Erwin Moller
<Since_humans_read_this_I_am_spammed_too_m...@spam yourself.comwrote:
ame...@iwc.net wrote:
On Sep 4, 11:36 am, "ame...@iwc.net" <ame...@iwc.netwrote:
On Sep 4, 11:25 am, Erwin Moller
<Since_humans_read_this_I_am_spammed_too_m...@spam yourself.comwrote:
ame...@iwc.net wrote:
Hi All,
I am writing some screen strictly in PHP. I have a screen with a
combo box in it. I do not want to use forms, just links on the page.
What I want to do, is when the user selects the value from the combo
box, and clicks on the link, I want the value in the combo box to be
passed as a parameter to another PHP page, and be used in that page.
Well, you should rewrite all <a href=""in your page on the fly if the
value in the box is changed.
Add the comboboxselection to the current URL.
But you said you suck at javascript, so this maight be over your head.
(read on)
I really want to avoid forms and the whole GET/POST stuff.
Is there any way to do this? Javascript maybe? I'm terrible at
Javascript, so if this is the way, if you could include and example,
I'd greatly appreciate it.
Maybe you could set a cookie when the combobox is changed that holds the
value of the element choosen.
You do not have to refresh the page or anything, just set a cookie.
Cookies are send to PHP on each request.
eg:
<?php
// cookie received for combobox?
if (isset($_COOKIE["mycombobox"])){
// do stuff with the value in $_COOKIE["mycombobox"]
}
?>
Maybe that helps.
Personally, if I see a combobox (or any formelement) without a
submitbutton, I will be confused.
Are you sure you want this?
Regards,
Erwin Moller
Thanks!
Well, the reason I do not want to use a form and submit and all is
because I am using styles to make the limk 'pretty' and such with
colors and all.......so, if I use a form, I have to use the boring
standard grey buttons.
And I might add, that there are several links on this page. Each
needing the value of the combo box. So, I was hoping I can use
something with the $_SESSION technique.....

Yes, you could use an Ajaxoid approach to set the value of the combobox
into a session. It is easy.

But what happened with my cookie suggestion?
Don't you like cookies?

Erwin Moller
I'm not really sure how that works. Is the cookie set when the user
clicks the link to go to the next page? How do I refer to the
variable(s) on the next page?
Sep 4 '07 #6
am****@iwc.net wrote:
On Sep 4, 11:41 am, Erwin Moller
<Since_humans_read_this_I_am_spammed_too_m...@spam yourself.comwrote:
>ame...@iwc.net wrote:
>>On Sep 4, 11:36 am, "ame...@iwc.net" <ame...@iwc.netwrote:
On Sep 4, 11:25 am, Erwin Moller
<Since_humans_read_this_I_am_spammed_too_m...@s pamyourself.comwrote:
ame...@iwc.net wrote:
>Hi All,
>I am writing some screen strictly in PHP. I have a screen with a
>combo box in it. I do not want to use forms, just links on the page.
>What I want to do, is when the user selects the value from the combo
>box, and clicks on the link, I want the value in the combo box to be
>passed as a parameter to another PHP page, and be used in that page.
Well, you should rewrite all <a href=""in your page on the fly if the
value in the box is changed.
Add the comboboxselection to the current URL.
But you said you suck at javascript, so this maight be over your head.
(read on)
>I really want to avoid forms and the whole GET/POST stuff.
>Is there any way to do this? Javascript maybe? I'm terrible at
>Javascript, so if this is the way, if you could include and example,
>I'd greatly appreciate it.
Maybe you could set a cookie when the combobox is changed that holds the
value of the element choosen.
You do not have to refresh the page or anything, just set a cookie.
Cookies are send to PHP on each request.
eg:
<?php
// cookie received for combobox?
if (isset($_COOKIE["mycombobox"])){
// do stuff with the value in $_COOKIE["mycombobox"]
}
?>
Maybe that helps.
Personally, if I see a combobox (or any formelement) without a
submitbutton, I will be confused.
Are you sure you want this?
Regards,
Erwin Moller
>Thanks!
Well, the reason I do not want to use a form and submit and all is
because I am using styles to make the limk 'pretty' and such with
colors and all.......so, if I use a form, I have to use the boring
standard grey buttons.
And I might add, that there are several links on this page. Each
needing the value of the combo box. So, I was hoping I can use
something with the $_SESSION technique.....
Yes, you could use an Ajaxoid approach to set the value of the combobox
into a session. It is easy.

But what happened with my cookie suggestion?
Don't you like cookies?

Erwin Moller
Hi,
I'm not really sure how that works. Is the cookie set when the user
clicks the link to go to the next page?
No, you set the cookie immediately when the user changes the value of
the selectbox.
Use the onChange event handler on your combobox.
When it changes you use the selectedIndex property of the combobox to
find the current index, which in turn you can use to get the
corresponding value.

If you want to learn more, go to google and search for 'javascript
cookie tutorial', and you'll find sites like:

http://www.elated.com/articles/javascript-and-cookies/

and

http://www.echoecho.com/jscookies.htm

How do I refer to the
variable(s) on the next page?
Javascript can read the cookie value. Also on the next page.
Check the tutorials.

Regards,
Erwin Moller
Sep 4 '07 #7
am****@iwc.net wrote:
On Sep 4, 11:25 am, Erwin Moller
<Since_humans_read_this_I_am_spammed_too_m...@spam yourself.comwrote:
>ame...@iwc.net wrote:
>>Hi All,
I am writing some screen strictly in PHP. I have a screen with a
combo box in it. I do not want to use forms, just links on the page.
What I want to do, is when the user selects the value from the combo
box, and clicks on the link, I want the value in the combo box to be
passed as a parameter to another PHP page, and be used in that page.
Well, you should rewrite all <a href=""in your page on the fly if the
value in the box is changed.
Add the comboboxselection to the current URL.
But you said you suck at javascript, so this maight be over your head.
(read on)
>>I really want to avoid forms and the whole GET/POST stuff.
Is there any way to do this? Javascript maybe? I'm terrible at
Javascript, so if this is the way, if you could include and example,
I'd greatly appreciate it.
Maybe you could set a cookie when the combobox is changed that holds the
value of the element choosen.
You do not have to refresh the page or anything, just set a cookie.

Cookies are send to PHP on each request.
eg:

<?php
// cookie received for combobox?
if (isset($_COOKIE["mycombobox"])){
// do stuff with the value in $_COOKIE["mycombobox"]
}
?>

Maybe that helps.

Personally, if I see a combobox (or any formelement) without a
submitbutton, I will be confused.
Are you sure you want this?

Regards,
Erwin Moller
>>Thanks!

Well, the reason I do not want to use a form and submit and all is
because I am using styles to make the limk 'pretty' and such with
colors and all.......so, if I use a form, I have to use the boring
standard grey buttons.

NO YOU DON"T

see my example.

Create your own buttons with graphics, and encapsulate them with an
onclick..submit type slim javascript, or use URLs..

The FORM method is needed to allow submit() to pass stuff back, or at
least it's the easy way. You do NOT have to use the input elements tho.

I use mixture, TEXTAREA is hard to code otherwise, TEXTS look fine,
buttons look awful and are replaced, and FILE types are almost
impossible to style. although I did see a neat method posted up ..you
make them invisible and exactly superimpose a different element over the
top. you THINK you are clicking on that, but actually you are clicking
on a standard box underneath.
Sep 4 '07 #8
Erwin Moller wrote:
am****@iwc.net wrote:
>On Sep 4, 11:36 am, "ame...@iwc.net" <ame...@iwc.netwrote:
>>On Sep 4, 11:25 am, Erwin Moller

<Since_humans_read_this_I_am_spammed_too_m...@sp amyourself.comwrote:
ame...@iwc.net wrote:
Hi All,
I am writing some screen strictly in PHP. I have a screen with a
combo box in it. I do not want to use forms, just links on the page.
What I want to do, is when the user selects the value from the combo
box, and clicks on the link, I want the value in the combo box to be
passed as a parameter to another PHP page, and be used in that page.
Well, you should rewrite all <a href=""in your page on the fly if the
value in the box is changed.
Add the comboboxselection to the current URL.
But you said you suck at javascript, so this maight be over your head.
(read on)
I really want to avoid forms and the whole GET/POST stuff.
Is there any way to do this? Javascript maybe? I'm terrible at
Javascript, so if this is the way, if you could include and example,
I'd greatly appreciate it.
Maybe you could set a cookie when the combobox is changed that holds
the
value of the element choosen.
You do not have to refresh the page or anything, just set a cookie.
Cookies are send to PHP on each request.
eg:
<?php
// cookie received for combobox?
if (isset($_COOKIE["mycombobox"])){
// do stuff with the value in $_COOKIE["mycombobox"]
}
?>
Maybe that helps.
Personally, if I see a combobox (or any formelement) without a
submitbutton, I will be confused.
Are you sure you want this?
Regards,
Erwin Moller
Thanks!
Well, the reason I do not want to use a form and submit and all is
because I am using styles to make the limk 'pretty' and such with
colors and all.......so, if I use a form, I have to use the boring
standard grey buttons.

And I might add, that there are several links on this page. Each
needing the value of the combo box. So, I was hoping I can use
something with the $_SESSION technique.....


Yes, you could use an Ajaxoid approach to set the value of the combobox
into a session. It is easy.

But what happened with my cookie suggestion?
Don't you like cookies?
Cookies make you fat.

Why is your name familiar? ISTR it from many years ago in a different
Usenet context entirely..
Erwin Moller
Sep 4 '07 #9
The Natural Philosopher wrote:
Erwin Moller wrote:
>am****@iwc.net wrote:
>>On Sep 4, 11:36 am, "ame...@iwc.net" <ame...@iwc.netwrote:
On Sep 4, 11:25 am, Erwin Moller

<Since_humans_read_this_I_am_spammed_too_m...@s pamyourself.comwrote:
ame...@iwc.net wrote:
>Hi All,
>I am writing some screen strictly in PHP. I have a screen with a
>combo box in it. I do not want to use forms, just links on the page.
>What I want to do, is when the user selects the value from the combo
>box, and clicks on the link, I want the value in the combo box to be
>passed as a parameter to another PHP page, and be used in that page.
Well, you should rewrite all <a href=""in your page on the fly if
the
value in the box is changed.
Add the comboboxselection to the current URL.
But you said you suck at javascript, so this maight be over your head.
(read on)
>I really want to avoid forms and the whole GET/POST stuff.
>Is there any way to do this? Javascript maybe? I'm terrible at
>Javascript, so if this is the way, if you could include and example,
>I'd greatly appreciate it.
Maybe you could set a cookie when the combobox is changed that
holds the
value of the element choosen.
You do not have to refresh the page or anything, just set a cookie.
Cookies are send to PHP on each request.
eg:
<?php
// cookie received for combobox?
if (isset($_COOKIE["mycombobox"])){
// do stuff with the value in $_COOKIE["mycombobox"]
}
?>
Maybe that helps.
Personally, if I see a combobox (or any formelement) without a
submitbutton, I will be confused.
Are you sure you want this?
Regards,
Erwin Moller
>Thanks!
Well, the reason I do not want to use a form and submit and all is
because I am using styles to make the limk 'pretty' and such with
colors and all.......so, if I use a form, I have to use the boring
standard grey buttons.

And I might add, that there are several links on this page. Each
needing the value of the combo box. So, I was hoping I can use
something with the $_SESSION technique.....


Yes, you could use an Ajaxoid approach to set the value of the
combobox into a session. It is easy.

But what happened with my cookie suggestion?
Don't you like cookies?

Cookies make you fat.
Yup.
I know that is a fact from firsthand experience. ;-)
>
Why is your name familiar? ISTR it from many years ago in a different
Usenet context entirely..
My name? Your name rings a bell too, but that could very well be because
you write in c.l.javascript or c.l.php.
I googled in groups with: "Erwin Moller" "the Natural Philosopher", and
I think we only replied to each other in comp.lang.php and here.
I always posted under my real name as far as I can remember.
Maybe you had a different nick some years ago?

I used to be active in java newsgroups.
Or maybe talk.origins where I used to spread my atheistic gospel. ;-)

Regards,
Erwin Moller
Sep 5 '07 #10
Erwin Moller wrote:
The Natural Philosopher wrote:
>>
Why is your name familiar? ISTR it from many years ago in a different
Usenet context entirely..

My name? Your name rings a bell too, but that could very well be because
you write in c.l.javascript or c.l.php.
I googled in groups with: "Erwin Moller" "the Natural Philosopher", and
I think we only replied to each other in comp.lang.php and here.
I always posted under my real name as far as I can remember.
Maybe you had a different nick some years ago?

I used to be active in java newsgroups.
Or maybe talk.origins where I used to spread my atheistic gospel. ;-)
It was definitely in atheistic contexts, but not talk.origins.

This usenet ID is not that old. Earlier ones got spammed out and were
abandoned.

I won't reveal what they were. Not publically anyway ;-)

Anyway, hi, and enjoyed them enough to remember the name anyway..;-)
Regards,
Erwin Moller
Sep 5 '07 #11

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

Similar topics

3
16918
by: WGW | last post by:
Though I am a novice to MS SQL server (2000 I believe), I can do almost! everything I need. Maybe not efficiently, but usefully. However, I have a problem -- a complex query problem... I can...
5
36373
by: Andy | last post by:
Hi Could someone clarify for me the method parameter passing concept? As I understand it, if you pass a variable without the "ref" syntax then it gets passed as a copy. If you pass a...
6
16247
by: wiredless | last post by:
What is the advantage of passing an interface type? according to UML (visio) when i reverse engineer existing code to a UML diagram I get the error "UMLE00046: sample : - An interface cannot...
11
8089
by: John Pass | last post by:
Hi, In the attached example, I do understand that the references are not changed if an array is passed by Val. What I do not understand is the result of line 99 (If one can find this by line...
2
1551
by: diffuser78 | last post by:
I wrote a small app in wxPython using wxGlade as designer tool. wxGlade brings and writes a lot of code by itself and thats where my confusion started. Its about parameter passing. Here is my...
10
3901
by: amazon | last post by:
Our vender provided us a web service: 1xyztest.xsd file... ------------------------------------ postEvent PostEventRequest ------------------------------------- authetication authentication...
0
1231
by: amazon | last post by:
I have web service that acceping following parameters.. postev.PostEvent(authentication as ws.authentication, name as string,id as string, exdate as date, parameter() as ws.nameparametervaluepair...
7
3284
by: TS | last post by:
I was under the assumption that if you pass an object as a param to a method and inside that method this object is changed, the object will stay changed when returned from the method because the...
12
2554
by: dave_dp | last post by:
Hi, I have just started learning C++ language.. I've read much even tried to understand the way standard says but still can't get the grasp of that concept. When parameters are passed/returned...
4
2803
by: Deckarep | last post by:
Hello fellow C# programmers, This question is more about general practice and convention so here goes: I got into a discussion with a co-worker who insisted that as a general practice all...
0
7105
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,...
0
7132
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,...
0
7180
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...
1
6846
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...
0
7341
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...
0
4564
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3076
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...
0
3071
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
600
muto222
php
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.