Jump to content

only one

Members
  • Posts

    437
  • Joined

  • Last visited

    Never

Posts posted by only one

  1. <?php
    include("cons.php");
    $date = date("Yjm");
    $time = date("Gi");
    mysql_query("UPDATE `clanusers` SET `time` = '$time', `date` = '$date' WHERE '$user' = `username`");
    $info = mysql_query("SELECT * FROM clanusers");
    while ($r = mysql_fetch_array($info)) {
    $rank2 = $r['rank'];
    $date1 = $r['date'];
    $time1 = $r['time'];
    $name = $r['username'];
    $date2 = date("Yjm");
    $time2 = $time1 + 0005;
    $color2 = $r['color'];
    if($date2==$date1){ if($time<$time2){
    $info2 = mysql_query("SELECT rank FROM ranks WHERE `rankno` = '$rank2'");
    while ($r2 = mysql_fetch_array($info2)) {
    $rank3 = $r2['rank'];
    echo "<a href='?page=Profile&userna=$name'><title='Rank: $rank3'><font face=\"Arial, Helvetica, sans-serif\" font size=\"1\" color=\"$color2\">$name</font></title>[/url] <font color=#cccccc face=Arial size=1>|</font> "; }}}} mysql_error(); 
    ?>
    

  2. code:

    <?php

    include("cons.php");

    $date = date("Yjm");

    $time = date("Gi");

    mysql_query("UPDATE `clanusers` SET `time` = '$time', `date` = '$date' WHERE '$user' = `username`");

    $info = mysql_query("SELECT * FROM clanusers");

    while ($r = mysql_fetch_array($info)) {

    $rank2 = $r['rank'];

    $date1 = $r['date'];

    $time1 = $r['time'];

    $name = $r['username'];

    $date2 = date("Yjm");

    $time2 = $time1 + 0005;

    $color2 = $r['color'];

    if($date2==$date1){ if($time<$time2){

    $info2 = mysql_query("SELECT rank FROM ranks WHERE `rankno` = '$rank2'");

    while ($r2 = mysql_fetch_array($info2)) {

    $rank3 = $r2['rank'];

    echo "<b><a href='?page=Profile&userna=$name'><title='Rank: $rank3'><font face=\"Arial, Helvetica, sans-serif\" font size=\"1\" color=\"$color2\">$name</font></title></a> <font color=#cccccc face=Arial size=1>|</font> </b>"; }}}} mysql_error();

    ?>

     

    doesnt show whos online for some reason, it works fine without the the ranks bit

  3. if you are going to include any files i would suggest setting it in another folder inside your root folder, then if you want to include a file like, include("file/$page.php"); they cant get their page on from their site becasue it will have to be in that folder first, if you have include("$page.php"); they could do, page.php?page='their url', this allows them to include their page fom their own site, hope it make sense to you

     

    by the looks of it from me your safe

  4. lol u got a messy way of doing it

    ive made you the whole page

    <?php
    $host='db778.oneandone.co.uk';  
    $username='dbo191523062'; 
    $pass='zfMcsqnB'; 
    $database='db191523062'; 
    
    mysql_connect ($host, $username, $pass); 
    
    mysql_select_db($database) or die('Could not connect to the Database'); 
    
    if (isset($_POST["name"])) {
    $useremail = $_POST["useremail"];
    $name = $_POST["name"];
    if($rsname==NULL) {
    echo "some form of error";
    }else{
    $query = "INSERT INTO phpbb_users(`username`, `user_email`) VALUES('$name','$useremail')";
    mysql_query($query) or die(mysql_error());
    echo "succesfull";
    }
    }
    ?>
    <form method="POST" action="newslettertest4.php">
                            Name: <input type="text" name="name" size="20">
    
                Email:  <input type="text" name="useremail" size="20">
    
               
    
                           <button name="B1">Subscribe</button></p>
              </form>
    

  5. yup

     

    CREATE TABLE `users` (

      `id` int(11) NOT NULL auto_increment,

      `username` varchar(25) NOT NULL default '',

      `password` varchar(32) NOT NULL default '',

      PRIMARY KEY  (`id`)

    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

     

  6. heres my uploading images code, make a folder called uploads

    <?php 
    
    echo('Upload image<br><br>');
    
    
    $path = "uploads/"; 
    
    $max_size = 5000000; 
    
    
    
    if (!isset($HTTP_POST_FILES['userfile'])) exit; 
    
    
    
    if (is_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'])) { 
    
    
    
    if ($HTTP_POST_FILES['userfile']['size']>$max_size) { echo "The file is too big<br>"; exit; } 
    
    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 . $HTTP_POST_FILES['userfile']['name'])) { echo "The file already exists, try calling it a different name.<br>"; exit; } 
    
    
    
    $res = copy($HTTP_POST_FILES['userfile']['tmp_name'], $path . 
    
    $HTTP_POST_FILES['userfile']['name']); 
    
    if (!$res) { echo "upload failed!<br>"; exit; } else { echo "upload sucessful<br><br>"; } 
    
    
    
    echo "File Name: ".$HTTP_POST_FILES['userfile']['name']."<br>"; 
    echo "File Path: <a href=uploads/".$HTTP_POST_FILES['userfile']['name']." TARGET=_BLANK>uploads/".$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/".$HTTP_POST_FILES['userfile']['name']." width=200 height=250><br>";
    mysql_connect (your host,your username,your pass); 
    mysql_select_db($database) or die('Could not connect to the Database');
    $avatar2 = "";   
    mysql_query("UPDATE `users` SET `avatar` = 'uploads/".$HTTP_POST_FILES['userfile']['name']."' WHERE `username` = '$user';");
    echo "Profile Pic updated";
    } else { echo "Wrong file type<br>"; exit; } 
    
    } 
    
    
    
    $my_file = $HTTP_POST_FILES['userfile']['name'];
    
    
    ?> 
    

     

    heres the page before that

     

    <? echo "<FORM ENCTYPE=multipart/form-data ACTION='?page=Upload Clan Image&clan=$clan' METHOD=POST>"; ?> 
    
      <p>The file: 
        <INPUT TYPE="file" NAME="userfile" style="border: 1px solid #222222; background-color: #111111; color: #888888">
      </p>
      <p>
        <INPUT TYPE="submit" VALUE="Upload" style="border: 1px solid #222222; background-color: #111111; color: #888888">
      </p>
    </FORM> 
    

  7. oops just realised, i didnt coppy the full error, if it makes much difference

     

    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/www/d-pures.freehostia.com/pages/Apply.php on line 9

    Unknown column 'username' in 'field list'

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