I have a simple php script that I want to use with GET

mysite.com/script.php?site=value&plug=value

site will be a domain name
plug will be a URL

It works if I only pass 1 value:
mysite.com/script.php?site=value

But it fails when using both values. Get forbidden error.

here is the code

<?php
include("dbconnect.php");
$sitex = $_GET["sitex"];
$plugx = $_GET['plugx'];

$query1 = "UPDATE sites SET `out` = `out` +1, `totout` = `totout` +1 , `balance` = `balance` + 1 WHERE `site` = '$sitex' ";
mysql_query($query1) or die('Error, insert query failed. ERROR: '. mysql_error());


header("Location: $plug"); /* Redirect browser */

?>

Im guessing this is a pretty easy fix.

Thanks.

Well fisrt off ytour get is retreiving names that don't have an x in the yet you put it at the end...

Can you give us more of an idea what the forbidden error is. Either a screen shot or an exact copy of the text displayed.

Thanks.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.