#1 (permalink)  
Old 12-11-2004, 12:02 PM
Active Member
 
Join Date: Nov 2004
Posts: 1,828
inspireme is on a distinguished road
Default whats wrong with this code?

Some of my listigns dont have websites. If they dont I have the default address : http://www.mysite.com/nosite.php added in the DB. This link will go to a page saying the site has no webpage etc. I want to display graphics depending on if the site has a webpage, if the do it will come up with a button saying "Visit Site" if not a button saying "No Website Available"

I have the following code, but it ALWAYS comes out displaying the "yessite.jpg"

I cannot see whats wrong with the logic. no site url is identical to what is stored in the database so it should work

Code:
Content visible to License Owner only.

the plan is to use
<a href=<%url%>> <img src=<%displaysite%>border=0></a> to display if a site exists, and make a clickable button.

Im sure this is a simple problem, im new to php. I try for an hour and then i post. thats my rule!!!
  #2 (permalink)  
Old 12-11-2004, 03:06 PM
Active Member
 
Join Date: Nov 2004
Posts: 1,828
inspireme is on a distinguished road
Default

ok if i declare $url = www.mysite.com/nosite.php it works. SO, the problem must be the way im getting the url fromt he database into the variable $url ... its obviously not working.

Im actually using : $url = $links_obj->url

not what i used in the first post... so how would i do it?
  #3 (permalink)  
Old 12-11-2004, 05:42 PM
esm's Avatar
esm esm is offline
Active Member
 
Join Date: Apr 2003
Location: Atlanta GA
Posts: 3,411
esm is on a distinguished road
Default

the following should work:

Code:
Content visible to License Owner only.
I'm not to sure about the value of
Code:
Content visible to License Owner only.
whether its works depends on where you are at in the code.



.
__________________
esm
"The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

.
  #4 (permalink)  
Old 12-12-2004, 05:55 AM
Active Member
 
Join Date: Nov 2004
Posts: 1,828
inspireme is on a distinguished road
Default

I did a few tests and the problem is that i cannot get the url fromt he database to do any comparing. Im using your hits mod I found in the forums (counts hits to the details page rather than external site) and adapted the way you did it, this works but im not sure if its the best way :

Code:
Content visible to License Owner only.
I dont really understand why it is necessary to query the database again once a query to :
Code:
Content visible to License Owner only.
has already happened, surely the url field is available... anyway it works now so im happy!!
  #5 (permalink)  
Old 12-12-2004, 06:45 AM
esm's Avatar
esm esm is offline
Active Member
 
Join Date: Apr 2003
Location: Atlanta GA
Posts: 3,411
esm is on a distinguished road
Default

Code:
Content visible to License Owner only.
I'm not sure which code it is that is working for you but if it works...

depending on where you are at in the code, any one of these three could work:


Code:
Content visible to License Owner only.
Code:
Content visible to License Owner only.
Code:
Content visible to License Owner only.
I don't think the following will ever work since id is not a valid field name in the SQL table idx_link
Code:
Content visible to License Owner only.

.
__________________
esm
"The older I get, the more I admire competence, just simple competence, in any field from adultery to zoology."

.
  #6 (permalink)  
Old 12-12-2004, 02:52 PM
Active Member
 
Join Date: Nov 2004
Posts: 1,828
inspireme is on a distinguished road
Default

the database query was my short hand im using link_id really. I was just wondering why I needed to query the database again, because the indexu (unchanged code!) already selects everything from idx_link, therfore I should be able to get the url from the returned array...

But as you said, its working so lets not worry about it !!
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
What is wrong with this ??? lanzabiz v5.x 3 05-27-2004 02:17 AM
<%hot_links%> code persut v5.x 4 02-01-2004 04:31 PM
Inserting a PHP Code In the INDEX page !!! althahabi v5.x 1 09-26-2003 04:21 PM
Adding code before and after a link shanet v5.x 7 06-07-2003 06:15 AM
Wrong focus ReeToric v5.x 1 09-26-2001 08:45 AM

HACKER SAFE certified sites prevent over 99.9% of hacker crime.

All times are GMT -5. The time now is 02:21 PM.


Powered by vBulletin®
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO
SSL Certificate