954,585 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

simple php script fix

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.

elajam
Newbie Poster
4 posts since Nov 2008
Reputation Points: 10
Solved Threads: 0
 

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.

Josh Connerty
Posting Whiz
342 posts since Apr 2009
Reputation Points: 31
Solved Threads: 27
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You