# Finding parts in the url with php

**URL:** <https://forum.kirupa.com/t/finding-parts-in-the-url-with-php/10105>\
**Category:** Uncategorized\
**Created:** [December 24, 2002, 2:39pm UTC](https://forum.kirupa.com/t/finding-parts-in-the-url-with-php/10105 "2002-12-24T14:39:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![martystudio](https://avatars.discourse-cdn.com/v4/letter/m/c37758/32.png) [@martystudio](https://forum.kirupa.com/u/martystudio)\
**Post date:** [December 24, 2002, 2:39pm UTC](https://forum.kirupa.com/t/finding-parts-in-the-url-with-php/10105/1 "2002-12-24T14:39:08Z")

</div>

I have this url,  
[http://www.martystudio.com/index.php?error=101](http://www.martystudio.com/index.php?error=101)

i want to use php to lok at the error part of the url, if its found, look at what it equals. if it finds 101 $sendto = home if its 022 $sendto = send.php, if it dosent find the error , $sendto = home.php. here is the format that is somthing like what im trying to use

\<?php  
if (is\_null($\_POST[‘error’]) == TRUE) {  
$sendto = “home.php”;  
}  
?\>
