Jump to content

peranha

Members
  • Posts

    878
  • Joined

  • Last visited

Everything posted by peranha

  1. peranha

    Whats wrong

    Do you get any errors??
  2. It has been happening for about a month, but I dont think it is that often, maybe 1 in 20-25 requests. I was going to see on the hour change if that makes a difference or not.
  3. isnt alt='' when the image cannot be found, it puts that in its place???
  4. Why is it taking soo long for pages to load. I am getting pages in like 60 seconds. I am on a 8MB cable connection, so it isnt that. All other pages work fine, just this site loads real slow. Anyone else having this issue???
  5. you would do the check on the editinvent page, and display what you want according to the check.
  6. They may have doctors for this type of thing
  7. Try this $sql = "INSERT INTO news (username, date, title, post) VALUES ('{$row['realname']}', '$date', '$addtitle', '$addblog')"; Added the {} to the value
  8. Thanks, Frames work great.
  9. I think the reason you are getting the errors is because you are not checking if the submit button is being pressed first. Something like if (isset($_POST['Submit'])) { // Code goes here }
  10. I am woundering if there is anyway to embed a website into another. My work website uses a non standard port, I am woundering if I can "embed" it in my website to access it from behind firewalls, or how this can be done so I can access it when needed.
  11. How can I change the date from the database of 2007-10-31 to Wed, 31 Oct 2007
  12. Put the items in quotes insert into jos_ccnewsletter_subscribers(id,name,email,plaintext,enabled,sdate) values('68','name@domain.com','name','0','0','2008-09-22 17:14:07');
  13. You may want SELECT * FROM reviews Order by m_index DESC LIMIT 0,3
  14. I have this in an htaccess file with this in it AddType application/x-httpd-php .xml I have AllowOverride All set in my apache config file. I am trying to set xml files to process as php for a dynamic rss feed. Here is my code, and it does not work, not sure why. <?php header('Content-type: text/xml'); ?> <?php require ("../includes/vital.php"); ?> <rss version="2.0"> <channel> <title>peranha.dyndns.org</title> <description>Peranhas Test Website</description> <link>http://peranha.dyndns.org/</link> <copyright>Copyright Peranha</copyright> <?php // open connection $connection = mysql_connect($server, $user, $pass) or die ("Unable to connect!"); // select database mysql_select_db($db) or die ("Unable to select database!"); $query = "SELECT commid, subject, comment, datestamp, timestamp FROM feed ORDER BY commid DESC LIMIT 0,15"; $result = mysql_query($query) or die (mysql_error()); if (mysql_num_rows($result) > 0) { while($row = mysql_fetch_row($result)) { ?> <item> <title> <?php echo htmlentities(strip_tags($row['1'])); ?></title> <description> <?php echo htmlentities(strip_tags($row['2'],'ENT_QUOTES')); ?></description> <link>http://peranha.dyndns.org/test.php?id=<?php echo $row['0']; ?></link> <pubDate> <?php echo $row['3'] . " " . $row['4']; ?></pubDate> </item> <?php } } // close connection mysql_close($connection); ?> </channel> </rss> If I save it as a php file, it will display fine. PS, I have reset the apache server.
  15. <?php session_start(); error_reporting(E_ALL); $host = "localhost"; // Host name $username = "bucketho_****"; // <-- Mysql username MAKE SURE THIS IS SET! $password = "*****"; // <-- Mysql password MAKE SURE THIS IS SET! $db_name = "bucketho_*****"; // <-- Database name CHANGE THIS TOO! $tbl_name = "members"; // Table name // Connect to server and select databse. mysql_connect($host, $username, $password)or die("cannot connect"); mysql_select_db($db_name)or die("cannot select DB"); if ($_GET['pass_change_form'] == true && $_SESSION['is_valid'] == true){ $new_pass1 = mysql_real_escape_string($_POST['pass1']); $new_pass2 = mysql_real_escape_string($_POST['pass2']); $old_pass = mysql_real_escape_string($_POST['old_pass']); $username = $_SESSION['username']; $sql = "SELECT COUNT(*) AS `total_found` FROM `members` WHERE `username`='$username' AND `password`='$old_pass' LIMIT 1;"; $result = mysql_query($sql) or die (mysql_error()); $row = mysql_fetch_assoc($result); $total_found = $row['total_found']; if (($total_found == 1) && ($new_pass1 == $new_pass2)){ $sql = "UPDATE `members` SET `password`='$new_pass1' WHERE `username`='$username';"; mysql_query($sql) or die (mysql_error()); header("location:./"); exit(); } else{ print "Error processing Password change. Please try again"; } } if ($_GET['pass_change_form'] == true && $_SESSION['is_valid'] == true){ ?> <form method="POST" action="?change_pass=true"> <table border="0"> <tr> <td>Old Password:</td> <td><input type="password" name="old_pass"></td> </tr> <tr> <td>New Password:</td> <td><input type="password" name="pass1"></td> </tr> <tr> <td>New Password(Again):</td> <td><input type="password" name="pass2"></td> </tr> <tr> <td> </td> <td><input type="submit" value="Submit"></td> </tr> </table> </form> <?php } else{ header("location:./"); exit(); } Try that, had some things mixed up.
  16. <?php session_start(); error_reporting(E_ALL); $host = "localhost"; // Host name $username = "bucketho_****"; // <-- Mysql username MAKE SURE THIS IS SET! $password = "*****"; // <-- Mysql password MAKE SURE THIS IS SET! $db_name = "bucketho_*****"; // <-- Database name CHANGE THIS TOO! $tbl_name = "members"; // Table name // Connect to server and select databse. mysql_connect($host, $username, $password)or die("cannot connect"); mysql_select_db($db_name)or die("cannot select DB"); if ($_GET['change_pass_form'] == true && $_SESSION['is_valid'] == true){ $new_pass1 = mysql_real_escape_string($_POST['pass1']); $new_pass2 = mysql_real_escape_string($_POST['pass2']); $old_pass = mysql_real_escape_string($_POST['old_pass']); $username = $_SESSION['username']; $sql = "SELECT COUNT(*) AS `total_found` FROM `members` WHERE `username`='$username' AND `password`='$old_pass' LIMIT 1;"; $result = mysql_query($sql) or die (mysql_error()); $row = mysql_fetch_assoc($result); $total_found = $row['total_found']; if (($total_found == 1) && ($new_pass1 == $new_pass2)){ $sql = "UPDATE `members` SET `password`='$new_pass1' WHERE `username`='$username';"; mysql_query($sql) or die (mysql_error()); header("location:./"); exit(); } else{ print "Error processing Password change. Please try again"; } } if ($_GET['change_pass_form'] == true && $_SESSION['is_valid'] == true){ ?> <form method="POST" action="?change_pass=true"> <table border="0"> <tr> <td>Old Password:</td> <td><input type="password" name="old_pass"></td> </tr> <tr> <td>New Password:</td> <td><input type="password" name="pass1"></td> </tr> <tr> <td>New Password(Again):</td> <td><input type="password" name="pass2"></td> </tr> <tr> <td> </td> <td><input type="submit" value="Submit"></td> </tr> </table> </form> <?php } else{ header("location:./"); exit(); } <?php error_reporting(E_ALL); $host="localhost"; // Host name $username="bucketho_****"; // Mysql username $password="*****"; // Mysql password $db_name="bucketho_****"; // Database name $tbl_name="members"; // Table name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // username and password sent from form $myusername=$_POST['myusername']; $mypassword=$_POST['mypassword']; // To protect MySQL injection (more detail about MySQL injection) $myusername = stripslashes($myusername); $mypassword = stripslashes($mypassword); $myusername = mysql_real_escape_string($myusername); $mypassword = mysql_real_escape_string($mypassword); $sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'"; $result=mysql_query($sql) or die (mysql_error()); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $myusername and $mypassword, table row must be 1 row if($count==1){ // Register $myusername, $mypassword and redirect to file "index.php" $_SESSION['username'] = $myusername; $_SESSION['is_valid'] = true; session_register("myusername"); session_register("mypassword"); header("location:index.php"); } else { header("location:login_failed.php"); } ?> Try those.
  17. <?php error_reporting(E_ALL); $host="localhost"; // Host name $username="bucketho_****"; // Mysql username $password="*****"; // Mysql password $db_name="bucketho_****"; // Database name $tbl_name="members"; // Table name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // username and password sent from form $myusername=$_POST['myusername']; $mypassword=$_POST['mypassword']; // To protect MySQL injection (more detail about MySQL injection) $myusername = stripslashes($myusername); $mypassword = stripslashes($mypassword); $myusername = mysql_real_escape_string($myusername); $mypassword = mysql_real_escape_string($mypassword); $sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'"; $result=mysql_query($sql) or die (mysql_error()); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $myusername and $mypassword, table row must be 1 row if($count==1){ // Register $myusername, $mypassword and redirect to file "index.php" $_SESSION['username'] = $myusername; $_SESSION['is_valid'] = true; session_register("myusername"); session_register("mypassword"); header("location:index.php"); } else { header("location:login_failed.php"); } ?> <?php session_start(); error_reporting(E_ALL); $host = "localhost"; // Host name $username = "bucketho_****"; // <-- Mysql username MAKE SURE THIS IS SET! $password = "*****"; // <-- Mysql password MAKE SURE THIS IS SET! $db_name = "bucketho_*****"; // <-- Database name CHANGE THIS TOO! $tbl_name = "members"; // Table name // Connect to server and select databse. mysql_connect($host, $username, $password)or die("cannot connect"); mysql_select_db($db_name)or die("cannot select DB"); if ($_GET['change_pass'] == true && $_SESSION['is_valid'] == true){ $new_pass1 = mysql_real_escape_string($_POST['pass1']); $new_pass2 = mysql_real_escape_string($_POST['pass2']); $old_pass = mysql_real_escape_string($_POST['old_pass']); $username = $_SESSION['username']; $sql = "SELECT COUNT(*) AS `total_found` FROM `members` WHERE `username`='$username' AND `password`='$old_pass' LIMIT 1;"; $result = mysql_query($sql) or die (mysql_error()); $row = mysql_fetch_assoc($result); $total_found = $row['total_found']; if (($total_found == 1) && ($new_pass1 == $new_pass2)){ $sql = "UPDATE `members` SET `password`='$new_pass1' WHERE `username`='$username';"; mysql_query($sql) or die (mysql_error()); header("location:./"); exit(); } else{ print "Error processing Password change. Please try again"; } } if ($_GET['pass_change_form'] == true && $_SESSION['is_valid'] == true){ ?> <form method="POST" action="?change_pass=true"> <table border="0"> <tr> <td>Old Password:</td> <td><input type="password" name="old_pass"></td> </tr> <tr> <td>New Password:</td> <td><input type="password" name="pass1"></td> </tr> <tr> <td>New Password(Again):</td> <td><input type="password" name="pass2"></td> </tr> <tr> <td> </td> <td><input type="submit" value="Submit"></td> </tr> </table> </form> <?php } else{ header("location:./"); exit(); } try that, and see if you server is kicking out any errors.
  18. yes, and in the checklogin.php change the line back to $_SESSION['is_valid'] = true;
  19. Delete the lines I told you to put in from change_password.php echo $_SESSION['is_valid']; exit(); Also change the $_SESSION['is_valid'] = "true"; back to $_SESSION['is_valid'] = true; in checklogin.php
  20. I am getting db errors after I login in. In db.php and functions.php
  21. <?php $host="localhost"; // Host name $username="bucketho_****"; // Mysql username $password="*****"; // Mysql password $db_name="bucketho_****"; // Database name $tbl_name="members"; // Table name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // username and password sent from form $myusername=$_POST['myusername']; $mypassword=$_POST['mypassword']; // To protect MySQL injection (more detail about MySQL injection) $myusername = stripslashes($myusername); $mypassword = stripslashes($mypassword); $myusername = mysql_real_escape_string($myusername); $mypassword = mysql_real_escape_string($mypassword); $sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'"; $result=mysql_query($sql); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $myusername and $mypassword, table row must be 1 row if($count==1){ // Register $myusername, $mypassword and redirect to file "index.php" $_SESSION['username'] = $myusername; $_SESSION['is_valid'] = "true"; session_register("myusername"); session_register("mypassword"); header("location:index.php"); } else { header("location:login_failed.php"); } ?> <?php session_start(); echo $_SESSION['is_valid']; exit(); $host = "localhost"; // Host name $username = "bucketho_****"; // <-- Mysql username MAKE SURE THIS IS SET! $password = "*****"; // <-- Mysql password MAKE SURE THIS IS SET! $db_name = "bucketho_*****"; // <-- Database name CHANGE THIS TOO! $tbl_name = "members"; // Table name // Connect to server and select databse. mysql_connect($host, $username, $password)or die("cannot connect"); mysql_select_db($db_name)or die("cannot select DB"); if ($_GET['change_pass'] == true && $_SESSION['is_valid'] == true){ $new_pass1 = mysql_real_escape_string($_POST['pass1']); $new_pass2 = mysql_real_escape_string($_POST['pass2']); $old_pass = mysql_real_escape_string($_POST['old_pass']); $username = $_SESSION['username']; $sql = "SELECT COUNT(*) AS `total_found` FROM `members` WHERE `username`='$username' AND `password`='$old_pass' LIMIT 1;"; $result = mysql_query($sql); $row = mysql_fetch_assoc($result); $total_found = $row['total_found']; if (($total_found == 1) && ($new_pass1 == $new_pass2)){ $sql = "UPDATE `members` SET `password`='$new_pass1' WHERE `username`='$username';"; mysql_query($sql); header("location:./"); exit(); } else{ print "Error processing Password change. Please try again"; } } if ($_GET['pass_change_form'] == true && $_SESSION['is_valid'] == true){ ?> <form method="POST" action="?change_pass=true"> <table border="0"> <tr> <td>Old Password:</td> <td><input type="password" name="old_pass"></td> </tr> <tr> <td>New Password:</td> <td><input type="password" name="pass1"></td> </tr> <tr> <td>New Password(Again):</td> <td><input type="password" name="pass2"></td> </tr> <tr> <td> </td> <td><input type="submit" value="Submit"></td> </tr> </table> </form> <?php } else{ header("location:./"); exit(); }
  22. no, on your check login page, you set $_SESSION['is_valid'] = true; if the user is logged in. right here // Register $myusername, $mypassword and redirect to file "index.php" $_SESSION['username'] = $myusername; $_SESSION['is_valid'] = true; session_register("myusername"); session_register("mypassword"); change it there
  23. On the checklogin.php page change $_SESSION['is_valid'] = true; to $_SESSION['is_valid'] = "true"; and try that.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.