Jump to content

droidus

Members
  • Posts

    160
  • Joined

  • Last visited

    Never

Posts posted by droidus

  1. 	// If the folder is not in the default position, we must place it in the right spot
    for ($i = 0; $i<$filesCount; $i++) {
    	if($filesCount[$i] != null) {
    		if($folderDestination!="default") {
        			if (file_exists("users/" . $_SESSION['user'] . "/uploads/" . $folderDestination . "/" . $_FILES["file"]["name"][$i]))
    			{
    				echo $_FILES["file"]["name"][$i] . " already exists.<br>";
    			}
    			else
    			{
    				move_uploaded_file($_FILES["file"]["tmp_name"][$i],
    				"users/" . $_SESSION['user'] . "/uploads/" . $folderDestination . "/" .  $_FILES["file"]["name"][$i]);
    				echo "Your file has been successfully uploaded, and you can now view it right away!<br><a href='users/' . $_SESSION[user] .'/uploads/' . $folderDestination . '/' .  $_FILES[file][name][$i]Click here to go to your file!";
    			}
    		} 
    		else 
    		{ // If else, we put it in the uploads folder
    			if (file_exists("users/" . $_SESSION['user'] . "/uploads/" . $_FILES["file"]["name"][$i]))
    			{
    				echo $_FILES["file"]["name"][$i] . " already exists.<br>";
    			} 
    			else 
    			{
          				move_uploaded_file($_FILES["file"]["tmp_name"][$i],
          				"users/" . $_SESSION['user'] . "/uploads/" . $_FILES["file"]["name"][$i]);
      				echo "Your file has been successfully uploaded, and you can now view it right away!<br><a href='users/$_SESSION[user] /uploads/$_FILES[file][name][$i]' target='_blank'>Click here to go to your file</a>!";
          			}
    		}
    	} else { echo "Please select some files to upload first!"; }
    }
    

  2. @Kira,

     

    The proper way to check a checkbox is with checked="checked"

     

    $checked = ($IPCheck) ? "checked='checked' "; : '';
    echo "<input type='checkbox' name='ip_automatic_login' id='ip_automatic_login' value='1' {$checked}/>";

     

    i am using an echo statement though, so i had to change the code around:

     

    echo " $checked = ($IPCheck) ? \"checked='checked' \"; : '';
    echo \"<input type='checkbox' name='ip_automatic_login' id='ip_automatic_login' value='1' {$checked}/>\"; ";
    

     

    all i get though, is this:

     

    ? = (1) ? "checked='checked' "; : ''; echo ""; 

  3. how do i echo "checked=checked" for a checkbox?  here is what i have:

     

    <input type='checkbox' name='ip_automatic_login' id='ip_automatic_login' value='1' if($IPCheck == true) {/"checked=checked/" } />

     

    this code will be echoed!

  4. i have an issue with my tabs container not being properly placed in the page content div holder.  here is an image of what it looks like.

    how can i change this, so it works?

    code:

    <div style="margin-left:auto; margin-right:auto; background-color:#FF9; padding:15px; width:75%;">
    <p>
    <ul id="menu">
    		<li class="active"><a href="#description">Inbox</a></li>
    		<li><a href="#usage">Sent</a></li>
    
    		<li><a href="#download">Compose</a></li>
    	</ul>
    	<div id="description" class="content">
    		<h2>Inbox</h2>
    
    	</div>
    	<div id="usage" class="content">
    		<h2>Tab Two</h2>
    
    	</div>
    
      <div id="download" class="content">
    <h2>Compose</h2>
    		<a href="http://mywebsite.com/uploader/compose.php">Compose a message here</a>.</div>
    
    	<script type="text/javascript">
    
    		$(document).ready(function () {
    			$('#menu').tabify();
    		});
    
    		// ]]>
    	</script>
    
    <hr  />
    <span style="font-size:12px;">Copyright 2011 All Rights Reserved. Contact Us. Using this service, you agree to the <a href="#">Terms and Conditions</a>. V 1.0.</span>
    </div>
    

     

    is it more of a css issue?

     

    thanks in advance.

     

    [attachment deleted by admin]

  5. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>

  6. i have:

     

    <div style="margin-left:auto; margin-right:auto; background-color:#FF9; padding:15px; width:75%;">

    <div style="margin-left:auto; margin-right:auto; width:620px;">

    // then script code here...

     

    [attachment deleted by admin]

  7. i am trying to align content to the center, but it doesn't seem to  want to center.  is there any reason that this code wouldn't work?

     

    <div style="margin-left:auto; margin-right:auto; width:620px;">

  8. //If there are sent messages, display them
    if (mysql_num_rows($result) > 0) {
    
        //Open table and create headers
        echo "<table border=\"1\">\n";
        echo "  <tr>\n";
    echo "    <th>Recipient</th>\n";
        echo "    <th>Subject</th>\n";
        echo "  </tr>\n";
    
    while(mysql_fetch_array($result))
    {
    	//Show messages
    	$userIDTo = $row['userIDTo']; // Get the recipient's ID number
    	$recipient = checkRecipient($userIDTo); // Get the sender's Username
    	$messageID = $row['ID'];
            echo "  <tr>\n";
    	echo "    <td>{$recipient}</td>\n";
            echo "    <td><a href='messageDetails.php?messageID=$messageID' target='_blank'>{$row['subject']}</a></td>\n";
            echo "  <tr>\n";
    } 
    
        //Close table
        echo "</table>\n";
    } else {
    echo "bad"; }
    ?>

  9. nope :P already tried it.  still returning one.  attached, is what my database looks like.

     

    here is my code for the sent messages:

     

    <?php
    function checkRecipient ($userIDTo) { // Find out who received the message (username)
    $query = "SELECT `uname`, `ID`
        FROM members
        WHERE ID='$userIDTo'";  
    $result = mysql_query($query) or die(mysql_error());
    if (mysql_num_rows($result) > 0)
    {
    	$row = mysql_fetch_array($result) or die(mysql_error());
    	$recipientUsername = $row['uname'];
    }
    return $recipientUsername;
    }
    
    mysql_select_db($database_uploader, $uploader); // Get the user's ID
    $query = "SELECT `uname`, `ID`
              FROM members
              WHERE uname='$_SESSION[user]'";
    $result = mysql_query($query) or die(mysql_error());
    if (mysql_num_rows($result) > 0) {
    $row = mysql_fetch_array($result) or die(mysql_error());
    $userID = $row['ID'];
    }
    
    mysql_select_db($database_uploader, $uploader); // Get's all of the user's sent messages
    $query = "SELECT `userIDTo`, `subject`, `ID`
              FROM memberMail
              WHERE userIDFrom='$userID' AND sent='1'";
    $result = mysql_query($query) or die(mysql_error());
    
    //Display number of unread messages
    $num_rows = mysql_num_rows($result);
    mysql_select_db($database_uploader, $uploader);
    echo "You have ($num_rows) sent message(s): <p>";
    
    //If there are sent messages, display them
    if ($row = mysql_num_rows($result) > 0) {
    $row = mysql_fetch_array($result) or die(mysql_error());
    
        //Open table and create headers
        echo "<table border=\"1\">\n";
        echo "  <tr>\n";
    echo "    <th>Recipient</th>\n";
        echo "    <th>Subject</th>\n";
        echo "  </tr>\n";
    
    while( $row = mysql_fetch_array($result))
    {
    	//Show messages
    	$userIDTo = $row['userIDTo']; // Get the recipient's ID number
    	$recipient = checkRecipient($userIDTo); // Get the sender's Username
    	$messageID = $row['ID'];
            echo "  <tr>\n";
    	echo "    <td>{$recipient}</td>\n";
            echo "    <td><a href='messageDetails.php?messageID=$messageID' target='_blank'>{$row['subject']}</a></td>\n";
            echo "  <tr>\n";
    } 
    
        //Close table
        echo "</table>\n";
    } else {
    echo "bad"; }
    ?>

     

    [attachment deleted by admin]

  10. i am having issues returning all sent messages.  it will only return one for some reason.

     

    //If there are sent messages, display them
    if ($row = mysql_num_rows($result) > 0) {
    $row = mysql_fetch_array($result) or die(mysql_error());
    
        //Open table and create headers
        echo "<table border=\"1\">\n";
        echo "  <tr>\n";
    echo "    <th>Recipient</th>\n";
        echo "    <th>Subject</th>\n";
        echo "  </tr>\n";
    
    while(mysql_fetch_array($result))
    {
    	//Show messages
    	$userIDTo = $row['userIDTo']; // Get the recipient's ID number
    	$recipient = checkRecipient($userIDTo); // Get the sender's Username
    	$messageID = $row['ID'];
            echo "  <tr>\n";
    	echo "    <td>{$recipient}</td>\n";
            echo "    <td><a href='messageDetails.php?messageID=$messageID' target='_blank'>{$row['subject']}</a></td>\n";
            echo "  <tr>\n";
    }

     

    thanks in advance.

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