Jump to content

dezkit

Members
  • Posts

    1,236
  • Joined

  • Last visited

Posts posted by dezkit

  1. Hey guys I got this

    #menuh a
    {
    text-align: center;
    display:block;
    white-space:nowrap;
    margin:0;
    padding: 0.3em;
    line-height:30px;
    border:1px solid #ff0000;
    }
    
    
    #menuh a:link, #menuh a:visited, #menuh a:active	/* menu at rest */
    {
    color: white;
    text-decoration:none;
    }
    
    #menuh a:hover						/* menu on mouse-over  */
    {
    color: white;
    background-color: #8e1314;
    text-decoration:none;
    }	
    
    #menuh a.top_parent, #menuh a.top_parent:hover  /* attaches down-arrow to all top-parents */
    {
    background-image: url(navdown_white.gif);
    background-position: right center;
    background-repeat: no-repeat;
    }
    
    #menuh a.parent,  	/* attaches side-arrow to all parents */
    {
    background-image: url(nav_white.gif);
    background-position: right center;
    background-color: #8e1314;
    /* border:1px solid #ff0000;	*/
    background-repeat: no-repeat;
    }
    
    #menuh a.parent:hover
    {
    
    }
    
    #menuh ul
    {
    list-style:none;
    margin:0;
    padding:0;
    float:left;
    width:9em;	/* width of all menu boxes */
    /* NOTE: For adjustable menu boxes you can comment out the above width rule.
    However, you will have to add padding in the "#menh a" rule so that the menu boxes
    will have space on either side of the text -- try it */
    }
    
    #menuh li
    {
    position:relative;
    min-height: 1px;		/* Sophie Dennis contribution for IE7 */
    vertical-align: bottom;		/* Sophie Dennis contribution for IE7 */
    }
    
    #menuh ul ul
    {
    position:absolute;
    z-index:500;
    top:auto;
    display:none;
    padding: 1em;
    margin:-1em 0 0 -1em;
    }
    
    #menuh ul ul ul
    {
    top:0;
    left:100%;
    }
    
    div#menuh li:hover
    {
    cursor:pointer;
    z-index:100;
    }
    
    div#menuh li:hover ul ul,
    div#menuh li li:hover ul ul,
    div#menuh li li li:hover ul ul,
    div#menuh li li li li:hover ul ul
    {display:none;}
    
    div#menuh li:hover ul,
    div#menuh li li:hover ul,
    div#menuh li li li:hover ul,
    div#menuh li li li li:hover ul
    {display:block;}
    
    /* End CSS Drop Down Menu */
    

     

    And I want it to look like this: htv76q.png

     

    How would I do this? Can somebody please fix my code to look like that?

  2. Hey guys,

    I'm starting to build a website and I was wondering wether I should use a library template engine such as smarty, or use pure php, such as this tutorial - http://www.massassi.com/php/articles/template_engines/

     

    Basically the website will not expose any of the users/designers to the designer portion of the website. I am scratching my head wether I should use smarty or pure php, even Facebook uses smarty, from what I have heard. I need some answers.

     

    Thank you all!

  3. Hey guys first of all I got 3 files -

     

    index.php

    require_once('/libs/template.class.php');
    
    $template = new Template;
    
    $template->assign("title","test");

     

    template.php

    <?php echo $title; ?>

     

    template.class.php

    function assign($var, $val)
        {
            $var = $val;
        }

     

    I'm trying to assign a variable in index.php, then recall it in the template.php, how would I go about this?

     

    Thank you!

  4. Hey guys I have the following code:

     

    $xml = new SimpleXMLElement( 'http://steamcommunity.com/profiles/76561197963859775?xml=1' , NULL, TRUE );
    			print_r($xml);

    The problem here is that it doesnt echo everything correctly...

    It doesn't show avatarFull for me

    impleXMLElement Object
    (
        [steamID64] => 76561197961308838
        [steamID] => SimpleXMLElement Object
            (
            )
    
        [onlineState] => in-game
        [stateMessage] => SimpleXMLElement Object
            (
            )
    
        [privacyState] => public
        [visibilityState] => 3
        [avatarIcon] => SimpleXMLElement Object
            (
            )
    
        [avatarMedium] => SimpleXMLElement Object
            (
            )
    
        [avatarFull] => SimpleXMLElement Object
            (
            )
    

     

    That's what it shows, the avatarFull and a couple others are empty.

    How do I fix this? Thank you

  5. i have this code

    <?php
    $rulepages = array();
    $rulepages[] = array("name" => "1111213", "page" => "fasdd21.php", "id" => "1");
    $rulepages[] = array("name" => "41231245152", "page" => "fasd.php", "id" => "2");
    
    ?>
    <table width="100%">
    <tr>
    	<td width="15%">
    	<?php
    		sort($rulepages);
    		foreach($rulepages AS $rulepage){
    			echo "<a href=\"?id=".$rulepage["id"]."\">".$rulepage["name"]."</a>";
    			echo "<br />";
    		}
    	?>
    	</td>
    	<td  width="80%">
    		<?php
    			$id = $_GET["id"];
    			// ??
    		?>
    	</td>
    </tr>
    </table>
    

    what do i do to search the array where the id equals the get ?

     

    thanks

  6. I told you the solution in the last thread... here is some code:

    <td><label for='images'> <b>File to upload:</b> </label></td>
                <td><input type='file'  name = 'drama_image' /> 
    Ignore: <input type='checkbox' name='ignore' value='1' selected='selected'></td>
                           </tr>
             
       <?php
    if(!$_POST['ignore'] == "1"){
    //not ignore
                $target_path = "images/";
                $target_path = $target_path . basename( $_FILES['images']['name']);
    
                if(move_uploaded_file($_FILES['images']['tmp_name'], $target_path)) {
                    echo "The file ".  basename( $_FILES['images']['name']).
                 " has been uploaded";
                } else{
                    echo $row['drama_image'];
                }
    } else {
    //ignore
    }
         ?>

  7. Lol, why would you put session_start and session_destroy??

    You also gotta put session_start on top of everything

    <?php
    session_start();
    // Use session variable on this page. This function must put on the top of page.
    
    // load the configuration file.
    include("config.php");
    
    ////// Login Section.
    $Login=$_POST['Login'];
    if($Login){ // If clicked on Login button.
    $username=$_POST['username'];
    $password=$_POST['password'];
    
    // Check matching of username and password.
    $result=mysql_query("select * from admin where username='$username' and password='$password'");
    if(mysql_num_rows($result)!='0'){ // If match.
    //session_register("username"); // Create session username.
    //$_SESSION['username'] // Create session username.
    $_SESSION['username'] = $username;
    $only = array("john");
    if(!in_array($_SESSION["username"] , $only){
    	header("location:intheloop.php"); // Re-direct to intheloop.php
    }
    exit;
    } else { // If not match.
    $message="Invalid Username or Password<br>";
    }
    
    } // End Login authorize check.
    ?>

     

    Also, you should really encrypt the passwords with md5, and you should actually make another table with access flag levels instead of using their usernames.

  8. $_SESSION['username'] = $username;

    that will set a session called username with the value of the username the person signed in with.

     

    and if you wish to restrict access

    $only = array("John");
    if(!in_array($_SESSION["username"] , $only){
    header("Location: index.php"); //redirects them if they are not john
    }
    // success code only John would see.
    

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