PHP +Handling URL Fields
Moderator: General Moderators
PHP +Handling URL Fields
Hi,
im using mySQL PHP Generator to ease my coding,
i cannot seem to find what php method converts or parses a string field to treat it as a url
example
my DB has a field SNAME
my SNAME field values are "Here" "There" "EveryWhere"
i would like to be able to encode http://here.php?SNAME=Here when i click on "Here"
how can i do this?
im using mySQL PHP Generator to ease my coding,
i cannot seem to find what php method converts or parses a string field to treat it as a url
example
my DB has a field SNAME
my SNAME field values are "Here" "There" "EveryWhere"
i would like to be able to encode http://here.php?SNAME=Here when i click on "Here"
how can i do this?
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
str_replace(), or more complicated, preg_replace().
PHP +Handling URL Fields -Rep
Thank you for replying so promptly,
i think i may have complicated my request
i would like my array to recognize my strings as url links
for example
SNAME
"Here" - clicking would open "http://SITE.php?HERE"
"There" clinking woudl open "http://SITE.php?There"
it is a simple a href like in html
Thank You
i think i may have complicated my request
i would like my array to recognize my strings as url links
for example
SNAME
"Here" - clicking would open "http://SITE.php?HERE"
"There" clinking woudl open "http://SITE.php?There"
it is a simple a href like in html
Thank You
I don't think it can be as simple as I think.. obviously only html but seems liek thats what your asking in a very complicated way..
Code: Select all
<a href="http://SITE.php?Here">here</a>PHP +Handling URL Fields -Rep
Thank You both
it is exactly like you nathanr
my array populates information, but does not treat the retrieved field as a url
i would like the array to make the hyperlink upon population
<td class="dr"><? echo htmlspecialchars($row["SNAME"]) ?></td>
kinda like
<td class="dr"><? echo href($row["SNAME"]) ?></td>
i tried meddling with curl, but im probably doing work harm than good
is this viable?
PS: Afterwards, i would use strreplace i suppose to help parse my request differently
thanks again feyd
it is exactly like you nathanr
my array populates information, but does not treat the retrieved field as a url
i would like the array to make the hyperlink upon population
<td class="dr"><? echo htmlspecialchars($row["SNAME"]) ?></td>
kinda like
<td class="dr"><? echo href($row["SNAME"]) ?></td>
i tried meddling with curl, but im probably doing work harm than good
is this viable?
PS: Afterwards, i would use strreplace i suppose to help parse my request differently
thanks again feyd
still not sure about what you are saying but.. from what I can gather this is what you mean
again not sure why you are using htmlspecialchars - but if you've put it in you must have a reason.
Code: Select all
<td class="dr"><a href="page.php?SNAME=<? echo htmlspecialchars($row["SNAME"]) ?>"><? echo htmlspecialchars($row["SNAME"]) ?></a></td>PHP +Handling URL Fields -Rep
Still cant get it to work like i mean to say, but i see progress
whats up with htmlspecialcodes?, remember, i'm using a tool to generate my php code
ok
im using LAMP,
my DB is has a field called SNAME, which i want it to act as a hyperlink
my SITE.php file pulls out a field SNAME = "Here"
i would like to tell php that everything in SNAME should be treated as a hyperlink or converted to a hyperlink
or referenced to a hyperlink
thank you for all of yer patience btw
whats up with htmlspecialcodes?, remember, i'm using a tool to generate my php code
ok
im using LAMP,
my DB is has a field called SNAME, which i want it to act as a hyperlink
my SITE.php file pulls out a field SNAME = "Here"
i would like to tell php that everything in SNAME should be treated as a hyperlink or converted to a hyperlink
or referenced to a hyperlink
thank you for all of yer patience btw
PHP +Handling URL Fields -Rep
Even better,
when [s]u[/s] you got to viewforum.php?f=1
[s]u[/s] you see the AUTHORS field is a cross referenced hyperlink
i wish to achieve this same functionality
Hope this helps
my apologies for the initial confusion
when [s]u[/s] you got to viewforum.php?f=1
[s]u[/s] you see the AUTHORS field is a cross referenced hyperlink
i wish to achieve this same functionality
Hope this helps
my apologies for the initial confusion
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:11. Please use proper, complete spelling when posting in the forums. AOL Speak, leet speak and other abbreviated wording can confuse those that are trying to help you (or those that you are trying to help). Please keep in mind that there are many people from many countries that use our forums to read, post and learn. They do not always speak English as well as some of us, nor do they know these aberrant abbreviations. Therefore, use as few abbreviations as possible, especially when using such simple words.
Some examples of what not to do are ne1, any1 (anyone); u (you); ur (your or you're); 2 (to too); prolly (probably); afaik (as far as I know); etc.
- iknownothing
- Forum Contributor
- Posts: 337
- Joined: Sun Dec 17, 2006 11:53 pm
- Location: Sunshine Coast, Australia
If you don't need htmlspecialcharacters, then:
That should work fine...
Code: Select all
<td class="dr"><a href="page.php?SNAME=<? echo $row['SNAME'] ?>"><? echo $row['SNAME'] ?></a></td>SOLVED-PHP +Handling URL Fields -Rep
Excellent
just what i needed
i appreciated all your efforts and generous help
no more leet speak either
Thanks Again
JFER
just what i needed
i appreciated all your efforts and generous help
no more leet speak either
Thanks Again
JFER