Jump to content

sunfighter

Members
  • Posts

    579
  • Joined

  • Last visited

    Never

Posts posted by sunfighter

  1. From the PHP manual:

    PHP and HTML interact a lot: PHP can generate HTML, and HTML can pass information to PHP.

     

    You:

    essentially I don't want to include the php code on the html page
    You should take a little time to study php. php goes through an interpreter and generates html. php can not appear in html. You can make an entire html page with php.

     

    To put a php variable (ie. $phpvar = 'Cold Ice'; ) into a <td></td> of a html page you do this:

    <td><?php echo $phpvar; ?></td> 

    and the browser will display Cold Ice where you want it in your table.

     

  2. It's in your main file "index.htm" Line 308 to line 315 looks like this:

                      <table border="0" cellpadding="0" cellspacing="0" width="100%">

    <tr>

    <td>

    <table width="100%" cellspacing="0" cellpadding="0" border="0">

            <tr><td> <table width="100%" cellspacing="0" cellpadding="0" border="0">

            <tr><td><div class="body_t"><div class="body_b"><table cellpadding="0" cellspacing="0" border="0" width="100%">

    <tr>

    <td align="center">

     

    You want line 312. Try this:

    <tr><td> <table width="100%" cellspacing="10" cellpadding="0" border="0">

  3. In your php file you have to combine the two columns into a single echo. We're going to do this with a implode command. I'm using '/' to separate the two pieces of information. You can use anything you want as long as it is not used in either of the two resources.

    PHP:

    ...
    $row = mysql_fetch_array($result);
    $combo = implode('/', $row);
    echo $combo;

     

    In the javascript section we have to separate them. Where we once had:

    document.getElementById("txtHint").innerHTML=xmlhttp.responseText;

     

    We put:

    pieces = xmlhttp.responseText;
    number1 = pieces.search('/');
    first = pieces.substr(0,number1);
    second = pieces.substring(number1+1);
    
    document.getElementById("txtHint").innerHTML= first;
    
    document.getElementById("nextDiv").innerHTML= second;

  4. In the attack-items div you have two <td>'s that should be encased by <tr>'s

     

     

    <div id="attack-items">

    <table cellspacing="10">

    <tr>

        <td>Primary</td>

        <td>Secondary</td>

        <td>Melee</td>

    </tr>

    <td><a href="attack.php?action=use&it_id=18">Shotgun</a></td>

    <td>None</td><td>None</td>

    </table>

    </div>

  5. No problem pagegen. I also didn't mean to come across as use mine or else. I was just looking for some recognition, I guess and thought one query was better then two, but your don't need to use two. 

     

    Using an inner join with your set up will work just as good as mine and will also be one command. If that structure makes more sense to you then use it.

  6. To save a lot of work later use one table to list the people on your server. Have a auto increment column for user_id, then columns for their name(s), user name(?), password, status(admin, user, affliates, and customers) ... more.....  Also make columns for the extra info needed for the different statuses and make them able to be NULL. Then an admin does not need info in those columns. When someone logs in it's easy to checked their name and pass and then get all other info needed for the site.

  7. I don't think this is a margin. Looks like simple html body with content div.

    <style type="text/css">
    body
    {
    background-color:#FF6600;
    }
    #the
    {
    width: 600px;
    margin-right:auto;
    margin-left:auto;
    height: 100px;
    background-color: red;
    }
    </style>
    </head>
    <body>
    
    <div id="the">put stuff here</div>
    
    </body>
    </html>

     

     

  8. Did you get an error message and if yes what was it?

     

    First steps in trouble shooting code : Check the inputs!

    echo out $nickname

     

    Did you make a connection to your db? I ask because it's not shown that you did here and you don't tell us if the connection is a global variable, which you would need here.

  9. $_SESSION only holds the information you put into it.  To find out "members" that go to the same "school" as the current user and/or the people that started in the same "semester" as he/she, you have to query your database.

     

    And mysql_insert_id(); retrieves the ID generated for an AUTO_INCREMENT column by the previous query (usually INSERT).

     

    If your really a dumb dumb when it comes to PHP my suggestion is to cram very hard cause there is no way your going to get a social networking website running without it.

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