0

Hello,
I'm running a PTC website in which I'm unable to edit the referral field.

Here is the code:

Referrer (if any):<br>
<input type="text" size="25" maxlength="15" name="referer" class="form" autocomplete="off" value="<? if($_POST["referer"]) { print $_POST["referer"]; } else { echo securedata($_GET["r"]); } if($_POST['referer'] or $_GET['r']) { print "\" readonly disabled"; } ?>">

After session_start() function, this is the code written as well;

session_start();

if($_GET['r'] and !$_SESSION['r']) { $_SESSION['r'] = $_GET['r']; }
if(($_SESSION['r'] and !$_GET['r']) or (($_SESSION['r'] and $_GET['r']) and $_GET['r'] != $_SESSION['r'])) { $_GET['r'] = $_SESSION['r']; }

I tried different ways but unable to do what I want to.

Kindly someone give me the solution.

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by compusolver
0

Hello,
I'm running a PTC website in which I'm unable to edit the referral field.

Here is the code:

Referrer (if any):<br>
<input type="text" size="25" maxlength="15" name="referer" class="form" autocomplete="off" value="<? if($_POST["referer"]) { print $_POST["referer"]; } else { echo securedata($_GET["r"]); } if($_POST['referer'] or $_GET['r']) { print "\" readonly disabled"; } ?>">

After session_start() function, this is the code written as well;

session_start();

if($_GET['r'] and !$_SESSION['r']) { $_SESSION['r'] = $_GET['r']; }
if(($_SESSION['r'] and !$_GET['r']) or (($_SESSION['r'] and $_GET['r']) and $_GET['r'] != $_SESSION['r'])) { $_GET['r'] = $_SESSION['r']; }

I tried different ways but unable to do what I want to.

Kindly someone give me the solution.

I'm not sure I understand your question, but the first thing that pops out here is the use of double-quotes within your value parameter. The first PHP double-quote is going to close your "value" double-quote and destroy your code logic. Change the PHP quotes to single-quotes or escape them to avoid this bug.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.