Jump to content

marcus

Members
  • Posts

    1,842
  • Joined

  • Last visited

Posts posted by marcus

  1. I've been on this forum for more than 4 years and haven't even stumbled across this section ever.

     

    Well... My name is Marcus, I'm 18 years old and live in Connecticut, USA. I enjoy doing anything a regular 18yr old enjoys doing. Partying, hanging out with friends, the norm, etc... I've been using and studying PHP/mySQL for about 5 years now. I've started off with basic HTML and CSS about 10 years ago (I know right?) Currently I'm a Junior Web Developer and Designer for a local business, that job will have to come to a rest at the end of August as I'm going off to school.

     

    I've always been an honors student in school. Exceeding mostly in mathematics, mainly calculus and discrete mathematics. I will be attending the Rochester Institute of Technology starting August 31st. Majoring in Computer Science, may change to Computer Engineering though. I plan to achieve a Masters Degree in Computer Science (MS). Later in life I will return for a Doctorate in Education.

     

    I'm also a YouTube Partner (share revenue with Google). I upload web development tutorials and some gadget related videos (mainly iPhone).

     

    Cool.

  2. <?php
    include "global.php"; // would be your file that includes functions, database connectivity, etc..
    
    include "header.php"; // would be your file that is the chunk of HTML code that your page would start off with
    $page = $_GET['page'];
    
    if($page){
    if(file_exists("pages/".$page.".php")){
    	include "pages/".$page.".php";
    }else {
    	include "pages/404.php";
    }
    }else {
    include "pages/home.php";
    }
    
    include "footer.php"; // would be your file that closes the open chunk of HTML from header.php
    ?>

     

    Or if you don't want to use the file_exists method

     

    <?php
    include "global.php"; // would be your file that includes functions, database connectivity, etc..
    
    include "header.php"; // would be your file that is the chunk of HTML code that your page would start off with
    $page = $_GET['page'];
    $pages = array('home','about','contact');
    
    if($page){
    if(in_array($page,$pages)){
    	include "pages/".$page.".php";
    }else {
    	include "pages/404.php";
    }
    }else {
    include "pages/home.php";
    }
    
    include "footer.php"; // would be your file that closes the open chunk of HTML from header.php
    ?>

  3. Between two players you should use a database and tag on some fields like game_id,letters_remaining

     

    game_id would be relevant to another table with some fields like uid1,uid2 (for users player), status (0=not started, 1=playing, 2=finished), winner (would be uid1 or uid2)

     

    etc..

  4. <?php
    $sql = "INSERT INTO `chars` (`accid`,`charname`,`sex`,`age`,`pgmg`,`dmrkt`,`history`,`carcrashrp`,`carscrach`)
    	VALUES('".$_SESSION['Logged']."','".$_POST['charname']."','".$_POST['sex']."','".$_POST['age']."','".$_POST['pgmg']."','".$_POST['dmrktt']."','".$_POST['history']."','".$_POST['carcrashrp']."','".$_POST['carscrash']."')";
    $res = mysql_query($sql) or die(mysql_error());
    ?>

  5. Where are you pulling the $row['Sex'] from? How are you comparing the IsValidSkin function to $row['Sex']?

     

    <?php
    
    function IsValidSkin($skinid,$sex){
    
    $valid = array(3,4,5,6,8,17,42,50,61,65,71,74,86,92,268,119,149);
    if(in_array($skinid,$valid)){
    	return true;
    }else {
    	if($sex == 1){
    		return true;
    	}else {
    		return false;
    	}
    }
    }
    
    ?>

  6. Just throw that code to the top.

     

    try this

     

    <?php
    if(isset($_POST['SubmitPart2']))
       {   
          $urls = array('http://yahoo.com','http://google.com','http://ask.com','http://lycos.com','http://bing.com');
             if(in_array($_POST['url'],$urls))
                {      
                   header("Location: " . $_POST['url']);   
                }
                   else 
                      {
                         $a = "<p>Invalid Search Engine!</p>";
                      }
       }         
    ?>
    <HTML>
    <head>
    <title> Final Part 2</title>
    <body>
    <h2>Please Select a search engine.</h2>
    <?php echo $a; ?>
    <form method="POST"target="_blank">
    <table>
    <tr>
    <td>Sites: </td>
    <td>
    <select name="url">
    <option value="http://yahoo.com">Yahoo.com</option>
    <option value="http://google.com">Google.com</option>
    <option value="http://ask.com">Ask.com</option>
    <option value="http://lycos.com">Lycos.com</option>
    <option value="http://bing.com">Bing</option>
    </select>
    </td>
    </tr>
    <tr>
    <td><input type="submit" name="SubmitPart2" value="<<< Go To" /></td>
    </tr>
    </table>
    </form>
    </body>

  7. <form method="post">
    Choose Your Website:
    <select name="url">
    	<option value="http://google.com">Google</option>
    	<option value="http://yahoo.com">Yahoo</option>
    	<option value="http://bing.com">Bing</option>
    </select>
    <input type="submit" name="submit" value="Go to Search Engine">
    </form>
    
    <?php
    if(isset($_POST['submit'])){
    $urls = array('http://google.com','http://yahoo.com','http://bing.com');
    if(in_array($_POST['url'],$urls)){
    	header("Location: " . $_POST['url']);
    }else {
    	echo "<p>Invalid Search Engine!</p>";
    }
    }
    ?>

  8. Ha, my error pick up was right off the bat didn't look at the beginning of the code.

     

    unset is to basically remove anything tied to the variable. For instance

    unset($_SESSION['username'])

     

    You want to do something like:

     

    <?php
    if(isset($_GET['ID'])){
    echo "Tracked" . htmlentities($_GET['ID']);
    }else {
    echo "Title from the First page";
    }
    ?>

  9. What I interpreted

     

    <?php
    $array = array(1,1,0,1,0,0,0,1,1,1,0,1);
    
    echo '<table cellspacing="3" cellpadding="3">';
    
    function a($n,$x){
    if($n == 1) return '<input type="radio" name="'.$x.'" value="1" CHECKED /> Yes • <input type="radio" name="'.$x.'" value="0" /> No';
    else return '<input type="radio" name="'.$x.'" value="1" /> Yes • <input type="radio" name="'.$x.'" value="0" CHECKED /> No';
    }
    
    $x = 1;
    foreach($array AS $set){
    echo "<tr><td>Answer:</td><td>".a($set,$x)."</td></tr>";
    $x++;
    }
    
    echo "</table>";
    ?>

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