wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
Not sure whats going on, your configuration works fine for me. I'd say uninstall Apache, after Apache has been uninstalled delete the Apache Software Foundation folder from C:\Program Files if is left over and then reinstall Apache. If still doesn't work, open the httpd.conf and goto line 53 which should be this: Listen 80 and change 80 to 8080 then scroll down go to line 145 which should be this: ServerName localhost:80 Change :80 to :8080 Save your httpd.conf and restart Apache. Open your browser and go to http://localhost:8080/ is anything displayed now?
-
php 5.0 and MYSQL 5.0 connection problem ?
wildteen88 replied to KTTHOOL's topic in PHP Installation and Configuration
No need to copy multiple instances of the same file to different location's in the file system. I highly suggest you keep all files that come with PHP in your PHP Installation folder and adding PHP to the PATH Environment Variable. What do you mean by the following: Do you get any errors, what shown on screen. Are you connecting to a remote database? Might want to post some code too. -
Thread closed. Please use the forum search feature, This question has been asked many times. Please refer to the thread linked by peranha for discussing which editor is best.
-
Make sure you have restarted your webserver (Apache or IIS) when modifying the php.ini. Also ensure your changes have made any affect by running the phpinfo() function within a script. If GD has loaded you should find a GD subheading. If you don't have a GD subheading then the extension hasn't loaded. I would first check that PHP is reading the php.ini you are currently modifying by looking at the Loaded Configuration File line when running phpinfo. The path stated should be the same path as the php.ini you are editing. If it is set as C:\WINDOWS or (none) then there is your problem, php is not reading your php.ini. I would recommend adding PHP to the PATH Environment Variable make sure your php.ini is located in your PHP installation folder and restart your computer. Run phpinfo again and check the Loaded Configuration File line is set correctly. If the Loaded Configuration File is set correctly and GD is still not showing up. Then enable a setting called display_startup_errors within the php.ini. Restart your webserver, whilst your server restarts you should find errors displayed if PHP is having any issues whilst loading.
-
You must have a php.ini file located in C:\WINNT\system32\ already. Search for any php.ini files on your computer and remove/rename them. Ensure you only have one php.ini file, which should be in C:\php Also no need to add both C:\php and C:\php\ext to the path. C:\php will do fine.
-
Attach you httpd.conf file here for me to review. Make sure your firewall isn't blocking port 80.
-
Rather than use a loop, just use implode
-
PHP Version 5.1.6 phpinfo doesn't show gd?
wildteen88 replied to phpnoobie9's topic in PHP Installation and Configuration
To enabled GD on unix based systems you need to install PHP with the --with-gd=[DIR] flag, change [DIR] to where GD is installed too. Also you'll need to enable the GD extension within the php.ini too. -
dreamweaver and php
wildteen88 replied to kwstephenchan's topic in Editor Help (PhpStorm, VS Code, etc)
No. DW 2004 can handle PHP just fine (regardless of PHP version). Have you setup a site definition in DW? You must tell DW a server is available for parsing .php files otherwise you'll get the output you are getting. To setup a site definition in DW to go to Site > New or Site > Manage Sites to manage an existing site definition, click the Advanced tab for configuration. Here is a Tutorial for setting up a Site definition in MX 2004 -
Your browser should automatically convert spaces to an underscore if a field name contains spaces. So if your field is named diet coke then you should be able to access it via PHP using $_POST['diet_coke'];
-
Installed GD library, but won't work?
wildteen88 replied to Local Hero's topic in PHP Installation and Configuration
I would recommend you to add PHP to the PATH Environment Variable. Also ensure PHP is reading the php.ini you are modifying by simply running phpinfo() function and looking to see if the path shown on the Load Configuration File line is the same path as your php.ini, you can also add the PHPIniDir directive too within Apaches httpd.conf which will force PHP to read the php.ini in the path provided, eg: PHPIniDir "C:/php/php-5.2.3-Win32" However adding PHP to the PATH should help. -
Apache wont respond with a 404 error message if it cannot find an index file listed within the DirectroyIndex directive. Instead it will either respond with a 403 forbidden error, or display files within the directory (if Indexes is set within the Options directive). @kwstephenchan. PHPMyAdmin does not need to have a config.ini.php in order for function it can run without one. You'll can run the phpMyAdmin setup script which will generate the config.ini.php for you. Please read the phpMyAdmin documentation for running the setup script. What happens when you go http://localhost/
-
Comma separated list from values in a database
wildteen88 replied to ven.ganeva's topic in PHP Coding Help
Simple example: <?php // array of categories $categories = array('one', 'two', 'three', 'four', 'five'); // take the last category out of the array $lastCat = array_pop($categories); // implode the array and concat the last // category from the array to the end of the string with correct grammer $categoriesList = implode(', ', $categories) . ' and ' . $lastCat; echo $categoriesList; // Output: one, two, three, four and five ?> -
If you do not understand the code, then I highly recommend that you learn the basics of PHP. I have not used any advanced code for the above scripts. Just play with them, if it breaks undo what changes you made.
-
What do you mean doesn't work? The password in htpassword will need to be encrypted by running the htpassword utility that came with Apache. Have a read of the Apache Documentation on Authentication with .htaccess/.htpassword.
-
installing server for local testing ... safe from internet???
wildteen88 replied to dsdsdsdsd's topic in Apache HTTP Server
You don't necessarily need to be connected to a router in order to deny access to your server installed on your computer. You can just deny external connections to port 80 (default port in which Apache runs on) within your firewall or change the port Apache listens to, to another port such as 8080 or some other random unused port of your choice. However if you change the port Apaches listens to you'll need to define it in your url, eg instead of using http://localhost/ to access Apache you'll need to use http://localhost:8080/ instead. Apache can also be setup to accept connections to certain ip address. By default Apache will accept connections from all ip addresses. -
in home.php just check to see if the postID variable exists, if it does display what you want, <?php // see if postID url parameter exists and holds a number if(isset($_GET['postID']) && is_numeric($_GET['postID'])) { echo 'Display Something else<br />postID: ' . $_GET['postID']; } else { echo 'Display Homepage'; } ?> Also I'd use a switch/case rather than an if/elseif/else statement for displaying the page: <?php if(isset($_GET['page']) && !empty($_GET['page'])) { $page = $_GET['page']; switch($page) { case 'home': case 'events': case 'employment': case 'gallery': case 'links': case 'djs': case 'vip': case 'forum': case 'contact': include './site/' . $page . '.php'; break; default: die('404 Error - Page does not exist'); } } else { die('404 Error - Page does not exist'); } ?>
-
how to implement cookies
wildteen88 replied to vishallokhande's topic in PHP Installation and Configuration
Not sure what you're wanting but to but to set cookies in PHP use set_cookie() function. To retrieve cookies use the $_COOKIE superglobal -
Ip addresses starting with 192.168.x.x will only work for your internal network. You will need to use your computers ip address (assigned by your ISP) in order connect to it remotely not your local network address.
-
Could use something like this: <?php // get data from file $lines = file('data.txt', FILE_IGNORE_NEW_LINES); // loop through data $tempDataArray = array(); foreach($lines as $line) { // get individual bits of data from tab delimited list list($col1, $name, $number, $col4, $col5) = explode("\t", $line); // Add data to a temprory array, assign the name field as the key for the new child-array $tempDataArray[$name] = array($col1, $number, $col4, $col5); } // sort temprory array. Ksort sorts array keys alphabetically. This is why we used the name field as the key ksort($tempDataArray); // for all data stored in our temprory array, we'll need to convert it back into a tab delimited list // initiate $newData variable as an empty string $newData = ''; // loop through temprory data array foreach($tempDataArray as $key => $bitsArray) { // pull data from sub array list($col1, $number, $col4, $col5) = $bitsArray; // concat each line into the newData string $newData .= "$col1\t$key\t$number\t$col4\t$col5\n"; } // write data to file file_put_contents('sortedData.txt', $newLine); ?>
-
You may also need to allow remote connections on port 80 through your firewall too.
-
I didn't thuroughly read your code. mysql_query doesn't return rows, it only returns the result resource. You'll need to use one of the various mysql_fetch_*() functions (* standing for row, array or assoc or object). I recommend mysql_fetch_assoc. So the following few lines: $result = mysql_query( " SELECT * FROM `login` WHERE `id` >= $random LIMIT 0,1 "); append_file('test.txt', '$result['id']<br>~<br>'); Should be: $result = mysql_query( " SELECT * FROM `login` WHERE `id` >= $random LIMIT 0,1 "); // run query $row = mysql_fetch_assoc($result); // return results append_file('test.txt', $row['id'] . '<br>~<br>'); If you query returns more than one row you'll need to use a while loop, eg: $result = mysql_query( " SELECT * FROM `login` WHERE `id` >= $random LIMIT 0,1 "); // run query // loop through results while($row = mysql_fetch_assoc($result)) { append_file('test.txt', $row['id'] . '<br>~<br>'); }
-
For one thing looking at your code, the following should be combined: $result = mysql_query("SELECT `mod` FROM products WHERE `specs` LIKE '%$restaurant_equipment%' ORDER BY `mod` LIMIT $start, $per_page"); $named = mysql_query("SELECT `name` FROM products WHERE `specs` LIKE '%$restaurant_equipment%' ORDER BY `mod` LIMIT $start, $per_page"); $maker = mysql_query("SELECT `man` FROM products WHERE `specs` LIKE '%$restaurant_equipment%' ORDER BY `mod` LIMIT $start, $per_page"); $cost = mysql_query("SELECT `price` FROM products WHERE `specs` LIKE '%$restaurant_equipment%' ORDER BY `mod` LIMIT $start, $per_page"); You are doing the same query each time, except you return a different row. You can return multiple rows from a query like so: $result = mysql_query("SELECT `mod`, `name`, `man`, `price` FROM products WHERE `specs` LIKE '%$restaurant_equipment%' ORDER BY `mod` LIMIT $start, $per_page");