Jump to content

only one

Members
  • Posts

    437
  • Joined

  • Last visited

    Never

Posts posted by only one

  1. yea this is actually pretty simple.

     

    on the vote page just do an update query or someting

     

    $bands = mysql_query("SELECT * FROM bands WHERE bandname = '$_GET[bandname]'");

    while ($band = mysql_fetch_array($bands)) {

    mysql_query("UPDATE `bands` SET `votes` = '$band[votes] + 1' WHERE `bandbame` = '$_GET[bandname]'"); }

     

    now to order 100 starting with the first on just do

     

    $bands = mysql_query("SELECT * FROM bands WHERE bandname = '$_GET[bandname]' ORDER BY votes DESC LIMIT 100'");

    while ($band = mysql_fetch_array($bands)) {

    echo "$band[bandname]

    <br />

    \n";

    }

     

    edit bold bits

  2. hi, im trying to make the message center on my website look better...

    how do i make it so it shows the first table row with a diferent colored background from the next??

     

    ive figured out a way of seting the next color in my database.. but is there a quiker way?

  3. my code...

     

    <?php
    echo "<font face=Arial size=2 color=#000000>";
    $path = "uploads/";
    $date = date("YmdHis");
    if (isset($HTTP_POST_FILES['userfile'])){
    if (!$HTTP_POST_FILES['userfile']){ echo "<font color=#ff0000>Error</font>: Please select a file to upload";
    }else if (is_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'])) {
    if (($HTTP_POST_FILES['userfile']['type']=="image/gif") || ($HTTP_POST_FILES['userfile']['type']=="image/pjpeg") || ($HTTP_POST_FILES['userfile']['type']=="image/jpeg") || ($HTTP_POST_FILES['userfile']['type']=="image/png")) {
    if (file_exists($path .$date .$HTTP_POST_FILES['userfile']['name'])) { echo "<font face=#ff0000>Error</font>: Please try upload again now<br />";
    }else{
    $res = copy($HTTP_POST_FILES['userfile']['tmp_name'], $path .$date .$HTTP_POST_FILES['userfile']['name']);
    if (!$res) { echo "<font color=#ff0000>Error</font>: Unexpected fail<br>";
    }else{
    echo "upload sucessful<br><br>"; }
    echo "File Name: ".$date."".$HTTP_POST_FILES['userfile']['name']."<br>";
    echo "File Path: <a href=uploads/".$date."".$HTTP_POST_FILES['userfile']['name']." TARGET=_BLANK>uploads/".$date."".$HTTP_POST_FILES['userfile']['name']."</a><br>";
    echo "File Size: ".$HTTP_POST_FILES['userfile']['size']." bytes<br>";
    echo "File Type: ".$HTTP_POST_FILES['userfile']['type']."<br>";
    echo "<img src=uploads/".$date."".$HTTP_POST_FILES['userfile']['name']."><br>";
    }}else{ echo "<font color=#ff0000>Error</font>: wrong file type"; }}}
    ?>
    </font>
    <form ENCTYPE=multipart/form-data action='<?php echo "'$_SERVER[php_SELF]'"; ?> method=POST>
    The file:
    <input type=file name=userfile>
    <input type=submit value=Upload>
    </form></font>
    <form ENCTYPE=multipart/form-data action='<?php echo "'$_SERVER[php_SELF]'"; ?> method=POST>
    The file:
    <input type=file name=userfile>
    <input type=submit value=Upload>
    </form></font>
    <form ENCTYPE=multipart/form-data action='<?php echo "'$_SERVER[php_SELF]'"; ?> method=POST>
    The file:
    <input type=file name=userfile>
    <input type=submit value=Upload>
    </form>
    

  4. it might be easy to just md5 their password and then send them it out..

    or you could save their session in the database aswell..

     

    put this

    session_start();

    now just save the session_id([string $id])

    thats the session id..

     

    then mail that too them

  5. hi i want to make a page that gathers how many posts ive posted on forums, i was trying to use a code

     

    i was planning to first of all open the document, read it, then strip the tags and preg_replace all the other content (i reallised it wouldnt work)

     

    i got this far, but it didnt seem to work at all:

    <?php
    $filename = "http://www.phpfreaks.com/forums/index.php?action=profile;u=45841";
    $handle = fopen($filename, "r");
    $contents = fread($handle);
    $strip = strip_tags($contents);
    echo "$strip";
    ?>

     

    anyone got any ideas?

     

    thanks, Only

  6. hi, ive created alot of javascript functions for my mmorpg.. (eg. fishing, fighting) where players select options rather then just get the results of what happend (more intresting this way)

    after the functions are finnished i insert the variables into a txt file, one problem im having is i want to insert it into my mysql database. im planing to include a file on every page that will gather the info and store it into the database.

     

    how do i gather the information???

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