473,321 Members | 1,748 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,321 software developers and data experts.

Returning a URL from a user search

I am returning page results from a form. 3 fields need to be returned:

Companyname
address1
webpage

This is an example of what I need returned:

Grey's Living Spa
9200 Anylane Rd., Columbus, OH 12345
[visit this site]

The companyname and address1 are displaying, but I need the correct
code to put that webpage (the mysql fieldname is 'webpage') in the
correct href tag in php.

Code to date:
//$row = $result->fetch_assoc();
$row = mysql_fetch_assoc($result);
echo '<p class="blue3"><strong>'.($i+1).' ';
// display the Company
echo htmlspecialchars(stripslashes($row['companyname']));
echo '</strong>';
echo '<strong><br /';
// dipslay the Address
echo stripslashes($row['address1']);
echo '<strong><br /';
// display a link to the company's site
echo '<br>';

echo '</p>';

Oct 9 '06 #1
3 1077
anthony wrote:
The companyname and address1 are displaying, but I need the correct
code to put that webpage (the mysql fieldname is 'webpage') in the
correct href tag in php.

Code to date:
//$row = $result->fetch_assoc();
[...]
// display a link to the company's site
echo '<a href="', $row['webpage'], '">', $row['webpage'], '</a>';

or maybe?

echo '<a href="', $row['webpage'], '">[visit this site]</a>';
echo '<br>';
[...]

--
File not found: (R)esume, (R)etry, (R)erun, (R)eturn, (R)eboot
Oct 9 '06 #2
Pedro,
That line of code worked. Thanks!
Anthony

Pedro Graca wrote:
anthony wrote:
The companyname and address1 are displaying, but I need the correct
code to put that webpage (the mysql fieldname is 'webpage') in the
correct href tag in php.

Code to date:
//$row = $result->fetch_assoc();
[...]
// display a link to the company's site

echo '<a href="', $row['webpage'], '">', $row['webpage'], '</a>';

or maybe?

echo '<a href="', $row['webpage'], '">[visit this site]</a>';
echo '<br>';
[...]

--
File not found: (R)esume, (R)etry, (R)erun, (R)eturn, (R)eboot
Oct 9 '06 #3
Hmm Pedro Graca <he****@dodgeit.comwrote:
echo '<a href="', $row['webpage'], '">', $row['webpage'],
it is dependent what he store in db - if he has no form processing function
he should show

<a href="http://', str_replace('http://','',$row['webpage']), '">',
$row['webpage'],
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Ikciu | gg: 718845 | yahoo: ikciu_irsa | www: www.e-irsa.pl

2be || !2be $this =mysql_query();
Oct 10 '06 #4

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

Similar topics

3
by: Carramba | last post by:
hi! the code is cinpiling with gcc -ansi -pedantic. so Iam back to my question Iam trying to make program were I enter string and serach char. and funktion prints out witch position char is...
1
by: Maziar Aflatoun | last post by:
Hi everyone, I'm having a problem with reading user groups on Active Directory using C#. It returns all the groups in the Universal scope for a specific user. However, I only need the groups in...
4
by: Moe Sizlak | last post by:
Hi There, I am trying to return the value of a listbox control that is included as a user control, I can return the name of the control but I can't access the integer value of the selected item,...
4
by: Larry Grady | last post by:
Anyone up for a challenge? I've been struggling with this for a few days and was hoping someone could help me. Pouring through all the messageboards I just can't find the solution. We have a...
2
by: john.lehmann | last post by:
Attacked is a piece of code which first hits the login page successfully and receives back login cookies. But then when I attempt to hit a page which is restricted to logged in users only, I fail....
0
by: tedqn | last post by:
I have a gridview page that returns result base on submitted search criteria. Each result has a link to view the details of an item, which will take user away from the current page to the detail...
29
by: tnspc | last post by:
I'm writing code for a class where I've set up functions to load data from a file in the same directory as the PHP file (using the "file" method). Then, the goal is for the program to take the info...
1
by: thepresidentis | last post by:
here is my problem, i have a website that compiles concert listings for users to search for shows in their local area, i ran into a problem with returning search results due to an improper format...
0
by: thepresidentis | last post by:
here is my problem, i have a website that compiles concert listings for users to search for shows in their local area, i ran into a problem with returning search results due to an improper format...
1
by: SnakesRule | last post by:
I'm trying to pass a name from a ComboBox to a MySQL search function, but no matter how I twist it, the get() always returns the first value in the combobox list, regardless of which name the user...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.