GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Programmers I pay $10 epassporte for a very simple script! (https://gfy.com/showthread.php?t=793877)

Sony 12-21-2007 02:11 AM

Programmers I pay $10 epassporte for a very simple script!
 
Here is an example of what I want:

http://www.ronisparadise.net/fhg/gal...hp?user=XXXXXX

I need made a php file which will change the affiliate code inside a gallery accoring the change made in the URL.

e.g If I replace the XXXXXX in the URL with 234122 then all links in the gallery will have the XXXXXX replaced with 234122

http://www.ronisparadise.net/fhg/gal...hp?user=234122

ICQ: 171739496

k0nr4d 12-21-2007 02:13 AM

hitting you up on icq

V_RocKs 12-21-2007 02:16 AM

Make sure it sanitizes that input too.

SmokeyTheBear 12-21-2007 02:17 AM

Code:

<?php
$id = $_GET['id'];
$stuff = file_get_contents("template.txt");
$html = str_replace("123456",$id,$stuff);
echo $html;
?>

save that as index.php

save all your html in a file called template.txt with refcode as 123456

then just call the index.php like index.php?id=5551212

SmokeyTheBear 12-21-2007 02:18 AM

yes i suppose you might wanna santatize it a bit :)

k0nr4d 12-21-2007 02:22 AM

Quote:

Originally Posted by SmokeyTheBear (Post 13545589)
Code:

<?php
$id = $_GET['id'];
$stuff = file_get_contents("template.txt");
$html = str_replace("123456",$id,$stuff);
echo $html;
?>

save that as index.php

save all your html in a file called template.txt with refcode as 123456

then just call the index.php like index.php?id=5551212

For what he needs, <? echo strip_tags($_REQUEST['user']) ; ?> right in the gallery is plenty. No point reading in another file...

SmokeyTheBear 12-21-2007 02:27 AM

Quote:

Originally Posted by k0nr4d (Post 13545595)
For what he needs, <? echo strip_tags($_REQUEST['user']) ; ?> right in the gallery is plenty. No point reading in another file...

true but if he has alot of places to change it would be shorter is all i was thinking

Sony 12-21-2007 02:30 AM

Quote:

Originally Posted by k0nr4d (Post 13545574)
hitting you up on icq

Thanks Smokey for input, but I choosed to use k0nr4d code since is a bit easier. He sent me the code on ICQ and he didn't wanted to take my money:) Thank you again mate!

k0nr4d 12-21-2007 02:32 AM

Quote:

Originally Posted by SmokeyTheBear (Post 13545605)
true but if he has alot of places to change it would be shorter is all i was thinking

ahh yes didn't think of that.

SmokeyTheBear 12-21-2007 03:15 AM

Quote:

Originally Posted by Sony (Post 13545614)
Thanks Smokey for input, but I choosed to use k0nr4d code since is a bit easier. He sent me the code on ICQ and he didn't wanted to take my money:) Thank you again mate!

no probs. i suggets always asking first , lots of people still dont mind helping for free. then if you need more customization you have a few choices based on answers. ( and for others who might also want the same thing and for reference )

:thumbsup

p.s. if you want to have se friendly urls you could use his code with the following
( assuming there are no asp pages in the directory )

save this as .htaccess and upload to the same directory
Code:

RewriteEngine on
 RewriteRule ^(.*)\.asp index.php?user=$1 [nc]

this way you can call your pages like
http://yoursite.com/stuff/refcode.asp
and it will turn into
http://yoursite.com/stuff/index.php?user=refcode

rowan 12-21-2007 03:58 AM

Quote:

Originally Posted by k0nr4d (Post 13545595)
For what he needs, <? echo strip_tags($_REQUEST['user']) ; ?> right in the gallery is plenty. No point reading in another file...

If the ID consists of digits only then you can force it to an integer by adding it to a number:

<?php echo (0 + $_REQUEST["user"]); ?>

Iron Fist 12-21-2007 06:19 AM

Good thread :)


All times are GMT -7. The time now is 10:50 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123