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)
-   -   Simple coding question (https://gfy.com/showthread.php?t=1049642)

v4 media 12-13-2011 06:22 AM

Simple coding question
 
If I want to copy a thumb over to a new page, say someone clicks on thumb 01 and this is the url 'join.htm?t=01' I want the 01 thumb to show on the join page.


I would imagine it's simple but I don't even know what I need to search for to actually find the code.

Anyone want to tell me what I'm looking for, :helpme

thanks

Babaganoosh 12-13-2011 06:25 AM

Sounds like you need to hire an actual webmaster.

fris 12-13-2011 06:26 AM

get the t variable

Code:

<?php

$thumb = $_GET['t'];
echo $thumb . '.jpg';

?>

or whatever path, etc.

v4 media 12-13-2011 06:33 AM

Quote:

Originally Posted by fris (Post 18626724)
get the t variable

Code:

<?php

$thumb = $_GET['t'];
echo $thumb . '.jpg';

?>

or whatever path, etc.

Thank you very much.




Quote:

Originally Posted by Babaganoosh (Post 18626723)
Sounds like you need to hire an actual webmaster.

Everything else was done just needed to solve that, And within 4 minutes of posting it was. So I'll put the webmaster hiring on hold, thanks for your wise words though.

fris 12-13-2011 06:35 AM

might wann add a trim to the $_GET and also check if its set so you dont get some fool trying to inject shit.

Babaganoosh 12-13-2011 06:36 AM

You're lucky there are folks willing to help out the lazy and incompetent. I'm guessing you'll be around as long as they're willing to think for you.

v4 media 12-13-2011 06:39 AM

Quote:

Originally Posted by Babaganoosh (Post 18626742)
You're lucky there are folks willing to help out the lazy and incompetent. I'm guessing you'll be around as long as they're willing to think for you.

Who pissed on your cornflakes this morning?

Babaganoosh 12-13-2011 06:48 AM

Quote:

Originally Posted by v4 media (Post 18626749)
Who pissed on your cornflakes this morning?

Nobody, I just hate incompetence.

Zoxxa 12-13-2011 06:57 AM

Just to build off Fris' code and recommendation.

Code:

<?php

// Only allow integar values
$thumb = preg_replace('/[^0-9]/', '', $_GET['t']) . '.jpg';

// If no thumb set, use default thumb
if(empty($thumb)) {
        $thumb = 'default.jpg';
}

// Output thumb
echo $thumb;

?>


v4 media 12-13-2011 07:23 AM

Quote:

Originally Posted by Zoxxa (Post 18626782)
Just to build off Fris' code and recommendation.

Code:

<?php

// Only allow integar values
$thumb = preg_replace('/[^0-9]/', '', $_GET['t']) . '.jpg';

// If no thumb set, use default thumb
if(empty($thumb)) {
        $thumb = 'default.jpg';
}

// Output thumb
echo $thumb;

?>


thanks, reading up now.


All times are GMT -7. The time now is 03:21 AM.

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