Hey, i am having a hard time finding info on how to make dynamic links like this: http://www.example.com/redirect.php?c=ECC does anyone know how to make them or point me to the right direction , please any help appreciated...
Ok to start with you have posted in the wrong forum. This forum is for HTML and Website Design, you should have posted in the PHP forum. But don't worry I think this is what you want. Add this code to your redirect.php page. <? if ($_GET[c] == "page1") { echo "This is page 1."; } elseif ($_GET[c] == "page2") { echo "This is page 2."; } else { echo "You cannot access this page directly!"; } ?> Code (markup): If a visitor visits http://www.example.com/redirect.php?c=page1 They will receive the message "This is page 1." If a visitor visits http://www.example.com/redirect.php?c=page2 They will receive the message "This is page 2." If a visitor visits http://www.example.com/redirect.php They will receive the message "You cannot access this page directly!" Hope this helps, anymore questions feel free to PM me
Say you have a page "domain.com/page.php" Now you want to send some values to it, say item_number which is 734. You link would be domain.com/page.php + ? + item_number + = + 734 giving you domain.com/page.php?item_number=734 If you want to pass more than one value use "&" like this: item_number=734&customer=John&price=7 Now in the php code of the page if you want to get those values do this: <?php $item_number = $_GET['item_number']; //Will be 734 $customer = $_GET['customer']; //Will be John $price = $_GET['item_number']; //Will be 7 ?> PHP: After you get those values, you would need to compare them to something, or display them to the user. Also you can check if they are empty (if user enters "item_number=&customer=&price=")
this is almost the thing i am looking for... one more question. what if i want "page 1" to redirect to google.com?
ok guys, so how can i pass multiple values? http://www.example.com/redirect.php?c=ECC&customer=John any help appreciated i dont really understand what dejangex is trying to say..
If you want page1 to redirect to google.com, in the bit of code about page1, you do this: if ($_GET[c] == "page1") { // this is still page 1 header('Location:http://www.google.com'); // This redirects the user } PHP: Hope that helps
then is it not possible a multiple value redirect such as http://www.example.com/redirect.php?c=ECC&customer=John to redirect to google.com and if i input http://www.example.com/redirect.php?c=ECC&customer=Mark to redirect to yahoo.com?
if ($_GET['c'] == "page1" && $_GET['customer'] == "John") {header('Location:[url]http://www.google.com');[/url] } if ($_GET['c'] == "page1" && $_GET['customer'] == "Mark") {header('Location:[url]http://www.yahoo.com');[/url] } PHP: