473,396 Members | 2,010 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,396 software developers and data experts.

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="#futherdown">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 5741
leegold2 <le*****@nospam.net> wrote:
<a href="#futherdown">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="#futherdown">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
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...
5
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
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...
4
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...
1
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...
5
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...
6
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...
1
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. ...
3
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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...
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
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.