simple php script fix

Reply

Join Date: Nov 2008
Posts: 2
Reputation: elajam is an unknown quantity at this point 
Solved Threads: 0
elajam elajam is offline Offline
Newbie Poster

simple php script fix

 
0
  #1
May 31st, 2009
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

  1. <?php
  2. include("dbconnect.php");
  3. $sitex = $_GET["sitex"];
  4. $plugx = $_GET['plugx'];
  5.  
  6. $query1 = "UPDATE sites SET `out` = `out` +1, `totout` = `totout` +1 , `balance` = `balance` + 1 WHERE `site` = '$sitex' ";
  7. mysql_query($query1) or die('Error, insert query failed. ERROR: '. mysql_error());
  8.  
  9.  
  10. header("Location: $plug"); /* Redirect browser */
  11.  
  12. ?>


Im guessing this is a pretty easy fix.

Thanks.
Last edited by peter_budo; Jun 1st, 2009 at 2:27 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 340
Reputation: Josh Connerty is an unknown quantity at this point 
Solved Threads: 26
Josh Connerty's Avatar
Josh Connerty Josh Connerty is offline Offline
Posting Whiz

Re: simple php script fix

 
0
  #2
May 31st, 2009
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.
Posts should be like mini-skirts, long enough to cover enough, but not too long that you cover too much.

My Liveperson: http://liveperson.com/josh-connerty/
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC