Jump to content

DeanWhitehouse

Members
  • Posts

    2,527
  • Joined

  • Last visited

Posts posted by DeanWhitehouse

  1. Do you mean how do we have include files and make sure that we don't include something we don't need, simple in the include file (header or whatever) just put something that you will need on all pages, and everything else on the page in question. Now if you have something on more than one page but not all then make a function for that and put it in the include file.

  2. $delete_id = 28;
    echo "<form><input type=\"button\" onclick=\"delete('$delete_id')\" value=\"Delete Gallery\"></form>";
    

     

    Then

    
    <script>function delete(DeleteId) {
    
       var answer = confirm("Do you want to delete this gallery?")
    
       if (answer){
    
          window.location = "http://site.com/?delete="+DeleteId;
    
       }
    
    }</script>

    That + might need to be changed to &

  3. Thanks, but i have half solved it

     

    I made two tests like so

     

    $mesg = secure("
    
    [center] test [/center]
    
    
    [scroll]test[/scroll]
    ");  //does htmlentities and trim, i need to change it 
    $mesg = bbcode($mesg); 
    echo nl2br($mesg);
    /*^prints, 
                test
    \r\n\r\n
    \r\ndoes it work like this?\r\n
    */
    

    That has test centered and the scroll working but nl2br stops working :S

     

    Edit: the function

    function secure()
    {
        $arg_count = func_num_args();
    	$arg_list = func_get_args();
    
    	for ($i = 0; $i < $arg_count; $i++) 
    	{
    		$un_secure = $arg_list[$i];
    		$un_secure = htmlentities($un_secure);
    		$un_secure = trim($un_secure);
    		if(@mysql_ping())
    			$un_secure = mysql_real_escape_string($un_secure);
    		if($arg_count == 1)
    			$secured = $un_secure;
    		else
    			$secured[] = $un_secure;
    	}	
    	return $secured;
    }
    

     

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