473,568 Members | 2,795 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

click a hyperlink to query MYSQL w/PHP - how?

Like so many questions this involves MYSQL and the PHP (or Perl) layer.

I'm going to have html in text fields and there's going to be what
normally would be an internal link to another place in the same
document. But in this case,
Code:

<a href="#futherdo wn">next title</a>

is not in the html document. When a user clicks this link I want to
query the DB and append/render the queried record on the I guess
existing (refreshed) page. What's a strategy to make a hyperlink query
via PHP?

I'm trying to make internal links work "normally" on dynamic page if you
get my drift,
Lee G.
Jul 17 '05 #1
3 5750
leegold2 <le*****@nospam .net> wrote:
<a href="#futherdo wn">next title</a>

is not in the html document. When a user clicks this link I want to
query the DB and append/render the queried record on the I guess
existing (refreshed) page. What's a strategy to make a hyperlink query
via PHP?

I'm trying to make internal links work "normally" on dynamic page if you
get my drift,


This is a clientside issue, so you need clientside tech to accomplish
what you want. The above link in that form is quite useless, use
javascript instead. The main problem is that if the anchor is within the
current URL the browser will not make a request to the server.

--

Daniel Tryba

Jul 17 '05 #2
leegold2 wrote:
Like so many questions this involves MYSQL and the PHP (or Perl) layer.

I'm going to have html in text fields and there's going to be what
normally would be an internal link to another place in the same
document. But in this case,
Code:

<a href="#futherdo wn">next title</a>

is not in the html document. When a user clicks this link I want to
query the DB and append/render the queried record on the I guess
existing (refreshed) page. What's a strategy to make a hyperlink query
via PHP?

I'm trying to make internal links work "normally" on dynamic page if you
get my drift,


You cannot make internal #furtherdown type links on an HTML page do anything
other than move up and down a page which has already been rendered in the
browser.

You need to make a link back to the server, in your case back to the same
page, passing parameters which will get that information into the page eg
foo.php?show=3# section3 - the use of the #section3 bit here is to then jump
the browser down to the appropriate section once the page has loaded.

Another way to do this is a combination of Javascript and CSS (ie DHTML).
You have have all the required content in your page but hidden, and when
they click a link it makes the section you want appear. Of course this
won't work if they have Javascript disabled, or a using a browser that does
not support JS.

An example of this in action is at
http://www.woosh.com/UserInterface/W...erSupport.aspx

Click the little down arrow links to the left of the questions and the
answer appears underneath. Click it again and it disappears.

If the above link is broken in your newsreader use this tinyurl instead
http://tinyurl.com/3qxgt

--
Chris Hope - The Electric Toolbox - http://www.electrictoolbox.com/
Jul 17 '05 #3
Chris Hope wrote:
leegold2 wrote:

......snip...
You cannot make internal #furtherdown type links on an HTML page do anything
other than move up and down a page which has already been rendered in the
browser.

You need to make a link back to the server, in your case back to the same
page, passing parameters which will get that information into the page eg
foo.php?show=3# section3 - the use of the #section3 bit here is to then jump
the browser down to the appropriate section once the page has loaded.


Yes, thanks. That's what I'm going to do. I just learned a lot!

.....snip...
Jul 17 '05 #4

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

Similar topics

4
7521
by: Andreas Meffert | last post by:
Hello, How can I change the Type of a field in a table from Memo to hyperlink? I import a table from Oracle to Access 2003. After that, the field type of some hyperlink-fields is "Memo". How can I schwitch back to Hyperlink via VBA because its boring doing it manually often (I import the table each week for doing updates). When I do it...
5
5853
by: Gamesetal | last post by:
Have '97 and am trying to create a query on the underlying Hyperlink field - ie if xxx then else ... Can't find a way to do this and would very much appreciate some kind help - thanks - John
7
11700
by: Bob Sanderson | last post by:
I have a php page which contains the code: echo "<tr>"; echo "<th>$JobNumber</th>"; echo "<td>$Description</td>"; echo "<td>$NSN</td>"; echo "<td>$Manufacturer</td>"; echo "<td>$PartNumber</td>"; echo "</tr>";
4
3427
by: mramsay | last post by:
Hi, I'm having a real problem creating a dynamic hyperlink for my website. I want to pull the field name from mysql table. Field name is description. I would like this to be a hyperlink on my homepage. Also, when the user clicks on the description hyperlink they should see a dropdown with other hyperlinks such as hockey, baseball, etc. ...
1
2516
by: xx75vulcan | last post by:
Hi, Not sure if this goes to PHP or mySQL group (or both!). I've got a home brewed blog started using PHP and mySQL to store and display the entries/postings. I've figured out that I could format the way the entries are displayed from the database using nl2br2($string) to properly display paragraph breaks.
5
2900
by: mramsay | last post by:
HI, I'm having alot of problems trying to figure out how to create drop down links from a hyperlink on my homepage. I have a hyperlink called Programs (this is for a community centre) When the Programs hyperlink is selected I would like a drop down of link from my programs mysql table to be displayed. So far, it takes my mysql data and...
6
2393
by: mramsay | last post by:
Hi, I am lost when it comes to creating a click event in asp. I have hyperlinks that are pulled dynamically from a table. An example is Hockey is a hyperlink. What I want to do is when a user selects the Hockey link, information regarding Hockey will be pulled from another table and displayed on a page. In order to do this, I have to...
1
1743
by: mramsay | last post by:
Hi there, I have a dynamic hyperlink Baseball. When the user select the hyperlink they are redirected to another page. After that I want to display information on the page from my linkstbl. The information I want to display is Baseball and some text I have entered in the database. I'm having a problem displaying the two fields for...
3
5529
by: tamimmakki | last post by:
hi, I want to pass a value with hyperlink click to a php page.What i want to do is I have a list of 12 players in form of hyperlinks. if some user want to check profile of any player he will click on that players hyperlink, I have information of all players in database. I want that hyperlink player name in my database query to search that players...
0
7693
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...
0
7916
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. ...
1
7660
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...
0
6275
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5498
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...
0
5217
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
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...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2101
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

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.