0

hi ,

I am working on testing some scripts .. But there are lots of errors i am facing ..

the common error is Parse / syntax

Parse error: syntax error, unexpected '(' ..

This is the the line which is currently giving errors while executing .

md5("som3_admin",$username)()setcookie$password$_POST$username$_POST;

plz help

thnx

Marshal

2
Contributors
13
Replies
14
Views
6 Years
Discussion Span
Last Post by marshal_ramdev
0

wouldnt it be

md5("som3_admin",$username)setcookie($password$_POST$username$_POST);

im not sure what your doing here

$password$_POST$username$_POST

0

wouldnt it be

md5("som3_admin",$username)setcookie($password$_POST$username$_POST);

im not sure what your doing here

$password$_POST$username$_POST

WEll i have edited it now it is giving me

Parse error: syntax error, unexpected T_STRING

I am not good in terms of PHP :( .. as far i know it is a call function .. but it seems to be wrong

0

first i need to know what you are doing here

$password$_POST$username$_POST

second i think that you need to read up on the setcookie in php.

http://php.net/manual/en/function.setcookie.php

the set cookie needs to have this

setcookie("name", "value", "expire")

also your line of code proably has the problem that inside of the setcookie() you dont have the values wrapped in "". like you have in the md5("som3_admin")

0

should i post all the code here ?? so that you can see ..

and i said i \ain't know php .. i have files which i am testing and these error i am getting

0
<?php
header("Location:index.php");

md5("som3_admin",$username);setcookie($password$_POST$username$_POST);
md5("som3_pass",$password)()setcookie;
header("Location:index.php");
$_COOKIE;
$_COOKIE;
header("Location:index.php");
header("Location:install.php");
echo "[Obfuscated]0D 0A 3C 6C 69 6E 6B 20 68 72 65 66 3D 22 73 74 79 6C 65 2E 63 73 73 22 20 72 65 6C 3D 22 73 74 79 6C 65 73 68 65 65 74 22 20 74 79 70 65 3D 22 74 65 78 74 2F 63 73 73 22 3E 0D 0A 0D 0A ";
echo "<s";
echo "tyle>
\n{margin:0; padding:0;}
\n</style> 
\n";
echo "<s";
echo "cript language="JavaScript">
\nfunction openBrWindow(theURL,winName) 
\n{ //v2.0
\nwindow.open(theURL,winName,'width=550,height=550,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0');
\n}
\n
\n</script>
\n
\n<table width="100%"  border="0" cellspacing="0" cellpadding="0">
\n
\n  <tr>
\n    <td width="14">&nbsp;</td>
\n    <td>&nbsp;</td>
\n    <td>&nbsp;</td>
\n    <td width="19">&nbsp;</td>
";
echo "\n    <td>&nbsp;</td>
\n    <td>&nbsp;</td>
\n    <td width="17">&nbsp;</td>
\n  </tr>
\n  <tr>
\n    <td height="33">&nbsp;</td>
\n    <td colspan="5">";
echo "<s";
echo "pan class="pagetable_activecell">Hello Admin!!</span> Welcome back. Did you check the <a href="ppc-admin-to-do.php" class="mainmenu">";
echo "<s";
echo "trong>TO DO page</strong></a> today?</td>
\n    <td>&nbsp;</td>
\n  </tr>
\n  <tr>
\n
\n    <td height="116">&nbsp;</td>
\n
\n    <td valign="top" width="90">";
echo "<s";
echo "pan class="main_head"><img src="images/advertiser.gif"  align="absmiddle"></span></td>
\n
\n    <td valign="top" width="287">";
echo "<s";
echo "pan class="main_head" >Advertisers</span>
\n	<a href="javascript:;" onClick="openBrWindow('help_admin.php?id=1','template')" ><img src="images/help.gif" width="18" height="18" border="0"></a><br />
\n      <br />
\n<div style="padding-bottom:2px;"><img src="images/1rightarrow.gif" width="10" height="10" align="absmiddle"> <a href="ppc-view-users.php" class="mainmenu">Active  Advertisers (";
echo echo_one("select count(*) from ppc_users where status=1 ")echo ")</a>  </div>
\n   <div style="padding-bottom:2px;"><img src="images/1rightarrow.gif" width="10" height="10" align="absmiddle"> <a href="ppc-view-blocked-users.php" class="mainmenu">Blocked  Advertisers ("echo echo_one("select count(*) from ppc_users where status='0' ")echo ")</a></div>
\n   <div style="padding-bottom:4px;"><img src="images/1rightarrow.gif" width="10" height="10" align="absmiddle"> <a href="ppc-view-pending-users.php" class="mainmenu">Pending  Advertisers ("echo echo_one("select count(*) from ppc_users where status='-1' ")echo ")</a></div>   
\n  <div style="padding-bottom:2px;"><img src="images/1rightarrow.gif" width="10" height="10" align="absmiddle"> <a href="ppc_search_user.php"  class="mainmenu">Search Advertisers</a></div>    </td>
\n    <td>&nbsp;</td>
\n
\n    <td width="97" valign="top">"echo "<s"echo "pan class="main_head"></span><br/>
\n    <img src="images/publisher.gif" height="80" width="80" align="absmiddle" /
Return (1);
?>

all code is just messed up :(

0

yes i can see that there are A LOT of problems with this.

Did you code this?

first why do you have multiple headers?
- the headers you have are to redirect the page to somewhere else. so the below code never gets executed

you have echos in echos.

you are echoing out your query strings not executing them

I dont think that you have a proper understanding of what md5 actually does or even setcookie.

your long hex code only reads out this. <link href="style.css" rel="stylesheet" type="text/css">

why are you returning 1 at the bottom

you dont need all those \n

now i have cleaned up the code a little bit but i didnt really fix anything. If i did there really wouldnt be a learning process here.

<?php
header("Location:index.php");

md5("som3_admin",$username);
setcookie($password$_POST$username$_POST);
md5("som3_pass",$password)()setcookie;
header("Location:index.php");
$_COOKIE;
$_COOKIE;
header("Location:index.php");
header("Location:install.php");
echo '<link href="style.css" rel="stylesheet" type="text/css">
';
echo "<style>
{margin:0; padding:0;}
</style> 
";
echo '<script language="JavaScript">
function openBrWindow(theURL,winName) 
{ //v2.0
window.open(theURL,winName,\'width=550,height=550,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0\');
}
</script>';

echo '
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="14">&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td width="19">&nbsp;</td>
	<td>&nbsp;</td>
    <td>&nbsp;</td>
    <td width="17">&nbsp;</td>
  </tr>
  <tr>
    <td height="33">&nbsp;</td>
    <td colspan="5">";
<span class="pagetable_activecell">Hello Admin!!</span> Welcome back. Did you check the <a href="ppc-admin-to-do.php" class="mainmenu">
<strong>TO DO page</strong></a> today?</td>
    <td>&nbsp;</td>
  </tr>
  <tr>

    <td height="116">&nbsp;</td>

    <td valign="top" width="90">";
<span class="main_head"><img src="images/advertiser.gif"  align="absmiddle"></span></td>

    <td valign="top" width="287">";
<span class="main_head" >Advertisers</span>
	<a href="javascript<b></b>:;" onClick="openBrWindow(\'help_admin.php?id=1\',\'template\')" ><img src="images/help.gif" width="18" height="18" border="0"></a><br />
      <br />
<div style="padding-bottom:2px;"><img src="images/1rightarrow.gif" width="10" height="10" align="absmiddle"> <a href="ppc-view-users.php" class="mainmenu">Active  Advertisers (';


//what is this
echo 'echo_one("select count(*) from ppc_users where status=1 ")echo ")</a>  </div>
   <div style="padding-bottom:2px;"><img src="images/1rightarrow.gif" width="10" height="10" align="absmiddle"> <a href="ppc-view-blocked-users.php" class="mainmenu">Blocked  Advertisers ("echo echo_one("select count(*) from ppc_users where status='0' ")echo ")</a></div>
   <div style="padding-bottom:4px;"><img src="images/1rightarrow.gif" width="10" height="10" align="absmiddle"> <a href="ppc-view-pending-users.php" class="mainmenu">Pending  Advertisers ("echo echo_one("select count(*) from ppc_users where status='-1' ")echo ")</a></div>   
  <div style="padding-bottom:2px;"><img src="images/1rightarrow.gif" width="10" height="10" align="absmiddle"> <a href="ppc_search_user.php"  class="mainmenu">Search Advertisers</a></div>    </td>
    <td>&nbsp;</td>';

    echo '<td width="97" valign="top">"echo "<s"echo "pan class="main_head"></span><br/>
    <img src="images/publisher.gif" height="80" width="80" align="absmiddle" />';
Return (1);
?>

Edited by itisnot_me: n/a

0

yes it is a part of a script which i have

i ain't know PHP language :( for sure , i haven't coded it.

thanks itisnot_me , at least you are helping me out .

I ran while updating the latest code you sent

it point out the error

Parse error: syntax error, unexpected T_VARIABLE on LINE 5 that is :-

setcookie($password$_POST$username$_POST);

thnx

0

ok so it looks like you are trying to md5 hash the username and the password then set a cookie for it. if i am correct then you would need to do it this way

$encryptusername = md5($username);
$encryptpassword = md5($password);
setcookie("usernamecookie", $encryptusername);
setcookie("passwordcookie", $encryptpassword);

now im not an expert at cookies. i use sessions. but from what i read from the php manual that is the right way to do a cookie.

I would seriously start reading beginner tuts or get a book. Maybe php for dummies. Not saying you are lol

here is a tut for cookies http://net.tutsplus.com/tutorials/javascript-ajax/an-introduction-to-cookies/

and you can start learning php here http://www.w3schools.com/php/default.asp

0

ok so it looks like you are trying to md5 hash the username and the password then set a cookie for it. if i am correct then you would need to do it this way

$encryptusername = md5($username);
$encryptpassword = md5($password);
setcookie("usernamecookie", $encryptusername);
setcookie("passwordcookie", $encryptpassword);

now im not an expert at cookies. i use sessions. but from what i read from the php manual that is the right way to do a cookie.

I would seriously start reading beginner tuts or get a book. Maybe php for dummies. Not saying you are lol

here is a tut for cookies http://net.tutsplus.com/tutorials/javascript-ajax/an-introduction-to-cookies/

and you can start learning php here http://www.w3schools.com/php/default.asp

To which code should i replace it ??

well i also think i should start reading PHP .. and i think i am now ;) lol

thnx

0

replace this with it

header("Location:index.php");

md5("som3_admin",$username);setcookie($password$_POST$username$_POST);
md5("som3_pass",$password)()setcookie;
header("Location:index.php");
$_COOKIE;
$_COOKIE;
header("Location:index.php");
header("Location:install.php");

you dont need the headers.

Edited by itisnot_me: n/a

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.