Jump to content

RaythMistwalker

Members
  • Posts

    292
  • Joined

  • Last visited

    Never

Everything posted by RaythMistwalker

  1. After being treated, what I believe to be, unfairly and rudely by a "guru" on this site and treated with disrespect by a "moderator" where they made me feel like I was stupid because they couldn't read what I was putting, I have decided to leave PHPFreaks. After 2 years of support and came a long way I am very disappointed in this result. Feel free to ban or delete my account cos i really don't care anymore.
  2. I actually did write it I just never knew they were called Quantifiers. My friend started me off with the bold tags and I went from their adjusting on where people can input.
  3. What are quantifiers? And I apologize but I never even realized that was against the rules since I had literally just deleted about 10 PM's recieved a year ago where people were asking me for help. But it is slightly frustrating when I request help on a forum where usually I get help no problem, and no one even bothers to reply when I get the same problem for a week+ straight.
  4. This would just result in a very messy code even if it does work. but I don't see why you have str_replace() inside str_replace()
  5. You can use an array: $search = array ('item1' , 'item2') $replace = array('replace1' , 'replace2') str_replace($search, $replace, $subject) If you have a second subject, just redo the str_replace line with $subject2 instead
  6. Question on this: Say I wanted to upgrade my current security system by taking the first 3 letters of a users username, and the last 3 letters of their entered password. putting these together then doing md5(Salt.Password.Salt2) (salt2 being a private constant word), then I save the original Salt in a separate database, and then do md5(Username.Salt2) would this massivly boost it compared to me doing this atm: Salt1 (Constant) Salt2 (Constant) Password = user input Password changed to: md5(Salt1.Password.Salt2)
  7. Escape your single quotes with \ first: someurl.com/this\'s_my_home.html <-- in the script. won't shop up the \ in browser afaik Spaces always will be displayed as %20 in URL's as that's how servers recognise them.
  8. for sanitization use mysql_real_escape_string() so in your case is mysql_real_escape_string($_GET['id']); What I was saying before is that in the first if statement: if (!isset($_GET['id'])) { $query = "SELECT * FROM ncmr WHERE id = '$id'"; } else { $query = "SELECT * FROM ncmr WHERE id = '" . $_GET['id'] . "'"; } You are asking it to use $id instead of $_GET['id'] but this query wont work since you haven't actually assigned $id anywhere first.
  9. Yeah sorry forgot to mark solved. I added the date_default_timezone_set() to my headers file which is present in every page.
  10. This also depends on the style of your website and the CSS. For things such as Forums, you don't generally want the tables wider than the maintitle image.
  11. Google and other search engines have to crawl your site before they will be added to the search engine. A way to speed this up with google is sign up for a web-masters account and manually add your site. However, if there are other websites with your keywords they could be higher rank than yours. Another way to get your site crawled faster is make sure there are links to the site on other sites that google already indexes (since google goes to sites regularly it checks every link it finds)
  12. Ok i have this as bbcode regex: $bbreplace = array ( "/\[b\](.*?)\[\/b\]/is" => "<b>$1</b>", "/\[u\](.*?)\[\/u\]/is" => "<u>$1</u>", "/\[url\=(.*?)\](.*?)\[\/url\]/is" => "<a href='$1'>$2</a>", "/\[img\]http://(.*?)\[\/img\]/is" => "<img src='$1'>", "/\[s\](.*?)\[\/s\]/is" => "<s>$1</s>", "/\[i\](.*?)\[\/i\]/is" => "<i>$1</i>", "/\[color=(.*?)\](.*?)\[\/color\]/is" => "<font color='$1'>$2</font>", "/\[size=(.*?)\](.*?)\[\/size\]/is" => "<font size='$1'>$2</font>", "/\[list\](.*?)\[\/list\]/is" => "<ul>$1</ul>", "/\[list=1\](.*?)\[\/list\]/is" => "<ol>$1</ol>", "/\[\*\](.*?)/i" => "<li>$1</li>" ); $PostText = preg_replace(array_keys($bbreplace), array_values($bbreplace), $PostText); Now, this works PERFECTLY apart from 1 thing. If I use the [ list] then [ *] it does it like so: Any ideas? Edit: I have checked multiple skins and it isn't a skin issue.
  13. I keep getting this. Line 11: $Date = date(d)." ".date(F)." ".date(Y);
  14. if (!isset($_GET['id'])) { $query = "SELECT * FROM ncmr WHERE id = '$id'"; } else { $query = "SELECT * FROM ncmr WHERE id = '" . $_GET['id'] . "'"; } You aren't setting $id anywhere above these lines as far as i can see so your always relying on $_GET['id'] being set as well
  15. So say I wanted to run a shoutbox, would that code work for refreshing the text every 5/10 seconds?
  16. Ok I know I can redirect using: header( 'Location: URL' ) ; Now, is there a way to delay this after a short while of displaying or would I have to use Javascript?
  17. Just like to say this still hasn't been resolved :/
  18. try changing it to .PHP and see what it says then.
  19. @PFMaBiSmAd: TY that solved the problem @Pikachu2000: If you had read one of my previous posts i clearly stated I moved it all to the top and any output to the bottom. Also the setcookie was working fine as setting the cookie before moving so the rule about output must be different from DOCTYPE header.
  20. That's what i'm saying. there are no errors. It's doing exactly what it's supposed to do if the cookie isnt set yet if I goto the forum which used this same file via include it sees the cookie and says im logged in. This only happens if I login from the forum page, but if I login from the main page it says im logged in on forum and home.
  21. Ok moved to top of script and I still get the same problem. I don't have access to php.ini either
  22. Errirs are on (see top of code) and they usually return errors. Its as if it isnt seeing the cookie
  23. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <?php session_start(); ini_set('display_errors', 'On'); error_reporting(-1); //Connect to Database and Check cookies for logged in user $db = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS); mysql_select_db(MYSQL_DB_NAME); if (!isset($_GET['act'])) { if (!isset($_POST['act'])) { $act = 'idx'; } if (isset($_POST['act'])) { $act = mysql_real_escape_string($_POST['act']); } } if (isset($_GET['act'])) { $act = mysql_real_escape_string($_GET['act']); } If ($act == 'login' && $_GET['CODE']=='1') { $usernameUsed = mysql_real_escape_string($_POST['Username']); $passwordUsed = mysql_real_escape_string($_POST['Password']); $SaltPassword = MEMBER_PASS_SALT_1.$passwordUsed.MEMBER_PASS_SALT_2; $HashPassword = md5($SaltPassword); $QueryLogin = "SELECT * FROM ".MEMBER_LOGIN_TABLE." WHERE username='{$usernameUsed}' AND password='{$HashPassword}'"; $LoginResult = mysql_query($QueryLogin); if (mysql_num_rows($LoginResult) > 0) { $UserID = mysql_result($LoginResult, 0, 'user_id'); $Id = uniqid(); $IdQry = "UPDATE ".MEMBER_LOGIN_TABLE." SET `unique_id`='{$Id}' WHERE user_id='{$UserID}'"; $IdRes = mysql_query($IdQry, $db); setcookie('RAYTH_MEMBER_ID', $Id, time()+2592000); } } If ($act == 'logout' && $_GET['CODE'] == '1') { setcookie('RAYTH_MEMBER_ID', "", time()-3600); } if (isset($_COOKIE['RAYTH_SKIN'])) { $Skin = $_COOKIE['RAYTH_SKIN']; } Else { $Skin = 'redskin'; } if (isset($_COOKIE['RAYTH_MEMBER_ID'])) { $Id = mysql_real_escape_string($_COOKIE['RAYTH_MEMBER_ID']); $MemIdQry = "SELECT user_id FROM ".MEMBER_LOGIN_TABLE." WHERE `unique_id`='{$Id}'"; $memidres = mysql_query($MemIdQry, $db); $memidnum = mysql_num_rows($memidres); If ($memidnum < 1) { setcookie('RAYTH_MEMBER_ID', '', time()-3600); } Else { $memid = intval(mysql_result($memidres, 0, 'user_id')); } } if (isset($memid)) { $query_meminfo = "SELECT * FROM ".MEMBER_PROFILE_TABLE." WHERE `user_id`='{$memid}'"; $query_result = mysql_query($query_meminfo, $db); $MemName = mysql_result($query_result, 0, 'display_name'); $MemGroup = mysql_result($query_result, 0, 'Group'); $AdsEnabled = mysql_result($query_result, 0, 'ads_enabled'); $UserLevel = intval(mysql_result($query_result, 0, 'user_level')); $LevelQuery = "SELECT group_level FROM ".MEMBER_GROUPS." WHERE group_id='{$MemGroup}'"; $LevelResult = intval(mysql_result(mysql_query($LevelQuery, $db), 0, 'group_level')); If ($UserLevel < $LevelResult) { $MemLevel = $LevelResult; } Else { $MemLevel = $UserLevel; } } else { $MemLevel = 0; $AdsEnabled = 'yes'; } ?> <html> <HEAD> <title>Rayth.Info ..::Home::..</title> <?php $File = './skins/'.$Skin.'/'.$Skin.'.php'; If (file_exists($File)) { include("./skins/{$Skin}/{$Skin}.php"); } Else { include("../skins/{$Skin}/{$Skin}.php"); } ?> Ok this code is the Headers code which checks if user is logged in, what skin to load etc. It is also used in the forum (so used in home and forum) via php include. Now somethin strange happens. If I use the home page to login (Rayth.Info) it logs me in for both home page and forum (rayth.info/forum) Now, if I then logout, and goto the forum, relogin, it doesn't log me in on the home page. Both pages use the same login/logout/register forms by php include and the same headers.php by include so I cant see any reason why this is happening. The cookie is obviously being set when user logs in since it sees them logged in on one page.
×
×
  • 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.