x-andeep
-
Posts
2 -
Joined
-
Last visited
Never
Posts posted by x-andeep
-
-
i am a beginerr in php..
and here is my code..which shows error in the querry line..
erro goes like this
Parse error: syntax error, unexpected T_STRING in C:\xampp\htdocs\restafinal\process_edit_page.php on line 56
and code goes like this..
echo part works well...that query line is the error line..please tell me whats the problem...
<?php //$id=$_GET["id"]; $id= $_GET['id']; $menu_name= $_POST['menu_name']; $position= $_POST['position']; $visible= $_POST['visible']; $note= $_POST['note']; $content= $_POST['content']; //echo part works well.. echo "menu_name"; echo $menu_name; echo "<br/>"; echo "position"; echo $position; echo "<br/>"; echo "visible"; echo $visible; echo "<br/>"; echo "note"; echo $note; echo "<br/>"; echo "id"; echo $id; echo $content; [b]$result = mysql_query(UPDATE page SET note =$note, nevigation = $menu_name WHERE id = $id,$connection)[/b] // test to see if the update occurred if (mysql_affected_rows() == 1) { // Success! } else { $message = "The page could not be updated."; $message .= "<br />" . mysql_error(); } ?>
Error in CMS login system with IE. IT WORKS FINE WITH CHROME.
in PHP Coding Help
Posted
FOR the CMS go to http://sandeepthapa.com.np/project/admin
and login in
username: user
pasword: 123456
with both Chrome and IE. pleease
and site is http://sandeepthapa.com.np/project/
it works fine with Chrome, but not with IE.
please help me
this is my first CMS . i am learning.. it
i use joommla templetefor design. oz i am not a designer
//..here is the code for process_login.php page
<?php require_once("includes/session.php"); ?><?php require_once("includes/connection.php"); ?><?php require_once("includes/functions.php"); ?><?php
if (logged_in()) {
redirect_to("content.php");
}
if (isset($_POST['submit']))
{
if(!$_POST['username'])
{
echo ' Make sure u type in username';
}
if( !$_POST['password'])
{
echo 'make sure you type password';
}
$username = trim(mysql_prep($_POST['username']));
$password = trim(mysql_prep($_POST['password']));
$hashed_password = sha1($password);
// Check database to see if username and the hashed password exist there.
$query = "SELECT id, username ";
$query .= "FROM users ";
$query .= "WHERE username = '{$username}' ";
//$query .= "AND hashed_password = '{$hashed_password}' ";
$query .= "AND hashed_password = '{$hashed_password}' ";
$query .= "LIMIT 1";
$result_set = mysql_query($query) or die(mysql_error());
if(!$result_set)
{die("Database connection failed: " . mysql_error());}
confirm_query($result_set);
if (mysql_num_rows($result_set) == 1) {
// username/password authenticated
// and only 1 match
$found_user = mysql_fetch_array($result_set);
//echo $found_user['id'];
$_SESSION['user_id'] = $found_user['id'];
$_SESSION['username'] = $found_user['username'];
//echo 'test query';
redirect_to("content.php");
}
}
else
{
echo 'error'.mysql_error();
}
?>
</body>
</html>