-
Content Count
29 -
Joined
-
Last visited
Everything posted by rubikcode
-
Remove A Value From A Php Array Based On Its Value
rubikcode replied to sonesay's topic in Programming
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!';?> -
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)
-
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)
-
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>
-
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/
-
How To Display Temperature Of Any State Or Locality In Our Website?
rubikcode replied to contactskn's topic in Programming
Widget box has a pretty good widget. http://flite.com/ -
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.
-
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/
-
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!
-
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.
-
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.
-
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.
-
I suspect that he wants to chmod the root directory of his system. Of course most host do not allow that for security reasons.
-
Setting up easyPHP on your local computer tutorial
rubikcode replied to noxit's topic in General Discussion
Yes Easy PHP installs, apache, PHP, phpMyAdmin and MySQL into your OS. Basically it is an all-in-one hassle free package. -
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/)
-
Best Way To Transfer Files I just bought a laptop
rubikcode replied to disneyreporter's topic in Science and Technology
Well you can use the Windows Easy transfer utility available in Windows Vista. If I'm not wrong Windows XP users can download it for free at microsoft.com/downloads. You can buy a high-speed easy transfer cable. Just check this page out: http://forums.xisto.com/no_longer_exists/ -
Well yeah those were the old days.And yes I do love the St Fromond mission. It requires a fair amount of multitasking. (Though I cheat by pausing the game =P)
-
Is There Anyway To Make Winxp Start Faster? booting up so long...
rubikcode replied to nicky1's topic in Operating Systems
Well Windows defender now has the same features. Just tick off all unwanted start-up programs.Well I used APV before and I certainly liked it. But of course I just use whatever is built in... -
Adding on to what is said, you should add an INFO file or something for each template and store certain variables in a database.Of course in more sophisticated CMSes Pure HTML isn't used but generated GIF/PNG border images.
-
What exactly are you using this for? because if you are using it for a login/logout/registration script it would cause a lot of security issues with the password being sent around in URLs.It would be safer to use Javascript and work around a solution. Better still just bear with a submit button. Get is just too insecure.Anyway, thats just my opinion.
-
In my opinion this might screw up the menu if there are too many posts. Try to limit the amount posted on the menu: <?php wp_list_pages('title_li=&sort_column=menu_order&number="10"'); ?> This will limit the number of menu items shown to only 10. Other elements that can be tweaked as rvalkass said can be found at this page.
-
Woah that's a massive amount there...Do you actually need that much RAM? 4 GB should be enough for Win7. I use vista on 4 GB and everything i fast enough. even with games/photoshop running simultaneously. Nice choice of monitors. I love the sleek look that Apple never fails to give.Hope your project goes well!
-
Well the the way the websites show it they are under one big umbrella company, but each site does different things... eg. forums, hosting, support etc.\Hope this helps and correct me if i'm wrong.
-
Ok thank you for the quick reply.I'll start posting now!
-
well i checked out a video just now: http://forums.xisto.com/no_longer_exists/ This is a great invention, something that ought to be thought up long ago. However, there are some areas which can be improved. like how can you play a piano with such a mini screen? Maybe a physical extension can be created, or multiple iphones working as the same instrument.... that would be really cool.... maybe even drum kits can be thought up. Either way, they'd better do something about the speakers. They look horrible and ought to be placed somewhere else.... maybe on the floor or something.