Jump to content

RussellReal

Members
  • Posts

    1,773
  • Joined

  • Last visited

Everything posted by RussellReal

  1. and don't forget to make it reset if user enters in right name/pw. did that in my example
  2. try making a variable in the session like 'tries' for example: function procLogin(){ global $session, $form; /* Login attempt */ if (!isset($_SESSION['tries'])) $_SESSION['tries'] = 0; if ($_SESSION['tries'] < 5) { $retval = $session->login($_POST['user'], $_POST['pass'], isset($_POST['remember'])); /* Login successful */ if ($retval) { $_SESSION['tries'] = 0; header("Location: admin/admin.php"); } /* Login failed */ else{ else $_SESSION['tries'] = 1; $_SESSION['value_array'] = $_POST; $_SESSION['error_array'] = $form->getErrorArray(); header("Location: adminlogin.php"); } } else { header("Location: TooManyTries.php"); } } ?>
  3. SELECT * FROM `vehicles` WHERE `model` = '{$model}' AND `stock` != '{$stock}' SELECT * FROM `vehicles` WHERE `price` >= ($price - 2000) AND `price` <= ($price + 2000) both should work
  4. the hosts have changed? passwords changed?
  5. what field r u sorting by? try this as your query replace `field` with the field name SELECT * FROM `files` ORDER BY `field` DESC
  6. you could probably do this with some sort of free blog software, and locate their config files in order to alter the db names, then when sum1 adds a blog, you unpack another blog into another directory.. start a new db with php and then change the config file for that installation, but you'd need a webhost with UNLIMITED mysql databases, UNLIMITED files, and probably atleast 50gb of storage space.. and probably a dedicated server would be your best, and only allow like 50 blogs per server as to minimize lag or 100 blogs or 200 blogs per server.. w.e
  7. ok.. heres how I would do it.. <?php // edit_link.php?id=link_id session_start(); if ($_SESSION['user_id']) { //assuming this is your simple way of checking if the user is logged in if ($id = (int) $_GET['id']) { // checks if GET 'id' is a number include('contentdb.php'); $res = mysql_query("SELECT * FROM links WHERE links.user_id = '{$_SESSION['user_id']}' AND links.id = '{$id}'"); if ($row = mysql_fetch_assoc($res)) { // do whatever you'd do to allow the user to edit it using $row for the data from the query } } } ?> and inside the file you're showing us.. just display the 'edit links' with the html resembling something like: <a href="edit_link.php?id=link_id">EDIT</a> and when they click that, redirect the iframe with like target="iframe_name" in the a tag.. and then you don't rly need to attach the link id in the sessions, access them with each request thru GET
  8. add me to MSN or AIM MSN/EMAIL: RussellonMSN@hotmail.com AIM: RussellCrevatas
  9. PDO not set up in your php installation.. to be honest I never used PDO or know what it is, but assuming it comes with PHP, the webhosting company you're using probably disables this functionality for whatever reasons.. maybe contact tech support.
  10. lets say I have a table and it has the following results: __________________________________________________ ID | STRING -------------------------------------------------- 1 | Hey, how are you? 2 | Hey, you said 'hey'! and I wanted to use mysql regex to match 'hey' for example: SELECT * FROM `table` WHERE `STRING` REGEXP 'hey' I know I could do this other ways.. but I want to know how I can order by the number of 'hey's in the string.. because reading 150 something rows into php and then doing the sorting in PHP will be retarded.. it must be possible I just searched mysql.com up and down and havn't found anything of use.. Thanks guys, appreciate the time
  11. is /players/ an actual directory? in which case you'd want to put this htaccess into the /players/ directory RewriteEngine on RewriteRule ^stats/(.*)$ stats.php?player=$1
  12. oo thanx, I wrote it in notepad, I usually write my code in notepad++ it highlights parenthesis ty tho
  13. u should be able to use simplexml_load_string assuming google gives you XML as a return and then probably do $xml->latitude
  14. try sumfin like this.. <? // Start a session session_start(); // Sends the user to the login-page if not logged in if (!session_is_registered('member_ID')) header('Location: index.php?msg=requires_login'); include("dbinfo.inc.php"); mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $user = $_SESSION["member_ID"]; $username = $_POST[$user]; $password = $_POST['password']; $newpassword = sha1($_POST['newpassword']); $confirmnewpassword = sha1($_POST['confirmnewpassword']); if (($password) && ($_POST['newpassword']) && ($_POST['confirmnewpassword']) { if($newpassword=$confirmnewpassword) $sql=mysql_query("UPDATE members SET user_password='$newpassword' where username='$user'"); if($sql) { echo "Your Password Has Been Changed."; } else { echo "The Passwords You Entered Do Not Match, Or You Have Not Entered A Password. Please Try Again."; } } else { echo "All forms must be filled in.."; } ?>
  15. Regular Expressions is a uhm.. part of most every major main stream language, such as PHP, MySQL, JavaScript, ActionScript, its basically a package I suppose you can call it, whatever it may be called RegEx was created to match common or 'regular' expressions, in the form of patterns.. example: /^he(?:y|llo)$/i to match 'hey' or 'hello' php's regular expression functions are preg_match and preg_match_all for global searches.. MySQL uses somewhat of a 'command' to tell mysql that it is expecting a regular expression SELECT * FROM `table` WHERE `field` REGEXP 'he(?:y|llo)'
  16. I'm sure there is, but your best bet would probably be to use js and flash with mapquest API.. and lat/long will be too much of a guess or estimate than an actual pin point location
  17. sorry about the double post but heres some contact information: Email/MSN: RussellonMSN@hotmail.com AIM: RussellCrevatas Add if Interested, or msg me here on these forums.. either way.. I'm @ your service whenever you need me.. I help for free, but seeing as you have no actual PHP code, I'm judging that you are looking for someone to code it for you, that is the reason I am OFFERING you my services.. I hope this doesn't break any board rules
  18. I could do this for you for $35 (my hourly rate, but I'll finish it in an hour)
  19. idk but try this: <?php $time = date('G'); if (in_array($time,range(4,11))) $theme = 'morning'; elseif (in_array($time,range(12,18))) $theme = 'afternoon'; elseif (in_array($time,array(19,20,21,22,23,0,1,2,3))) $theme = 'evening'; else $theme = 'default'; $css = 'css/'.$theme.'.css'; ?>
  20. $result is a MySQL Result resource.. how you actually access the data is simple: $row = mysql_fetch_assoc($result); then if u want to see the result do print_r($row);
  21. look into php freelancers.. I am one myself, and I could possibly create the search feature, pm me if you're interested
  22. yeh u did it wrong lol <?php $loop = 1; echo "<table width='864' border='5' align='center' bgcolor='#F4F4F4' bordercolor='#000000' fontcolor='#000000' cellspacing='5' cellpadding='5'>"; while ($newData = mysql_fetch_array($newStatement)) { $loop++; if ($loop % 2) $trcolor = 'blue'; else $trcolor = 'red'; echo "<tr bgcolor='$trcolor'>"; echo "<td>"; echo "<h3>"; echo "<br />"; echo "<font size='3' color='ff00d2'>"; echo "&nbsp &nbsp Commented By: &nbsp &nbsp"; echo $newData['Author']; echo "</font>"; echo "<ul>"; echo "<li>"; echo $newData['Comments']; //the actual text of the comment echo "</li>"; echo "</ul>"; ?>
  23. try sumfin like this: <?php $loop = 1; while (your condition) { $loop++; if ($loop % 2) $trcolor = 'blue'; else $trcolor = 'red'; } ?>
×
×
  • 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.