-
Posts
1,437 -
Joined
-
Last visited
Never
Posts posted by papaface
-
-
erm are you joking?
Don't you think we have anything better to do that look through your code?
Post specific pieces of code with a proper error and line number! -
[code=php:0]
<?php
$string = "aabc221";
$change = ereg_replace("[A-Za-z]", "", $string);
echo $change
?>
[/code]
-
Not only that but you need to use $_FILES['picture'] instead of $_POST
-
Ah I have found the error:
was:
[code] $_SESSION["username"] = $_POST["username"];
$_SESSION["password"] = $_POST["password"][/code]
should have been:
[code] $_SESSION["username"] = $_POST["username"];
$_SESSION["password"] = $encpass;[/code]
Thanks for all of your help guys! -
Argh I must have changed something in one of these files because now it isnt working for me either on my localmachine, when it was working before.
-
If you look checklogin.php is included on every page so session_start() is included on every page...
-
There must be someone that can help me :(
-
Bump again
-
Please help :(
-
I should have included the checklogin.php file:
[code]<?php
require ('connect.php') ;
session_start();
if (!isset($_SESSION["username"]) || !isset($_SESSION["password"]))
{
$logged_in = 0;
return;
}
else
{
$pass = mysql_query("select password from users where username='".$_SESSION['username']."'",$con);
list($password) = mysql_fetch_array($pass);
if(mysql_num_rows($pass) != 1)
{
$logged_in = 0;
unset($_SESSION['username']);
unset($_SESSION['password']);
}
if ($password = $_SESSION["password"])
{
$logged_in = 1;
}
else
{
$logged_in = 0;
unset($_SESSION['username']);
unset($_SESSION['password']);
}
}
?>[/code] -
Hello,
My script works on everyones server so far except one person.
The sessions arent being set.
Is there anything I can add to the below code to set the session if $_SESSION["username"] and $_SESSION["password"] arent set?
[code]<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
require("../includes/checker.php");
require ('../includes/connect.php') ;
require ('../includes/checklogin.php') ;
if ($logged_in == 1)
{
echo "You are already logged in ".$_SESSION["username"];
echo "<br>" . '<a href="submissions.php">' . "Click here to view pending Link Exchanges" . "</a>";
echo "<br>" . '<a href="approved.php">' . "Click here to view approved(active) Link Exchanges" . "</a>";
echo "<br>" . '<a href="logout.php">' . "Click here to logout!" . "</a>";
exit;
}
if (isset($_POST["submit"]))
{
if(!$_POST["username"] | !$_POST["password"])
{
die("You did not enter the required fields");
}
$check = mysql_query("select username,password from users where username='".$_POST["username"]."'") or die ("error" . mysql_error());
list($username,$password) = mysql_fetch_array($check);
$_POST["username"] = stripslashes($_POST["username"]); //strip the slashes
if (!$_POST["username"] == $username)
{
echo "The username you entered does not exist";
exit;
}
$_POST["password"] = stripslashes($_POST["password"]); //strip the slashes
$encpass = md5($_POST["password"]);
if ($encpass != $password)
{
die("Sorry you entered the wrong password");
}
else
{
$_SESSION["username"] = $_POST["username"];
$_SESSION["password"] = $_POST["password"];
echo "You are now logged in " . $_SESSION["username"];
echo "<br>" . '<a href="submissions.php">' . "Click here to view pending Link Exchanges" . "</a>";
echo "<br>" . '<a href="approved.php">' . "Click here to view approved(active) Link Exchanges" . "</a>";
echo "<br>" . '<a href="logout.php">' . "Click here to logout!" . "</a>";
mysql_close($con);
}
}
else
{
echo '<table width="100%" height="100%" cellpadding="2" cellspacing="2" border="0">
<tr>
<td align="center" valign="middle">
<form action="'. $_SERVER['PHP_SELF'] .'" method="post" enctype="application/x-www-form-urlencoded">
Username: <input name="username" type="text" />
Password: <input name="password" type="password" />
<input name="submit" type="submit" value="Submit" />
</form>
</td>
</tr>
</table>';
}
?>[/code] -
Sorry for bumping, but advice/help would be appreciated.
-
I have tried:
[code]<?php
$checkurl = file("http://localhost/ee/admin/reciprocaltest.html");
$checkurl = array_map("trim", $checkurl);
$check = '<a href="http://www.domain.com/enter.php?refer=1">';
if(in_array($check, $checkurl))
{
echo "link found";
}
else
{
echo "link NOT found";
}
?>[/code] But it still doesnt work. -
Any help please? ;D
-
Ive tried to go this but I cant get it to work.
The code i have is:
reciprocalcheck.php:
[code]<?php
$checkurl = file("http://localhost/ee/admin/reciprocaltest.html");
$check = '<a href="http://www.domain.com/enter.php?refer=1">';
if(in_array($check, $checkurl))
{
echo "link found";
}
else
{
echo "link NOT found";
}
?>[/code]
reciprocaltest.html:
[code]<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<a href="http://www.domain.com/enter.php?refer=1">Your Site Name Here</a>
</body>
</html>[/code]
Why isnt this working? -
Oh well, I said it. your SQL is commented out:
should be:
[code]// now we insert it into the database
$insert = "INSERT INTO users (username, password) VALUES ('".$_POST['username']."', '".$_POST['pass']."')";[/code] -
oops okay I didnt see the SQL above, i thought it was a comment. Ill take another look
Why has modify post been taken off?! -
No the error is right there:
[code]VALUES ('".$_POST['username']."', '".$_POST['pass']."')";[/code]
should be:
[code]VALUES ('".$_POST['username']."', '".$_POST['pass']."');[/code] -
This should do the job:
[code]
$contentFromPost = $_POST['proj_content'];
$contentReplaceThis = " ";
$contentReplaceWithThis = " ";
echo ereg_replace($contentReplaceThis,$contentReplaceWithThis,$contentFromPost);[/code] -
:)
Thanks for your help -
Yes, that has worked :D
What did you do? -
Possitive:
domainchecker.txt
----
localhost
domain.com
site.com
----
??? -
It works for every other domain. Just not localhost.
-
"localhost"
Problem with Error use??!
in Third Party Scripts
Posted