Kreative Flow Designs
Thanks for visiting Kreative Flow. You'll recieve the best tutorials, resources and graphic information here.

Do register if you are a guest for exclusive content only for members!


help with my code

View previous topic View next topic Go down

help with my code

Post by theboss on Tue 07 Apr 2009, 6:16 am

Im trying to make a script that turns text into links.
but it also does it with my images.
like this:
Code:
<a href=articles.php?a=26>Alien</a>.jpg

So basiccaly i need it to skip all text inside of [img] tags
Can somone help me?

here is the script:
Code:
$aid = &$_GET['a'];   
$articles = mysql_query("SELECT * FROM articles");
$string = $txt;
while($article = mysql_fetch_array($articles)){
   if ($article[id] <> $aid){
   $string = str_ireplace($article[name], "<a href=articles.php?a=" . $article[id]. ">".$article[name] . "</a>", $string);
}}
$txt = $string;
avatar
theboss
Gold Member
Gold Member

Number of posts : 175
Flow Points : 110
Reputation : 2
Warnings :
0 / 1000 / 100

Mood :

View user profile http://forums.sw-gm.com

Back to top Go down

Re: help with my code

Post by AxiuM1485 on Tue 07 Apr 2009, 6:40 am

Sorry boss i know nothing of scripts Smile.... someday Laughing

AxiuM1485
Top Poster
Top Poster

Number of posts : 769
Flow Points : 1524
Reputation : 17
Warnings :
0 / 1000 / 100

Mood :

View user profile

Back to top Go down

Re: help with my code

Post by gatekeeper on Tue 07 Apr 2009, 11:42 am

Do you mean the html............
Code:
<a href="text or link goes here" taget=new><img src=" the url of pic goes here " border=0></a>
.
or you can try www.dynamicdrive.com to see if there's anything there you can use.
avatar
gatekeeper
Adv. Member
Adv. Member

Number of posts : 264
Flow Points : 468
Reputation : 5
Warnings :
0 / 1000 / 100

Mood :

View user profile

Back to top Go down

Re: help with my code

Post by Henryz on Tue 07 Apr 2009, 12:53 pm

I can't really understand why your using any script Smile Unless you want to return a string from an input for example and it automatically is generated into a link?
avatar
Henryz
Gold Member
Gold Member

Number of posts : 109
Flow Points : 241
Reputation : 3
Warnings :
0 / 1000 / 100

Mood :

View user profile http://www.webvicious.com, http://www.Henry.Brown.Name

Back to top Go down

Re: help with my code

Post by Adil on Tue 07 Apr 2009, 12:53 pm

Dynamic Drive has alot of great scripts to try out. Sorry but im still a novice at php Smile

_________________
Three R's. Read all forum rules. Respect all members, Report all problems!



avatar
Adil
Founder
Founder

Number of posts : 2488
Flow Points : 3875
Reputation : 43
Warnings :
0 / 1000 / 100

Mood :

View user profile http://www.kreativeflow.net

Back to top Go down

Re: help with my code

Post by theboss on Tue 07 Apr 2009, 1:02 pm

gatekeeper wrote:Do you mean the html............
Code:
<a href="text or link goes here" taget=new><img src=" the url of pic goes here " border=0></a>
.
or you can try www.dynamicdrive.com to see if there's anything there you can use.
no i mean php Razz
Henryz wrote:I can't really understand why your using any script Smile Unless you want to return a string from an input for example and it automatically is generated into a link?
yes, this is a script that gets articles from the database and crossmatches the words with the titles of other articles
but it also matches link names
avatar
theboss
Gold Member
Gold Member

Number of posts : 175
Flow Points : 110
Reputation : 2
Warnings :
0 / 1000 / 100

Mood :

View user profile http://forums.sw-gm.com

Back to top Go down

Re: help with my code

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum