Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #14519 > unrolled thread
| Started by | richard <noreply@example.com> |
|---|---|
| First post | 2014-11-10 10:41 -0500 |
| Last post | 2014-11-18 06:42 -0500 |
| Articles | 10 — 8 participants |
Back to article view | Back to comp.lang.php
can one link reference two seperate files? richard <noreply@example.com> - 2014-11-10 10:41 -0500
Re: can one link reference two seperate files? richard <noreply@example.com> - 2014-11-10 10:45 -0500
Re: can one link reference two seperate files? "J.O. Aho" <user@example.net> - 2014-11-10 18:05 +0100
Re: can one link reference two seperate files? Matthew Carter <m@ahungry.com> - 2014-11-10 12:10 -0500
Re: can one link reference two seperate files? "J.O. Aho" <user@example.net> - 2014-11-10 20:25 +0100
Re: can one link reference two seperate files? Arno Welzel <usenet@arnowelzel.de> - 2014-11-17 13:40 +0100
Re: can one link reference two seperate files? "Christoph M. Becker" <cmbecker69@arcor.de> - 2014-11-10 18:19 +0100
Re: can one link reference two seperate files? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2014-11-10 19:07 +0000
Re: can one link reference two seperate files? Denis McMahon <denismfmcmahon@gmail.com> - 2014-11-10 21:24 +0000
Re: can one link reference two seperate files? Norman Peelman <npeelman@cfl.rr.com> - 2014-11-18 06:42 -0500
| From | richard <noreply@example.com> |
|---|---|
| Date | 2014-11-10 10:41 -0500 |
| Subject | can one link reference two seperate files? |
| Message-ID | <mn1jm36vp2n5.bryfbmjsjuzb$.dlg@40tude.net> |
<A href="page1.php"> Is the normal way of linking. What if I need to send a value to page1 and another value to page2? With just one click. Or can they be nested? <a href="page1.php"><a href="page2.php">link</a></a>
[toc] | [next] | [standalone]
| From | richard <noreply@example.com> |
|---|---|
| Date | 2014-11-10 10:45 -0500 |
| Message-ID | <q69hybfwd3rs$.w79s81g2pp86.dlg@40tude.net> |
| In reply to | #14519 |
On Mon, 10 Nov 2014 10:41:02 -0500, richard wrote: > <A href="page1.php"> > Is the normal way of linking. > What if I need to send a value to page1 and another value to page2? > With just one click. > Or can they be nested? > <a href="page1.php"><a href="page2.php">link</a></a> found out that nesting is not allowed.
[toc] | [prev] | [next] | [standalone]
| From | "J.O. Aho" <user@example.net> |
|---|---|
| Date | 2014-11-10 18:05 +0100 |
| Message-ID | <ccc9i5F6l19U1@mid.individual.net> |
| In reply to | #14519 |
On 10/11/14 16:41, richard wrote: > <A href="page1.php"> > Is the normal way of linking. > What if I need to send a value to page1 and another value to page2? > With just one click. > Or can they be nested? > <a href="page1.php"><a href="page2.php">link</a></a> > Heard about ajax? Ask for help in a javascript usergroup. -- //Aho
[toc] | [prev] | [next] | [standalone]
| From | Matthew Carter <m@ahungry.com> |
|---|---|
| Date | 2014-11-10 12:10 -0500 |
| Message-ID | <87h9y7vv60.fsf@ahungry.com> |
| In reply to | #14523 |
"J.O. Aho" <user@example.net> writes: > On 10/11/14 16:41, richard wrote: >> <A href="page1.php"> >> Is the normal way of linking. >> What if I need to send a value to page1 and another value to page2? >> With just one click. >> Or can they be nested? >> <a href="page1.php"><a href="page2.php">link</a></a> >> > Heard about ajax? > Ask for help in a javascript usergroup. You can have page1.php hit page2.php on the server end with a curl call (or depending on your set up, file_get_contents). That may be more reliable than ajax in the event the user has javascript disabled. -- Matthew Carter (m@ahungry.com) http://ahungry.com
[toc] | [prev] | [next] | [standalone]
| From | "J.O. Aho" <user@example.net> |
|---|---|
| Date | 2014-11-10 20:25 +0100 |
| Message-ID | <ccchppF8um8U1@mid.individual.net> |
| In reply to | #14524 |
On 10/11/14 18:10, Matthew Carter wrote: > "J.O. Aho" <user@example.net> writes: > >> On 10/11/14 16:41, richard wrote: >>> <A href="page1.php"> >>> Is the normal way of linking. >>> What if I need to send a value to page1 and another value to page2? >>> With just one click. >>> Or can they be nested? >>> <a href="page1.php"><a href="page2.php">link</a></a> >>> >> Heard about ajax? >> Ask for help in a javascript usergroup. > > You can have page1.php hit page2.php on the server end with a curl call > (or depending on your set up, file_get_contents). > > That may be more reliable than ajax in the event the user has javascript > disabled. Think it's better for richard to use ajax and go to a javascript usergroup to get some help.
[toc] | [prev] | [next] | [standalone]
| From | Arno Welzel <usenet@arnowelzel.de> |
|---|---|
| Date | 2014-11-17 13:40 +0100 |
| Message-ID | <5469ECBD.4020405@arnowelzel.de> |
| In reply to | #14527 |
J.O. Aho schrieb am 2014-11-10 um 20:25: > On 10/11/14 18:10, Matthew Carter wrote: >> "J.O. Aho" <user@example.net> writes: >> >>> On 10/11/14 16:41, richard wrote: >>>> <A href="page1.php"> >>>> Is the normal way of linking. >>>> What if I need to send a value to page1 and another value to page2? >>>> With just one click. >>>> Or can they be nested? >>>> <a href="page1.php"><a href="page2.php">link</a></a> >>>> >>> Heard about ajax? >>> Ask for help in a javascript usergroup. >> >> You can have page1.php hit page2.php on the server end with a curl call >> (or depending on your set up, file_get_contents). >> >> That may be more reliable than ajax in the event the user has javascript >> disabled. > > Think it's better for richard to use ajax and go to a javascript > usergroup to get some help. Think it's better if richard would admit that he doesn't have any clue of software development at all and pay someone else to solve his problems, really. -- Arno Welzel http://arnowelzel.de http://de-rec-fahrrad.de http://fahrradzukunft.de
[toc] | [prev] | [next] | [standalone]
| From | "Christoph M. Becker" <cmbecker69@arcor.de> |
|---|---|
| Date | 2014-11-10 18:19 +0100 |
| Message-ID | <m3qs33$t8a$1@solani.org> |
| In reply to | #14519 |
richard wrote: > <A href="page1.php"> > Is the normal way of linking. > What if I need to send a value to page1 and another value to page2? > With just one click. A hyperlink is not meant to send a value to a page, but rather to make the client (e.g. the browser) to request a resource. Ask yourself: which resource would be fetched, if there were two URIs? Or better: why should two resources be requested, if only one would be presented? Either you need XHRs (so-called Ajax requests), or you should reconsider the structure of the website -- or something else. That depends on what you want to accomplish. You are likely to get better answers, if you ask smarter questions, see <http://www.catb.org/esr/faqs/smart-questions.html>. -- Christoph M. Becker
[toc] | [prev] | [next] | [standalone]
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Date | 2014-11-10 19:07 +0000 |
| Message-ID | <87ioim7u29.fsf@bsb.me.uk> |
| In reply to | #14519 |
richard <noreply@example.com> writes: > <A href="page1.php"> > Is the normal way of linking. > What if I need to send a value to page1 and another value to page2? > With just one click. > Or can they be nested? > <a href="page1.php"><a href="page2.php">link</a></a> As has been explained (and you've also concluded yourself) they can't be nested. But if what you really want is for some action to be performed on the server before loading page1.php, you can make page2.php perform the action and reply with an HTTP redirect header for page1.php. Alternatively, if the order is not very important (maybe you are logging actions of some sort), the PHP for page1.php can reply with the page as normal but include within it something like an invisible image: <img src="page2.php"> or a link to a page2.php as a stylesheet in the header. As always with this sort of question, the best answer will depend on what you are really trying to do. -- Ben.
[toc] | [prev] | [next] | [standalone]
| From | Denis McMahon <denismfmcmahon@gmail.com> |
|---|---|
| Date | 2014-11-10 21:24 +0000 |
| Message-ID | <m3rae1$kkm$1@dont-email.me> |
| In reply to | #14519 |
On Mon, 10 Nov 2014 10:41:02 -0500, richard wrote: > What if I need to send a value to page1 and another value to page2? Use ajax, call php2.php from php1.php (which one should supply the page to the client) It sounds like you have a broken website design concept. I would ask why you want to do this, but I won't, because even thinking about asking it gives me nightmares about the answer. -- Denis McMahon, denismfmcmahon@gmail.com
[toc] | [prev] | [next] | [standalone]
| From | Norman Peelman <npeelman@cfl.rr.com> |
|---|---|
| Date | 2014-11-18 06:42 -0500 |
| Message-ID | <m4fbag$k16$1@dont-email.me> |
| In reply to | #14519 |
On 11/10/2014 10:41 AM, richard wrote:
> <A href="page1.php">
> Is the normal way of linking.
> What if I need to send a value to page1 and another value to page2?
> With just one click.
> Or can they be nested?
> <a href="page1.php"><a href="page2.php">link</a></a>
>
First question is which page are you expecting the user to end up on?
Second, can you clarify what you mean by 'I need to send a value to
page1 and another value to page2?' What does page2 do? If page2 only
processes some data and never displays anything you could do it in
reverse by sending the two values to page2, process the data and then
redirect the page back to page1 (with value) like:
<a href="page2.php?p1=value1&p2=value2">Click Here</a>
Page2
p1 = $_GET['p1']
p2 = $_GET['p2']
//Sanitize variables
//Process p2
Redirect -> header("Location: http://example.com/Page1.php?p1=$p1");
--
Norman
Registered Linux user #461062
-Have you been to www.php.net yet?-
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.php
csiph-web