Jump to content

CBG

Members
  • Posts

    33
  • Joined

  • Last visited

Everything posted by CBG

  1. Just to let you know: The last update osDate had was about 1 and half years ago to osDate 2.6 (http://forum.tufat.com/showthread.php?t=67329) Me and a few others are testing the new version of osDate (osDatePDO), but I don't know of a release date.
  2. Ok how does this look, it seems to work, just a bit worried about the NC on the last RewriteRule. As I have been told NC can create opportunities for duplicate content RewriteCond %{THE_REQUEST} ^[a-zA-Z0-9_-]+\ /profile\.php\?username=([^&]+)\ HTTP/ RewriteRule ^profile\.php$ http://www.mydomain.co/%1? [R=301,L] RewriteRule ^([a-z0-9_]+)/?$ profile.php?username=$1 [NC,L] The idea is http://www.mydomain.co/ABC is normal URL, but if anyone tries https://www.mydomain.co/ABC they redirected back to http
  3. Hi, I have the below rewrite rule RewriteRule ^([a-zA-Z0-9_-]+)$ profile.php?username=$1 When I go to: http://www.mydomain.co/ABC It works fine When I go to: https://www.mydomain.co/ABC It redirects to: http://www.mydomain.co/ABC?username=ABC I am not wanting ?username=ABC when being redirected for HTTPS I am wanting to make access to this via HTTP only. I have tried to add ? in places to strip but that didn't work and broke it Any help please
  4. Hi, Have got it now, it was all in a ? (question mark) RewriteCond %{QUERY_STRING} page=allnews RewriteRule ^index.php$ news.php? [R=301,L]
  5. Hi, I have the below rule to try and convert index.php?page=allnews&etc.. to news.php RewriteCond %{QUERY_STRING} page=allnews RewriteRule ^index.php$ news.php [R=301,L] The problem I am having is the URL changes to: news.php?page=allnews I am wanting to strip everything after news.php in the rule Can anyone help? Thanks
  6. Just thought I would come back with a follow up on this. It working fine. I didn't put SET in it, as I thought that was for update. But anyway it works great. Thank you very much
  7. Thanks for the reply I will give that code ago and if it doesn't work do a google on subqueries and/or derived tables. Thanks again
  8. Hi, I would like to do the following in PHP using a MySQL database, but not sure how. select a, b,c etc.. from mailbox where id = X then insert id,a,b,c etc.. into problem When I select, I will be calling the id So I would like it to get data from mailbox and then insert it into problem. How would I go about doing this? Thanks for any help you can give me
  9. Thanks for the reply. This is working to well $str = '0x.xx'; echo ltrim($str,'0'); Let say it is 00.00 I am wanting to remove the first 0 Then again it could be 01.00 I want to remove the first 0 Or it could be 10.00 which mean there is no 0 to remove The numbers could be anything.
  10. I have the first problem fixed. With it removing ,0 or ,1 by using $str2 = $newstring; $pattern2 = "{\,1||,0+}"; $newstring2 = preg_replace($pattern2,"",$str2); echo '<br>'; echo $newstring2; Now it just leaves removing the first 0 if it exists
  11. First problem fixed. My second problem is if the result is 0X.XX,0 or 0X.XX,1 I would like to remove the first 0 The X.XX are numbers, but the 0 is not always there. Can anyone help please Thanks
  12. Just going thought some old cold I had and I think I have found what I want. It seems to be working, but could someone check it over? $pages = array('/index.php','/',); if (in_array($_SERVER['SCRIPT_NAME'], $pages) && $_SESSION['UserId'] <= 0) { $t->display( 'homepage_NEW.tpl' ); } else { $t->display( 'index.tpl' ); }
  13. Hi, What I am after is If on index.php or http://www.domain.com and not logged on (got the bit of code for not logged on) Show not logged on template if logged in show logged in template This only a apply to the index.php page, all other pages have separate .php files So I am only wanting it so I know what template to show for the index.php page
  14. Hi, I would like to do the following but not sure how. If the you/user is on index.php of http://www.domain.com/ show one page If not show another How would I do this? Thanks
  15. That worked, great thanks for the help Will look at the /w later. Thanks agin for the help
  16. I tried with m modifer but I get the reverse problem
  17. Thanks for the reply, I have just tried this and I get the same problem.
  18. Hi, I currently have the below code to check the textarea box. if (preg_match("#^[a-zA-Z0-9 .,?_/'!£$%&*()+=-]+$#", $msgs)) { // Everything ok. Do nothing and continue } else { echo "Message is not in correct format.<br>You can use a-z A-Z 0-9 . , ? _ / ' ! £ $ % * () + = - Only"; However the problem is, when putting enter in the message if fails For example if I put the message It fails and echo the else But if I put It is ok Could someone tell me what extra bit of code I need to add to the preg_match and where. Thanks for the help
  19. Hi, I am needing some code, so that I can put a limit of the amount of wrong logins. For example ather 3 login, they get block for 10 minutes. I would like it to run via PHP/MySQL. I already have a login script that is being used by the script I am using which is a PHP/MySQL script
  20. Thanks I have also sorted the / in the $website bit by changing the delimiter. I changed it to if (preg_match('#^[a-zA-Z0-9._/-]+$#', $website)) {
  21. Hi, I am using preg_match to check the email address, but I also want to check for With @ or + like: myemail+email.com I currently got if (preg_match('/^[^@]+@[a-zA-Z0-9._-]+\.[a-zA-Z]+$/', $email)) { But it give falso if + is in the email, what bit do I change? Also I need to allow / in the below preg_match So I can have a input of www.mysite.co.uk/mypage if (preg_match('/^[a-zA-Z0-9 ._-]+$/', $website)) { When I put / in the allow I get Warning: preg_match() [function.preg-match]: Unknown modifier '_' in .........
  22. Hi, I have a function with the below code in it and I want to have multiple Return values and am unsure how to do it if ( $one == 'yes') { echo 'One Appear'; } else { echo 'One Does not Appear<br>'; $one_bot = 0; } if ( $two == 'yes') { echo 'Two Appear'; } else { echo 'Two Does not Appear<br>'; $two_bot = 0; } if ( $three == 'yes') { echo 'Three Appear'; } else { echo 'Three Does not Appear<br>'; $three_bot = 0; } Now if I put the below it returns 1 0 (zero) in the browser and not all 3 return $one_bot; return $two_bot; return $three_bot; So it seems to be it not working like that, so should I put it in an array like $list = array($one_bot, $two_bot, $three_bot); return $list; ? If not how should I do it?
  23. Thanks for all your replies I went with this one in the end.
  24. Hi, I currently have the below code. $query = "select * from db WHERE username LIKE '$username'"; $result = mysql_query($query); while ($r = mysql_fetch_array($result)) { $user = $r["username"]; $user_seen = $r["username_seen"]; } Now what I would like to do is count and return the number how many times the same username is in the database, as well as return username How would I do this with the above code?
×
×
  • 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.