473,399 Members | 2,858 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

$_GET variables into <a href> tags

The1corrupted
134 100+
Alright, I know this is basic but I can't figure it out. Whenever I try to make a $_GET variable into a link like this:
Expand|Select|Wrap|Line Numbers
  1. <a href='php?command=quit'>
  2.  
the browser reads it as a separate page. I'm stuck.
Apr 1 '07 #1
6 12179
ronverdonk
4,258 Expert 4TB
Alright, I know this is basic but I can't figure it out. Whenever I try to make a $_GET variable into a link like this:
Expand|Select|Wrap|Line Numbers
  1. <a href='php?command=quit'>
  2.  
the browser reads it as a separate page. I'm stuck.
Úsually the href <a> tag is used to pass control to the in 'href' specified script, along with the specified (GET) parameter, after that link has been clicked. So this statement
[html]<a href='myscript.php?command=quit'>Click me!</a>[/html]
displays the text 'Click me!' on the screen. When clicked control is passed to program myscript.php with the GET parameter command=quit.

Ronald :cool:
Apr 1 '07 #2
The1corrupted
134 100+
Úsually the href <a> tag is used to pass control to the in 'href' specified script, along with the specified (GET) parameter, after that link has been clicked. So this statement
[html]<a href='myscript.php?command=quit'>Click me!</a>[/html]
displays the text 'Click me!' on the screen. When clicked control is passed to program myscript.php with the GET parameter command=quit.

Ronald :cool:
Aha! Now it works. Thanks!
Apr 1 '07 #3
ronverdonk
4,258 Expert 4TB
You are welcome.

Ronald :cool:
Apr 1 '07 #4
Jekyl1
3
Hi, This is along the same lines so I thought I'd post my question here.
Keep in mind, I have NO idea what I'm doing with PHP. I am taking over managing a website that was built by someone else.

So, on one page, index.php, there are small thumbnail images. These all have links like:

[PHP]href="viewpic.php?image=7[/PHP]

I understand that when clicked, this link will go to the page "viewpic.php" and try to display the image with the variable value of 7.

On the viewpic.php page, in the </head> section there is this code:

[PHP]<?php
$url = "http://www.mandykaplan.com/images/headshots/small/mandy0";
$file = ".jpg";
$loc = "$url$image$file";
?>[/PHP]

and then, down on the page, where the image should be displayed is this:

[PHP]<img src="<?PHP print($loc);?>" name="<?PHP print($query);?>" width="32" height="32"> [/PHP]

However, the viewpic.php page only shows a broken image placeholder. :-(
I guess my question is how do I assign variable values to things like image files?
And, shouldn't this code work properly?

Thank you!
Apr 28 '07 #5
The1corrupted
134 100+
Hi, This is along the same lines so I thought I'd post my question here.
Keep in mind, I have NO idea what I'm doing with PHP. I am taking over managing a website that was built by someone else.

So, on one page, index.php, there are small thumbnail images. These all have links like:

[PHP]href="viewpic.php?image=7[/PHP]

I understand that when clicked, this link will go to the page "viewpic.php" and try to display the image with the variable value of 7.

On the viewpic.php page, in the </head> section there is this code:

[PHP]<?php
$url = "http://www.mandykaplan.com/images/headshots/small/mandy0";
$file = ".jpg";
$loc = "$url$image$file";
?>[/PHP]

and then, down on the page, where the image should be displayed is this:

[PHP]<img src="<?PHP print($loc);?>" name="<?PHP print($query);?>" width="32" height="32"> [/PHP]

However, the viewpic.php page only shows a broken image placeholder. :-(
I guess my question is how do I assign variable values to things like image files?
And, shouldn't this code work properly?

Thank you!
Actually, you should make it all one base page and not separate pages. Therefore, you run a little script that's a case statement like so

[php]
switch ("image") {
case 7:
echo "Do this";
break;
}
[/php]

Then all you have to do is make an onclick function in javascript to make image=7 then transfer it to php.
Apr 29 '07 #6
Jekyl1
3
While that sounds dandy, you need to talk to me like I'm a 3 year old.
Seriously.
Pretend I'm a little baby and walk me through it step by step. (If you have the time, of course.)

Things like, "make an onclick function in javascript... then transfer it to php," mean almost nothing to me.

Thank you very very very much for your time. I really appreciate it.
May 1 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Gregor Horvath | last post by:
Hi, Before I reinvent the wheel I`d like to ask if someone has done this before since I did not find an advice at Google. The goal is to create a dynamic Tree View in HTML. Say I have a...
2
by: Eshrath | last post by:
Hi, What I am trying to do: ======================= I need to form a table in html using the xsl but the table that is formed is quite long and cannot be viewed in our application. So we are...
2
by: Donald Firesmith | last post by:
I am having trouble having Google Adsense code stored in XSL converted properly into HTML. The <> unfortunately become &lt; and &gt; and then no longer work. XSL code is: <script...
6
by: snacktime | last post by:
I've searched and searched and have not found a solution to suppress the margin on form or href tags so that there is no space before or after the tag. The only way I have found to do this is to...
13
by: tperri | last post by:
I have an HTML table with several fields like this: <A href="Savings.aspx?category=Food"><asp:imagebutton id="imgFood" ImageUrl="images\buttons\btn-food-i.gif"...
1
by: John | last post by:
Hi var poster="<html><head..... etc .... </html>"; var animal='dog'; The string contains images and text that changes. Originally I wanted to do something like print "<a href=" +...
3
by: ajay2552 | last post by:
Hi, I have a query. All html tags start with < and end with >. Suppose i want to display either '<' or '>' or say some text like '<Company>' in html how do i do it? One method is to use &lt,...
2
by: FFMG | last post by:
Hi, I run a blog hosting site and it is a fairly small community easy enough to police. But some spammers still find ways to get in. What I was thinking is adding nofollow tags to their links...
8
by: Prisoner at War | last post by:
Another weekend, another project, another problem.... Why should a perfectly fine function work only half-way through when called through onClick in an anchor tag?? The text fade-in script...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.