Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

$_GET['something'] from the URL getting more than expected.

Hey I am having some issues with the $_GET from PhP.

So I am using this a tag

<a href="http://ftpdigi.com/home-3/?cat_clicked=12">

Using this to echo cat_clicked outputs this

?cat_clicked=12:2986

this outputs from this

$cat_raw = $_GET['cat_clicked']; echo $cat_raw;

I need to get the output of just 12, but I am not really sure what I am doing wrong.

I have not fixed the issue but I have made a workaround by using the includes function from javascript. To check if the string contains what I am looking for.

1 Answer