php: Simple War script for your website

Forum for anything hard- or software related.

Moderator: Moderators

Den
something dur dur
Posts: 2616
Joined: Fri Jul 25, 2003 8:56 am
Location: nl
Contact:

Post by Den »

example:

[php]<?php

function auto_link($text) {

RETURN eregi_replace("(http://([a-zA-z0-9_-]+[\.]{1})*[\.]{0,1}[a-z]{2,3})","<a href=\"\\1\" target=\"_BLANK\">\\1</a>",$text);

}

echo auto_link("blablabla normal text, but this is a hyperlink: http://forums.aq2world.net");

?>

[/php]



The rest u can do urself :) basic php



Just put the function on top of ur source.

Then after u get the data from the db, do the auto_link.

or before u add the data to ur db





---

Some help:

http://nl.php.net/manual/en/function.eregi-replace.php
There's a chopper coming in 3 days and there's a katana on top of the cafe and that's all you need to know
Image
keffo
hit the ground hard, real hard
Posts: 80
Joined: Sun Dec 21, 2003 9:10 pm
Location: se

Post by keffo »

ok? so if i want to put it below the score i'll just add this in the table below the score (in report section) .. get it?



this is how it should be written our as a link?
Eg har blitt norrbagge :<
Den
something dur dur
Posts: 2616
Joined: Fri Jul 25, 2003 8:56 am
Location: nl
Contact:

Post by Den »

have a look at the first page, added it there.
There's a chopper coming in 3 days and there's a katana on top of the cafe and that's all you need to know
Image
keffo
hit the ground hard, real hard
Posts: 80
Joined: Sun Dec 21, 2003 9:10 pm
Location: se

Post by keffo »

i dunt get that much on the page.. but..
Eg har blitt norrbagge :<
keffo
hit the ground hard, real hard
Posts: 80
Joined: Sun Dec 21, 2003 9:10 pm
Location: se

Post by keffo »

oh, thought of one thingie.. it would be cool if you can select different pictures, in this case.. flags.



have a look here


Code: Select all

Type:<select name='type' size='1' id='type'><option>official</option><option>unofficial</option><option>eaql</option><option>naql</option></select><br> 


I wonder if you can do like this somehow, but using images instead?

and if.. how?! ;>
Eg har blitt norrbagge :<
Den
something dur dur
Posts: 2616
Joined: Fri Jul 25, 2003 8:56 am
Location: nl
Contact:

Post by Den »

if else statements..
There's a chopper coming in 3 days and there's a katana on top of the cafe and that's all you need to know
Image
keffo
hit the ground hard, real hard
Posts: 80
Joined: Sun Dec 21, 2003 9:10 pm
Location: se

Post by keffo »

you got any example or sum? ;>
Eg har blitt norrbagge :<
Zonic
was flattened
Posts: 143
Joined: Wed Jul 30, 2003 12:41 pm
Location: se
Contact:

Post by Zonic »

keffo, you should read some PHP manual.
keffo
hit the ground hard, real hard
Posts: 80
Joined: Sun Dec 21, 2003 9:10 pm
Location: se

Post by keffo »

whue? examples = good way too learn, then you read manuals outfrom the example..
Eg har blitt norrbagge :<
Kurupt
:I
Posts: 873
Joined: Fri Jul 25, 2003 9:08 am
Location: nl

Post by Kurupt »

examples? u basicly just ask them to make the script for you ;)
keffo
hit the ground hard, real hard
Posts: 80
Joined: Sun Dec 21, 2003 9:10 pm
Location: se

Post by keffo »

oh, thats not my opinion.. i like examples, like.. well, read above, there some examples i've been building on.. :>
Eg har blitt norrbagge :<
Post Reply