PHP - Totally Befuzzled With Installation!
Hi folks,
Please go easy on me - total newbie. I've read all sorts of stuff on the web about how to get up and running with PHP but even the basic instructions are too complicated for me!
Here's what I want to do:
I want to use PHP to generate dynamic web pages linked to a Microsoft Access 2007 database as a test on my laptop (no need to publish to the actual Internet). I am running Windows 7 Professional SP1.
I know I need to install PHP and a web server of sorts. I tried to get IIS7 working but was foxed by the requirement to use an admin account (I don't have the admin password and didn't know how to run things as admin from my own account).
I basically need a step-by-step guide that assumes I know nothing.
Sorry if this is a big ask,
Matt
Similar TutorialsHi, I have a school project and I would like to create a simple website (very simple) to ask some survey questions and record the answers into a text file. Could someone show me sample code that will present the question "Please discuss your best experience during the course:" presents a text box to provide the person a chance to respond and then appends the response to a file "experiences.txt" when the person selects a submit button. I have to do about 25 questions and will write the code and post an example of what I think it has to do. I just need some help getting started. I will be researching this for the next couple of weeks, anyone who can start pointing me in the right direction your help is greatly appreciated. If you feel you would be doing too much of my work for me, please point me toward a tutorial or guide document where I might be able to figure this out on my own. Thank you for the help! Mike Basically, I have a series of radio buttons (wanted checkboxes) were people select either Latte, Mocha or Cappuccino. I have included a hidden field for a price and using that to bring in the prices and add them up. Code: [Select] <label for"Latte">Latte <br />€ 2.15</label> <br /> <input type="radio" name="coffee" id="Latte" value="Latte"> <input name="LattePrice" type="hidden" value="2.15"> </p> <p> <label>Mocha <br /> € 2.25</label> <br /> <input type="radio" name="coffee" id="Mocha" value="Mocha"> <input name="MochaPrice" type="hidden" value="2.25"> </p> <p> <label>Cappucino <br /> €2.35</label> <br /> <input type="radio" name="coffee" id="Cappucino" value="Cappucino"> <input name="CappPrice" type="hidden" value="2.35"> </p> The next section they choose the size they want Small, Medium or Large. Code: [Select] <p> <label for="latteSmall">Small </label><img src="images/latte.png" alt="Small Latte" width="36" height="36"> <input type="radio" name="size" id="LatteSmall" value="Small"> <input name="SizePrice" type="hidden" value="0.00"> </p> <p> <label for="LatteMedium">Medium <br /> + € 0.25 </label> <img src="images/latte.png" alt="Medium Latte" width="42" height="42"> <input type="radio" name="size" id="LatteMedium" value="Medium"> <input name="SizePrice" type="hidden" value="0.25"> </p> <p> <label for="latteLarge">Large <br /> + € 0.45 </label> <img src="images/latte.png" alt="Large Latte" width="49" height="49"> <input type="radio" name="size" id="LatteLarge" value="Large"> <input name="SizePrice" type="hidden" value="0.45"> </p> I chose radio buttons to limit the users choice to one coffee and one size to make life easier (for myself). Ideally I wanted to use checkboxes but I could not get the php working. So basically, If Latte is selected echo it and the size. Code: [Select] echo "Hi ". $name. ", " . "here is your order:" . "<br /> <br />"; echo "<strong>" . "Coffee:" . "</strong>" . "<br />" . $size . " " . $coffee . "<br /><br />"; That works fine but the pricing is coming out wrong as I was using: Code: [Select] if ($coffee == "Latte") { $TotalCoffeePrice = $LattePrice + $SizePrice; echo "€ " . $TotalCoffeePrice . "<br /> <br />"; } elseif ($coffee == "Mocha") { $TotalCoffeePrice = $MochaPrice + $SizePrice; echo "€ " . $TotalCoffeePrice . "<br /> <br />"; } elseif ($coffee == "Cappucino") { $TotalCoffeePrice = $CappPrice + $SizePrice; echo "€ " . $TotalCoffeePrice . "<br /> <br />"; } What is happening here is if you select Latte and then Small it was adding Small, Medium and Large prices to the Latte. So instead of 2.15 I was getting 2.80 or something like that. Obviously when I recognised this I tried an array but that just went arseways!! Also, at the end of the php I was hoping to total up everything that they chose with: Code: [Select] $TotalPrice = ($TotalCoffeePrice + $SizePrice + $MuffinPrice + $SamboPrice); echo "<strong>" . "Total Price:" . "</strong>" . "<br />" . "€ " .$TotalPrice . "<br /><br />"; However, this was giving a total of 9.80 even when nothing was selected! hello. i have posted something similar before and people said i should go away and learn oop. I have since done the entire Linda training on oop, watched countless videos and build a photo gallery (from the training videos) but im still stuck on this silly little thing. so please please could some one help. thanks ok, so i have 2 classes. 1 called Pages and 1 called Templates. each page has an id for the layout it wants to use. so i want to get the layoutTemps_id from the pages class and use it in a function WHERE clause to get the correct layout for that page. I cant seem to pass the layoutTemps_id into my Templates class from my Pages Class ??? i tried using a global but couldnt get it to work. ANY IDEAS ?? thanks this is the Pages class function that gets all the information for each page. Code: [Select] public static function find_by_pageName($pName){ global $database; $sql = "SELECT * FROM ".self::$table_name." WHERE pageName='".$database->escape_value($pName)."'"; $result_array = self::find_by_sql($sql); return !empty($result_array) ? array_shift($result_array) : false; } that works just fine. it gets the $pName on the page and is different each time. i.e Code: [Select] $pName = "adminHome"; $page = Pages::find_by_pageName($pName); echo $page->id."<br />"; echo $page->layoutTemps_id.'<br/>'; so that all seems to work fine. now i want to use the $page->layoutTemps_id in my Templates class. this is the class class Templates extends Pages { this is the function im trying to write. i thought that because class Templates extends Pages i could put in $page->layoutTemps_id with no problem but in stuck. Code: [Select] public static function find_layoutTemp(){ $layoutTemps_id = Pages::layoutTemps_id; $sql = "SELECT * FROM ".self::$table_name." WHERE id='".$database->escape_value($layoutTemps_id)."'"; $result_array = self::find_by_sql($sql); return !empty($result_array) ? array_shift($result_array) : false; } this is the page where im echoing the layoutTemps_id Code: [Select] <?PHP require_once("../includes/initialize.php"); $temp = Templates::find_layoutTemp(); echo "layoutTemp id " .$temp->id . " <br />"; echo "layoutTemp name " .$temp->name ." <br />"; now, i'm 100% sure there's lots wrong with my code but i'm ill be happy if someone could help. thanks rick Hi i am trying to use xdebug 2.1.0, i have installed it on linux wth php version 5.2.5, Can any one tell me the correct php version for 2.1.0 this . What is this phpize and php-config tools.....where to find and how........tell some examples to use xdebug. Thanks, Im looking to use this library but if i use this sample: <?php // test_cairo.php $s = new CairoImageSurface(CairoFormat::ARGB32, 400, 400); $c = new CairoContext($s); $c->fill(); $c->setSourceRGB(1, 0, 0); $c->setLineWidth(50); $c->arc(200, 200, 100, 0, 2 * M_PI); $c->stroke(); $c->setSourceRGB(0, 0, 0.6); $c->rectangle(0, 160, 400, 75); $c->fill(); $s->writeToPng(dirname(__FILE__) . '/test.png'); It dont works, seems undefined, and checking for the url that php manuals tells to visit i dont work: http://perisama.net/cairo/ How i can install and test it? I use php 6. Hello, I am attempting to get the base URL of the directory that the CMS was installed, not the main directory. Here's what I mean: For example, let's say my domain is http://www.example.com but I install my CMS under http://www.example.com/test/cms and on another occasion I install it under http://www.example.com/cms, and on another occasion http://www.example.com/my/new/cms/ I would like my base url for the http://www.example.com/cms installation, to be "http://www.example.com/cms" and my base url for the http://www.example.com/test/cms installation to be "http://www.example.com/test/cms" and so on, without me having to manually change anything. How do I go about obtaining the directory that corresponds to that particular installation? I know it is possible because Joomla does it automatically. I have already tried numerous combinations using $_SERVER['HTTP_HOST'], $_SERVER['REQUEST_URI'], $_SERVER['SCRIPT_NAME'], and so on, no luck. Hi All! I'm totally new to website design and do not know much about it. I installed a MYUPB forum on my website, but I got an error concerning timezone in the file upb.initialize.php on line 124. It was to Europe/London so I changed it to Americe/Montreal. (I'm in GMT-5) After this modification, I get this error when trying to access my forum. Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /www/110mb.com/m/k/7/4/j/e/e/p/mk74jeep/htdocs/forum/includes/upb.initialize.php on line 21 I tried to correct for any mistake but could not find any since I do not know much. I need your help please. Here is the file section. BTW, Is line 1 <?php ??? Code: [Select] <?php function RemoveXSS($val) { $before_val = $val; // remove all non-printable characters. CR(0a) and LF(0b) and TAB(9) are allowed // this prevents some character re-spacing such as <javaA533;script> // note that you have to handle splits with n, r, and t later since they *are* allowed in some inputs //echo "COMMA COUNT: ".substr_count($val,'x2C')."<br>"; $val = preg_replace('/([x00-x08x0b-x0cx0e-x19])/', '', $val); // straight replacements, the user should never need these since they're normal characters // this prevents like <IMG SRC=@avascript:alert('XSS')> $search = 'abcdefghijklmnopqrstuvwxyz'; $search .= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; $search .= '1234567890!@#$%^&*()'; $search .= '~`";:?+/={}[]-_|''; for ($i = 0; $i < strlen($search); $i++) { // ;? matches the ;, which is optional // 0{0,7} matches any padded zeros, which are optional and go up to 8 chars // @ @ search for the hex values $val = preg_replace('/(&#[xX]0{0,8}'.dechex(ord($search[$i])).';?)/i', $search[$i], $val); // with a ; // @ @ 0{0,7} matches '0' zero to seven times $val = preg_replace('/(�{0,8}'.ord($search[$i]).';?)/', $search[$i], $val); // with a ; } // now the only remaining whitespace attacks are t, n, and r Etc etc etc... Please, let me know what is wrong! My website location is mk74jeep.110mb.com/forum I have no problem starting all over again and reinstalling it, if someone feel like helping me step by step with this. This would be really appreciated. Thanks in advance! This topic has been moved to PHP Installation & Configuration. http://www.phpfreaks.com/forums/index.php?topic=330078.0 Code: [Select] <?php $myServer = "<remote ip>"; $myUser = "<username>"; $myPass = "<password>"; $myDB = "FAP2"; //create an instance of the ADO connection object $conn = new COM ("ADODB.Connection") or die("Cannot start ADO"); ?> No error messages reported, but page "dies" at this point. The ubuntu machine can see the sql machine, but yet this is happening. For reasons unknown to me I installed this version of MSSQL 2008 R2 yesterday and it came with an attached database for which I was able to add my own database to. I had to uninstall and reinstall this version because I was having some permissions conflicts....now when I reinstalled the 2008 R2, there is no database attached. There is no preinstalled db engine. I do not know how to create this or drop my db into the object explorer because there is no db attached. I hope this makes sense.
What I am trying to do is set up a test server on my home computer. I saved the actual db from a work computer onto a thumbdrive. Now, I want to attach it to my home server. That option is not there to connect now. Thank you for any help.
Dear forum wrestlers:
Finally found a good mix of MySQL 5.1.65, win8.1, Apache 2.4.9 ssl-win32,0.9.8-VC9 (from Apachelounge), and php-win32-VC9-x86 (thread safe!). Openssl seems to be working also. But somehow lost the headers and trailers on the menus! Does anyone know what may be wrong?
Thanks always,
Yshua
Say I have an installation file, and they type in all their database information & click submit. How would I get that information to open up a file called config.php, and write to the $db_host, $db_pass, $db_user, and $db variables only? Is this possible? Thanks! hello and good day dear Linux-experts, i want to install a new opensuse linux on a notebook. i want to upgrade is the following: this one: Akoya P 6512 15" OpenSuse 13.1: AMD Athlon X2 P320, 2,10 GHz, 4 GB 320 GB hdd-drive what is wanted: i want to do a total fresh installation i want to have not tooo much partitions! i only want to run opensuse 13.2 i want to have some kind of native linux partitions - such as ext 4 - # what do you suggest - should go with the new default BTRFS file system?!? well to begin with the beginning: i applied the following commands a. lsblk b. fdisk -l see the results,,,, ; linux-c5sz:/home/martin # lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 465,8G 0 disk ├─sda1 8:1 0 4G 0 part [SWAP] ├─sda2 8:2 0 102M 0 part ├─sda4 8:4 0 1K 0 part ├─sda5 8:5 0 2G 0 part ├─sda6 8:6 0 4G 0 part ├─sda7 8:7 0 10G 0 part ├─sda8 8:8 0 20G 0 part / └─sda9 8:9 0 389,6G 0 part /home sr0 11:0 1 1024M 0 rom and the following fdisk -l linux-c5sz:/home/martin # fdisk -l Disk /dev/sda: 500.1 GB, 500107862016 bytes, 976773168 sectors Units = Sektoren of 1 * 512 = 512 byte Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos Disk identifier: 0xb8fa3ecd Gerät boot. Anfang Ende Blöcke Id System /dev/sda1 63 8385929 4192933+ 82 Linux swap / Solaris /dev/sda2 8385930 8594774 104422+ 83 Linux /dev/sda4 * 8803620 976768064 483982222+ 5 Extended /dev/sda5 8803683 12996584 2096451 83 Linux /dev/sda6 12996648 21382514 4192933+ 83 Linux /dev/sda7 21382578 42347339 10482381 83 Linux /dev/sda8 117821440 159766527 20972544 83 Linux /dev/sda9 159768576 976766975 408499200 83 Linux linux-c5sz:/home/martin # subsequently the questions; which partition logic should i choose. what is wanted: i want to have not tooo much partitions! i only want to run opensuse 13.2 note: i want to erase all the existing partition logic /(that is currently existing) i do this with Gparted. which partitions should i take? which file system ? i am curious to get to know your ideas linux-file-structu what needs to be saved while moving the installation
well this is one of the best place to ask joomla-related question. today i have no question regarding joomla. today i want to ask a linux-question: i am preparing a upgrade from opensuse 13.1 to 13.2 and i want to do a fresh installation. first of all - as a preliminary task i will do a saving of all the files - that are in the home of the current installation what else shoud i safe - more than the /home/my_name should i save anyting else ... http://tldp.org/LDP/...sect_03_01.html Table 3-2. Subdirectories of the root directory Directory Content /bin Common programs, shared by the system, the system administrator and the users. /boot The startup files and the kernel, vmlinuz. In some recent distributions also grub data. Grub is the GRand Unified Boot loader and is an attempt to get rid of the many different boot-loaders we know today. /dev Contains references to all the CPU peripheral hardware, which are represented as files with special properties. /etc Most important system configuration files are in /etc, this directory contains data similar to those in the Control Panel in Windows /home Home directories of the common users. /initrd (on some distributions) Information for booting. Do not remove! /lib Library files, includes files for all kinds of programs needed by the system and the users. /lost+found Every partition has a lost+found in its upper directory. Files that were saved during failures are here. /misc For miscellaneous purposes. /mnt Standard mount point for external file systems, e.g. a CD-ROM or a digital camera. /net Standard mount point for entire remote file systems /opt Typically contains extra and third party software. /proc A virtual file system containing information about system resources. More information about the meaning of the files in proc is obtained by entering the command man proc in a terminal window. The file proc.txt discusses the virtual file system in detail. /root The administrative user's home directory. Mind the difference between /, the root directory and /root, the home directory of the root user. /sbin Programs for use by the system and the system administrator. /tmp Temporary space for use by the system, cleaned upon reboot, so don't use this for saving any work! /usr Programs, libraries, documentation etc. for all user-related programs. /var Storage for all variable files and temporary files created by users, such as log files, the mail queue, the print spooler area, space for temporary storage of files downloaded from the Internet, or to keep an image of a CD before burning it. well - reagarding the thunderbird and other things more. note: i have thunderbird and enigmail up and running. so i need to save a. the passwords b. the mails. question: is there a need to save more than the home/my_name ?! love to hear from you greetings |