Jump to content
xisto Community

rubikcode

Members
  • Content Count

    29
  • Joined

  • Last visited

1 Follower

About rubikcode

  • Rank
    Newbie [Level 2]
  • Birthday 03/07/1996

Contact Methods

  • Website URL
    http://rubikcode.co.nr/

Profile Information

  • Gender
    Male
  • Location
    Singapore
  1. You can try unsetting the values that you want to remove. <?php$array[0] = 10;$array[1] = 12;echo 'At first: ' . $array[0] . ', ' . $array[1];unset($array[1]);echo 'After: ' . $array[0] . ' ' . $array[1] . 'only!';?>
  2. I always use this simple code: <?php echo $_SERVER["REMOTE_ADDR"]; ?> It sends out the IP address of the current user. Therefore each user who visits their website gets a different value. after you have echoed it you may choose to store it in a database and retrieve it as an array later on (for listing, comparing etc)
  3. Id help if I wasnt just about to develop my first facebook app Its a game.Actually your idea isnt bad, and if you do not give up it may possibly be released soon enough.wish you guys luck!(actually you guys have given my an idea)
  4. reviewing truefusion's code: <select name="year" id="year"> <?php for($i=date("Y"); $i<=date("Y")+2; $i++) if($year == $i) echo "<option value='$i' selected>$i</option>"; else echo "<option value='$i'>$i</option>"; ?></select>
  5. Well w3schools.com should give you a neat fast uttorial. If you are the visual kind and are really desperate, why not by some videos: http://www.killerphp.com/
  6. You can try adding headers to force the computer into thinking that the pdf file is something else. ***Save it as A *PDF FILE*<?phpheader("Content-type:text/html");// The PDF source is in original.pdfreadfile("original.pdf");?> This code MUST be out at the top of the page. And it must be saved as a .pdf file. If you have access to httpd.conf, change the settings to allow pdfs to be read as text.
  7. assuming that you made the website from scratch: Normally you would want to change the HTML code and the database server queries/tables. Besides that, you will want to add functionality to all these new fields you created. Eg. adding an ICQ/ Skype button/line to let users talk to each other on the respective platforms. CMSes (and the Xisto forum) can give you a pretty good idea of what I mean. Using OpaQue's profile as an example: http://forums.xisto.com/user/1-opaque/
  8. Im sooo crazy about PHP.My entire library consists of 300+ files and classes. Ever since PHP 5 was released with OOP, i couldn't stop working with my notepad.I usually use WAMP to develop and my fav CMS is currently Drupal. Drupal is great and I am currently writing 3 modules for it.Hope more people learn PHP and get rid of those ugly static made-with-dreamweaver-wysiwyg websites!
  9. If you compare a simple button and a whole control panel, which is more likely to confuse you?Obviously onkarnath2001 should go for WAMP. It installs and works like any other program.Either way you can just start WAMP/XXAMP and copy your PHP files onto your www folder inside the installation path.
  10. I know this uses PHP/html and works just as well. No multiple uploads, though. Try making a workaround using ajax. Too tired to modify further. Please keep the acknowledgement line as it is. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://forums.xisto.com/no_longer_exists/; <html xmlns="http://forums.xisto.com/no_longer_exists/; xml:lang="en" lang="en"> <head> <title>File upload</title> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> </head> <body> <?php/*+++++++++++++++++++++++++++++++++++++++By Rubikcode 2007. Published under GNU General Public License.To be distributed with all header info (this paragraph/footer text) intact.Modifications are allowed so long as the owner of this script is acknowleged.+++++++++++++++++++++++++++++++++++++++Database settings[Table 1]------------------------| id | date | filename |------------------------+++++++++++++++++++++++++++++++++++++++InstructionsCreate an 'images' folder where this file is located. Prepare the database as shown above.You may modify the below to suit your needs (eg adding a Name field.)Add columns to the database and change the MySQL query data. Also change the HTML form fields at the bottom of the script. Just follow what is already put ther and all should be fine.+++++++++++++++++++++++++++++++++++++++*//*+++++++++++++++++++++++++++++++++++++++++++++++++VARIABLES*/ define('GW_MAXFILESIZE', 32768); // 32 KB define('GW_UPLOADPATH', 'images/'); // Define database constants define('DB_HOST', 'guitarwars.net;; define('DB_USER', 'admin'); define('DB_PASSWORD', 'rockit'); define('DB_NAME', 'Table 1');/*++++++++++++++++++++++++++++++++++++++++++++++++++*/ if (isset($_POST['submit'])) { // Connect to the database $dbc = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME); // Grab the data from the POST $screenshot = mysqli_real_escape_string($dbc, trim($_FILES['screenshot']['name'])); if (!empty($file)) { if (($file_size > 0) && ($file_size <= GW_MAXFILESIZE)) { if ($_FILES['file']['error'] == 0) { // Move the file to the target upload folder $target = GW_UPLOADPATH . $file; if (move_uploaded_file($_FILES['file']['tmp_name'], $target)) { // Write the data to the database $query = "INSERT INTO guitarwars (id, date, filename) VALUES (0, NOW(), '$file')"; mysqli_query($dbc, $query); // Confirm success with the user echo '<p>Thanks for adding your new file! It will be reviewed as soon as possible.</p>'; echo '<p>$file</p>'; echo '<p><a href="$_SERVER[\'PHP_SELF\']"><< Back</a></p>'; // Clear the data to clear the form $file = ""; mysqli_close($dbc); } else { // In case of error echo '<p class="error">Sorry, there was a problem uploading your file.</p>'; } } } else { // Another error echo '<p class="error">The screen shot must be no greater than ' . (GW_MAXFILESIZE / 1024) . ' KB in size.</p>'; } // Try to delete the temporary file @unlink($_FILES['file']['tmp_name']); } else { echo '<p class="error">Please enter all of the information to add your file.</p>'; } } // Form found Below?> <hr /> <form enctype="multipart/form-data" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo GW_MAXFILESIZE; ?>" /> <label for="screenshot">File:</label> <input type="file" id="file" name="file" /> <hr /> <input type="submit" value="Add" name="submit" /> </form><!-- DO NOT DELETE THIS! --><p>Powered by <a href=http://rubikcode.co.nr/>Rubikcode</a>.</body> </html> Please tell me if it works.
  11. PHP.net shows a pretty cool script that should work in your case: <?php/*Change all variables*/$file_locate = '"C:/User/file.php"';$adobe_locate = '"C:/Program Files/Adobe/Acrobat 7.0/Reader/AcroRd32.exe"'/*CODE*/function print_file($filename){ //Adobe $adobe_path=$adobe_locate; $ext=''; $ext=strrchr($filename,'.'); $ext=substr($ext,1); $ext_xl=substr($ext,0,2); if ($ext=='pdf') { shell_exec ($adobe_path.' /t '.$filename); } //Word (.doc, .rtf, .txt) else if ($ext=='doc'||$ext=='rtf'||$ext=='txt') { $word = new COM("Word.Application"); $word->visible = true; $word->Documents->Open($filename); $word->ActiveDocument->PrintOut(); $word->ActiveDocument->Close(); $word->Quit(); } //Excel else if ($ext_xl=='xl') { $excel = new COM("Excel.Application"); $excel->visible = true; $excel->Workbooks->Open($filename); $excel->ActiveWorkBook->PrintOut(); $excel->ActiveWorkBook->Close(); $excel->Quit(); }}//Prints the fileprint_file($file_locate);?> Hope this code will help you out. Change the variables according to your needs.
  12. I suspect that he wants to chmod the root directory of his system. Of course most host do not allow that for security reasons.
  13. Yes Easy PHP installs, apache, PHP, phpMyAdmin and MySQL into your OS. Basically it is an all-in-one hassle free package.
  14. Well Im a catholic not a Christian but many of my Christian friends have bought this study bible: http://forums.xisto.com/no_longer_exists/ Hope it works for you (There are a whole list more: http://forums.xisto.com/no_longer_exists/)
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.