Jump to content

cs.punk

Members
  • Posts

    437
  • Joined

  • Last visited

Posts posted by cs.punk

  1. There should be no time delay with changes as the file is parsed on a per request basis. If your objective is to simply not allow www and use the root domain instead, why not just use...

     

    RewriteEngine On

    RewriteBase /

    RewriteCond %{HTTP_HOST} ^www\.example\.co\.uk$ [NC]

    RewriteRule ^(.*)$ http://example.co.uk/$1 [L,R=301]

     

    Thanks for your help.

    Would this allow subdomains? Should I just keep this file in the root?

     

    As for the time delay I get the fact that it's on 'per request' however it seems to only take effect of a new .htaccess file after a few hours or so. Unless I'm doing something silly. This is a paid host too.

  2. I have the following .htaccess file in root

    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} !^example.co.uk$ [NC]
    RewriteRule ^(.*)$ http://example.co.uk/$1 [L,R=301] 
    

     

    To allow my site being accessed from http:// and not http://www

     

    However I now have a subdomain and I can't seem to access it with this rule. I've tried to fiddle with it however my host seems to be taking ages for the .htaccess files to 'update'.

     

    Can anyone help me out?

  3. imagettftext is used to write text to an image using TrueType fonts.

     

    Size being one of the parameters:

    The font size. Depending on your version of GD, this should be specified as the pixel size (GD1) or point size (GD2).

     

    An inch representing 72 points.

     

    However how is the point size calculated?

    Is it based on the servers/clients screen resolution?

  4. The full process:

     

    1) user enters text into a textarea

     

    2) JS sends the text in the post to the server via AJAX

     

    3) php stores the text into a session, and asks the user a question about their text content

     

    4) Upon answering the question from step3 a normal html form is submitted to the server.

     

    5) Depending on the answer of the question at step3, the text previously stored into $_SESSION may or my not get entered into the db.

     

    It somewhere between step4 and step5 that the session changes somehow.

     

    Why don't you output the value of $_SESSION['test'] after each time you do something to it.

    Eventually you will get to the bottom of it.

  5. <?php
    
    class constantTest {
    
    const HELLOWORLD = 'maybe not';
    
    function __construct()
    {
    	echo HELLOWORLD; // Output: HELLOWORLD
    	echo constant('HELLOWORLD'); // Output: Warning: constant() [function.constant]: Couldn't find constant HELLOWORLD
    	echo  self::HELLOWORLD . "\n"; // Output: maybe not
    }
    }
    
    $bob = new constantTest();
    

     

    I have read through the manual but as far as I can see all three methods should output the constant rather than just the last one.

    Question: Why?

  6. That code works thank you xD ! I think I have nailed where it was going wrong, it seems you can't add top padding/margin to a link directly?

    Like so? Why not though?

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
        <head>
        <meta http-equiv='content-type' content='text/html;charset=utf-8' />
        
        <title>Test</title>
        
        	<style type='text/css'>
    	a {
    		margin-top: 300px;
    		padding: 200px;
    		font-size: 60px;
    
    	}
    	</style>
    
        </head>
    <body>
    <a href="/home.php">Home</a>
    <a href="/home.php">Downloads</a>		
    
    </body>
    </html>
    

  7. I've got a tiny problem.

    I've validated my HTML, have a valid doctype and using reset.css but I can't seem to work out where I'm going wrong.

     

    First of all I'm trying to align the 'rightAlign' div all the way to the right...

    Secondly, why is the padding not effecting the a.navBar ? I tried setting it as margin but had not difference.

     

    Thank you for your help.  :)

     

    <body>
    <div id="navBar">
    	<a class="navBar" href="/home.php">Home</a>
    	<a class="navBar" href="/home.php">Downloads</a>
    
    	<div id="rightAlign">
    	    <a class="navBar" href="/home.php">Login</a>
    	    <a class="navBar" href="/home.php">Register</a>	
    	</div>
    </div>
    

     

    #navBar{
    background:url(topbar.png);
    background-repeat: repeat-x;
    height: 25px;
    width:80%;
    margin: 0 auto 0 auto;
    }
    
    #navBar #rightAlign	{
    float: right;
    height: 25px;
    width:80%;
    }
    

     

    h1,h2,h3,h4
    ,p
    ,a
    {
    font-family: Verdana;
    }
    
    p {
    font-size: 16px;
    }
    
    h1 { 
    font-size: 20px;
    }
    
    h4 {
    font-size: 16px;
    text-align: center;
    }
    
    p.footer {
    color: #FFFFFF;
    }
    
    a {
    color: #47AB2E;
    }
    
    a.navBar {
    padding-left: 5px;
    padding-top: 80px;
    font-family: 'Tahoma';
    color: #FFFFFF;
    font-weight: none;
    text-decoration: none;
    }
    
    a.navBar:hover {
    font-family: 'Tahoma';
    color: #FFFFFF;
    font-weight: none;
    text-decoration: underline;
    }
    

     

    [attachment deleted by admin]

  8. If your questioning now then I'd say your intelligent enough to have a 'secure' login system. In which case I'd say it isn't a security concern.

     

    But lets say 20% of your user's have their password as 'password' or '123' or 'yoursitename'.

    It would be of great help to a malicious bot making person, but it depends I guess. Just hunting the site for user names could be an much easier task.

     

    If you enforce user's to choose strong and lengthy passwords and have login timeouts. Then what are you possibly risking?

     

    Specially if it's something general like a forum.

     

    So to answer the question: No, it is hardly a security concern.

  9. Yes it can be done (like most things).

     

    You can just add 'ORDER BY RAND()' in your mysql query... But it's very resource hungry with larger tables.

    Here's an more efficient way though: http://www.electrictoolbox.com/msyql-alternative-order-by-rand/

     

    However this only gives you one 'result'. Perhaps if you added each random result's ID and then did 'WHERE id != x or x or x or x or x or x...'

     

     

    Hope that helps a bit.

  10. I've been very slowly developing a site for lovers of experimental electronic music (one of my other hobbies) using Rails, Node.js and Backbone.js. I've been plugging away at this site for about the last 8 months, I'm still not sure I'll ever be happy enough with it to actually launch the thing.

     

    That's an awesome idea man :D like a social/collaberation site?

  11. Would it  be data value sent via the client as POST/GET

    OR is it an data value determined/calculated via PHP?

     

    lol wtf happened to my grammer?

     

    Would it be data valueS sent via the client via POST/GET

    OR is it data valueS that are determined/set/calculated via PHP?

     

     

×
×
  • 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.