wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
Ok first of all disable all extensions you have enabled within the php.ini and re-save the php.ini. Restart Apache and test php again. If still doesn't work go to Apaches conf/ folder (Default path is something like C:/Program Files/Apache Foundation/Apache2/conf). Open the default folder and copy a file called httpd.conf and paste it into the conf/ folder overwriting the existing configuration file. Open the new httpd.conf in Notepad. Add the following lines at the very bottom # PHP configuration LoadModule php5_module "C:/Program Files/PHP/php5apache2_2.dll" PHPIniDir "C:/Program Files/PHP" AddType application/x-httpd-php .php NOTE: Change C:/Program Files/PHP/ to your actual PHP Installation path. Save the httpd.conf and restart Apache. Now test PHP again. Does PHP now function correctly? Another step is to add PHP to the PATH Environment Variable. Windows will need to be restarted after changing the PATH Environment Variable. After windows has loaded enable the extensions you wish to use one by one (making sure you restart Apache each time and running phpinfo() to make sure your changes have taken place).
-
You can create .htaccess files fine in windows. Open Notepad click File > Save As.. type C:\.htaccess in the Filename box. Now select All Files from the File Type pull down menu. Click the Save button and viola a .htaccess file should of been created in the root of the C: drive.
-
My code maintains the aspect ratio of the uploaded image, it wont resize the image exactly to 532 x 100. If it did all images would get distorted.
-
Now you should have a bunch .php files correct? You'll now need to upload/move the extracted files to your webserver. Read the Documention for installation
-
phpMyEdit comes in a tar.gz file, which is a compressed archive . Make sure you have winRAR installed in order to extract the contents from the archive.
-
That error normally means PHP is trying to startup a library/extension which is not of the same build as the PHP interpreter.
-
Have you configured Apache? Was PHP installed manually or by the PHP installer? Have you restarted Apache?
-
Really! GD works fine for me. Try the following code: <?php if(isset($_POST['Submit'])) { // define the max width and height of uploaded images $max_width = 532; $max_height = 100; // define folder inwhich the images get uploaded to $upload_dir = '../../images/page_images/'; // get uploaded image data from form $file_name = $_FILES['image']['name']; $file_tmp = $_FILES['image']['tmp_name']; $file_size = $_FILES['image']['size']; $file_type = $_FILES['image']['type']; // get info about uploaded image list($width, $height, $type, $attr) = getimagesize($file_tmp); // set the full upload path for where to upload the image to. $img_path = $upload_dir . $file_name; // check to see if the uploaded image is bigger tha max width an height // if it is we'll crop the image if($width > $max_width && $height > $max_height) { // image is too big so we'll crop it // get the aspect ratio of the image // we do this so we can keep the aspect ratio when the image gets cropped. $aspect_ratio = $height / $width; $new_width = $max_height / $aspect_ratio; // create a blank canvas for the size of the image // this is what the image will get cropped to $img_rs = imagecreatetruecolor($new_width, $max_height); // setup a image resource to the uploaded file $img = imageCreateFromJPEG($file_tmp); // crop the image imagecopyresampled($img_rs, $img, 0, 0, 0, 0, $new_width, $max_height, ImageSX($img), ImageSY($img)); // create the image ImageJPEG($img_rs, $img_path); // destroy the temporary image imagedestroy($img_rs); } else { // uploaded image is under the max width and hieght // we'll just upload it straight away move_uploaded_file($file_tmp, $img_path); } // display the image echo "<h1>Upload Image:</h1>\n\n<img src=\"$img_path\">"; } else { echo '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '" enctype="multipart/form-data"> <input type="file" name="image"><p> <input type="Submit" name="Submit" value="Submit"> </form>'; } ?>
-
What part did you not understand? magic quotes or the urlencode / urldecode functions?
-
php 5.0 and MYSQL 5.0 connection problem ?
wildteen88 replied to KTTHOOL's topic in PHP Installation and Configuration
Gald everything is working fine now. You should note that you do not need to run the registry files. -
You should use $_GET['page'] rather than $page when retrieving the page variable from the url.
-
Chris92, your code wont work. file() returns the lines of the file being read into an array. So need to use explode. <?php $bbcode = file("code.txt", FILE_IGNORE_NEW_LINES); $bbreplacements = file("replacments.txt", FILE_IGNORE_NEW_LINES); $shortnews = str_replace($bbcode, $bbreplacements, $shortnews); ?>
-
Looks like you have magic quotes enabled, you'll need to use stripslashes: <?php if(isset($_GET['notices'])) { $notices = (get_magic_quotes_gpc()) ? stripslashes(urldecode($_GET['notices'])) : urldecode($_GET['notices']); } else { $notices = '<Enter notices>'; } ?> <form action="savenotices.php" method="post"> <textarea name="notices" cols="100" rows="10" id="notices" ><?php echo $notices; ?></textarea><br /> <input name="Submit" type="submit" value="Send"/> </form> <?php $notices = (get_magic_quotes_gpc()) ? stripslashes($_POST['notices']) : $_POST['notices']; echo ' <br> output is ' . htmlentities($notices) . '<br> <br> <a href="addnotices.php?notices=' . urlencode($notices) . '"> Edit! </a>'; ?>
-
For a more use friendly documentiont go to http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html instead.
-
use urlencode when sending strings which contain special characters over the url (especially those than contain spaces) and then use urldecode when your receive them,: <form action="savenotices.php" method="post"> <textarea name="notices" cols="100" rows="10" id="notices" ><?php echo urldecode($_GET['notices']); ?></textarea><br /> <input name="Submit" type="submit" value="Send"/> </form> <?php $notices = $_POST['notices']; echo " <br> output is $notices <br> "; echo "<br><a href=\"addnotices.php?notices=" . urlencode($notices) . "\"> Edit! </a> <br><br>"; ?>
-
In you code you have an html error, The following tag is ended wrong: <div id="text_about"; Notice the semi-colon at the end, this should be a less than sign (>), so the above line should be: <div id="text_about"> Also the following line has a bug: if($new == $new2 && !$new2=''){ You use the assignment operator (=) rather than the comparison operator (==). Use the following instead: if($new == $new2 && !empty($new2)){
-
You most probably have an error within your query, change this line: $data = mysql_query("SELECT *,DATE_FORMAT(Released, '%M %Y') AS date FROM music_data WHERE upper($field) LIKE '%$find%'"); To: $data = mysql_query("SELECT *,DATE_FORMAT(Released, '%M %Y') AS date FROM music_data WHERE upper($field) LIKE '%$find%'") or die(Query error: ' . mysql_error());
-
I need some help installing FFMPEG
wildteen88 replied to Garethp's topic in PHP Installation and Configuration
I have no experience of ffmpeg but I don't think ffmpeg comes as a php extension. Instead you just install the ffmpeg binaries on your computer then to use ffmpeg in your PHP scripts you use the exec family of functions as thorpe suggested. -
Apache wont be able to serve files from multiple locations at the same time. You'll need to add an alias, we'll call this alias drivec and make Apache serve files from C:\drivec_files\ when you go to http://yoursite/drivec/ To do so open your http.conf and add the follow few lines to at the end of it: Alias /drivec "C:/drivec_files" <Directory "C:/drivec_files"> Options Indexes FollowSymLinks AllowOverride None Order allow,deny Allow from all </Directory> Save your httpd.conf and restart Apache. Note: make sure the folder C:\drivec_files exists first before starting/restarting Apache However I think it'll be much better if you moved your DocumentRoot completely to C: rather than serving your site from different drives.
-
php 5.0 and MYSQL 5.0 connection problem ?
wildteen88 replied to KTTHOOL's topic in PHP Installation and Configuration
You don't rename file php_mysqli.dll to php_mysql.dll. You should already have a file called php_mysql.dll located in PHP's ext/ folder (D:\Program Files\PHP\ext). If you don't then I recommend you go to php.net and download the (PHP 5.2.5 zip package. extract the contents of zip to D:\Program Files\PHP overwriting existing files/folders. You shlould now have php_mysql.dll available in the ext/ folder. Add/uncomment the following line: extension=php_mysql.dll within the php.ini. Make sure you save your php.ini and restart Apache for the changes to take affect. -
php 5.0 and MYSQL 5.0 connection problem ?
wildteen88 replied to KTTHOOL's topic in PHP Installation and Configuration
I notice you are using the standard mysql PHP functions (mysql_*) but you have enabled the mysql improved extension. If you want to use the standard functions you'll need to enable the standard mysql extension (php_mysql.dll not php_mysqli.dll). php_mysql.dll and php_mysqli.dll both have separate function libraries. -
If you dont want to accept any html at all being posted by your forms then use the strip_tags function to strip html tags.
-
I need some help installing FFMPEG
wildteen88 replied to Garethp's topic in PHP Installation and Configuration
ffmpeg will need to be compiled in order to be used on Windows. ffmpeg doesn't come in a precompiled package. This guide should help you with compiling ffmpeg for windows. You may find unofficial ffmpeg precompiled builds for windows here. -
yes you can do if you want, xampp and wamp are basically the same. They both install the core AMP components (Apache, PHP and MySQL) along with other utilities.