Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Including '?? in strings
Sorry for the banal question, but I'm a newbee and I'm getting crazy. I just
need to create an Hypelink to a page, including a GET var. So I wrote
something like:
$pag='page?getvar=....'
echo '<a href=' . $pag . ' etc etc

but the '?' becames '/?'. I tried to use '\?', but no result.
What's the right syntax?

MP



Report this thread to moderator Post Follow-up to this message
Old Post
MP
04-24-05 01:55 PM


Re: Including '?? in strings
I noticed that Message-ID: <MEIae.1282598$35.47430335@news4.tin.it> from
MP contained the following:

> $pag='page?getvar=....'
> echo '<a href=' . $pag . ' etc etc

$pag="page.php?getvar=something";
echo "<a href=' $pag'>Link</a>";
--
Geoff Berrow  0110001001101100010000000110
 0011011010110110010001101111011001110010
11
 1001100011011011110010111001110101011010
11

Report this thread to moderator Post Follow-up to this message
Old Post
Geoff Berrow
04-24-05 01:55 PM


Re: Including '?? in strings
MP wrote:
> Sorry for the banal question, but I'm a newbee and I'm getting crazy. I ju
st
> need to create an Hypelink to a page, including a GET var. So I wrote
> something like:
>  $pag='page?getvar=....'
>  echo '<a href=' . $pag . ' etc etc
>
> but the '?' becames '/?'. I tried to use '\?', but no result.
> What's the right syntax?
>
> MP
>
>
I use the code below quite a bit and it works fine.

$tag="<a href=\"page.php?tag=$row->tag\">Click here</a>";
echo $tag;

I am getting the GET var from an array, replace the first $row->tag with
your variable.

Good Luck

Kevin

Report this thread to moderator Post Follow-up to this message
Old Post
Kevin
04-24-05 01:55 PM


Re: Including '?? in strings
Thank you all,
both solution are fine. Actually, coming from VB I'm having hard time with
quotes, var inclusion in strings, etc...

MP

"MP" <purplecat@aliceposta.it> ha scritto nel messaggio
news:MEIae.1282598$35.47430335@news4.tin.it...
> Sorry for the banal question, but I'm a newbee and I'm getting crazy. I
> just need to create an Hypelink to a page, including a GET var. So I wrote
> something like:
> $pag='page?getvar=....'
> echo '<a href=' . $pag . ' etc etc
>
> but the '?' becames '/?'. I tried to use '\?', but no result.
> What's the right syntax?
>
> MP
>



Report this thread to moderator Post Follow-up to this message
Old Post
MP
04-25-05 01:55 AM


Re: Including '?? in strings
in your url

http://www.yourdomain.com/page.php?getvar=thistext



page.php

$txt = $_GET['getvar'];

echo "<a href=\"http://www.$txt.com\">$txt</a>";

Report this thread to moderator Post Follow-up to this message
Old Post
steesc@politicsofstarving.com
04-25-05 08:56 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Language archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:26 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.