wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
I just hold my breath for at least 30 - 60 seconds and the hic-ups usually go away. Rarely it takes a few tries. But dang I feel sorry for that girl that gets constant hic-ups.
-
Add curly braces around the constant eg: define("CONNECT", "odb_connect"); $con = {CONNECT}('bla', 'blah, 'bla'); Now PHP should replace {CONNECT} with the constants value.
-
If you are getting a permissions denied error then it nothing to do with the include_path but the permissions on the file you are trying to include. By permissions I mean the CHMOD permissions. These permissions are very important. 0644 should be fine.
-
PHP 4 + PHP 5 on Windows 2K3?
wildteen88 replied to jchastain's topic in PHP Installation and Configuration
You cannot run both versions at the same time. You will have to reconfigure IIS to use php4 instead of php5 by changing IIS's configuration each time and renaming/moving PHP4 and PHP5 configuration as well. Rather tedious task. -
mysql5.0 connect withphp 5.2.1?
wildteen88 replied to dhanu's topic in PHP Installation and Configuration
If your are on linux then you need to compile PHP with MySQL support. Then you enable the MySQL extension in the php.ini to be able to connect to MySQL with PHP. Read how to compile PHP for MySQL support in the manual here -
Where is your "test" website located on your computer? You probably want to setup a virtual host in the httpd.conf
-
Edit the php.ini and scroll down to the extensions section. Scroll down and find the following: ;;;;;;;;;;;;;;;;;;;;;; ; Dynamic Extensions ; ;;;;;;;;;;;;;;;;;;;;;; That is around line 603 in the php.ini You then enable the extensions by uncommenting the line with the extension you wish to enable. For example you to enable the GD extension. Simply remove the semi-colon ( in front of extension=php_gd2.dll. Then save the php.ini and restart IIS.
-
PHP 4 + PHP 5 on Windows 2K3?
wildteen88 replied to jchastain's topic in PHP Installation and Configuration
Just install PHP5. PHP is backwards compatible with PHP4. -
Class 'mysqli' not found in path\file Win XP Apache 2 PHP 5 MySQL 5
wildteen88 replied to Rottingham's topic in MySQL Help
That sticky can be used for your problem too. Not just php_mysql.dll. If your have enabled the php_mysqli.dll extension in the php.ini and PHP is reporeting the mysqly class doesnt exist, thene the mysql library isnt being loaded. Where does the libmysql.dll file currently located? If its in the php folder, then make sure you move it to C:/WINDOWS too. the MySQL libraries (standard and improved) depend upon this file in order to load up correctly. -
It might be how you are uploading the files on to the server. Set your FTP program to upload the files in Automatic Mode rather than in ASCII or Binary Mode. It shouldn't be Apache at fault here.
-
Is it showing on for both columns when you run phpinfo()? it should only show off for the middle column (local) not the right column (global). The global column is for php.ini whereas the local column is comming form the servers configuration (httpd.conf, .htaccess etc).
-
Give it a fixed width, say 130 - 140 pixels: Add this to your css: textarea { width: 140px; }
-
Rather than send the message through the url, add the message to the session. Then when the has been redirected to new the page delete the temp session variable using unset after you have used the temp session variable. So this is your new code with this addition: <?php session_start(); include ("../Connections/db.php"); $user_id = $_SESSION['user_id']; $email = $_SESSION['email_address']; // always check user submitted data exists before using it. if( (isset($_POST['new_password']) && !empty($_POST['new_password'])) && (isset($_POST['confirm_password']) && !empty($_POST['confirm_password'])) ) { $new_password = $_POST['new_password']; $confirm_password = $_POST['confirm_password']; if($new_password != $confirm_password) { $_SESSION['temp_msg'] = 'Passwords do not match.<br />'; } else { $db_password = md5($new_password); $sql = mysql_query("UPDATE members SET password='$db_password' WHERE user_id='$user_id'"); $subject = "You changed your password at Etreasures!"; $message = "Save this email as it contains the password that you selected. Not to worry your password has been encrypted to protect your privacy New Password: $new_password http://www.etreasures.ca Thanks! etreasures.ca This is an automated response, please do not reply!"; mail($email, $subject, $message, "From: eTreasures.ca <[email protected]>"); $_SESSION['temp_msg'] = "Your Password has been changed. You will receive an email with your new password!"; } } else { $_SESSION['temp_msg'] = 'Please fill in all fields.<br />'; } header("Location: ../portal/editprofile.php"); ?> Now use $_SESSION['temp_msg'] to get the message rather than $_GET['msg'] in editprofile.php
-
parse errors are PHP errors not javascript errors. You sure that is line 6. How is that javascript code implemented in to your PHP script?
-
CSS cant fade images. The menu is made of background images which has the the gradient in it.
-
Just tested your code and I got it to work by adding the following: $email_content = addslashes($email_content); before: eval("\$email_content = \"{$email_content}\";");
-
You cannot do this with mod_rewrite. However what you'll want to do is perhaps implement sessions or use POST instead.
-
Use this: header("Location: thankyoupage.html");
-
It is easier if you remove the php code tags from the content in your database and wrap your php variables in curly braces instead ({$myvar}); Then when you use the eval code I supplied earlier it will parse the variables.
-
I don't think there is such a function that exists. However it is rather simple to create. Here's what I've made: <?php function getVar($gVar) { $txtFileContents = "a=1 b=2 c=3 d=4"; // explode each variable in the file into an array on their own. $vars = explode(" ", $txtFileContents); /* produces an array like the following: array ( [0] = "a=1" [1] = "b=2" ... } */ // now we loop through each item in the $vars array. foreach($vars as $var) { // again we use explode and then we create two new variables // $name and $value. list($name, $value) = explode("=", $var); // we now create a new array which contains all // the variables in the file called $fileVars $fileVars[$name] = $value; } // now we check whether the variable that was passed to this // function exits in the $fileVars array and echo out the results if(array_key_exists($gVar, $fileVars)) { echo $fileVars[$gVar]; } else { echo $gVar . ' doesn\'t exist'; } } getVar('c'); // get variable c -- returns "3" // getVar('e'); // get variable e -- returns "e doesn't exist" ?>
-
You should check the returned rows before going into the while loop. So you should do this: if(mysql_num_rows($banlist) < 1) { echo '<td colspan="2">No IPs in the database</td>'; } else { while($blist = mysql_fetch_array($banlist)) { echo '<td>' . $blist['ips'] . '</td>'; echo '<td><a href="admincp.php?do=removeip&ip=' . $blist['ips'] . '">Remove</a></td>'; } }
-
Getting the full url/query string with php
wildteen88 replied to hellonoko's topic in PHP Coding Help
There is no set variable that holds the entire URL. However in order to get the entire URL you will need to "stitch" several seperate variables together. Here's an example: <?php $myURL = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['SCRIPT_NAME'] . '?' . $_SERVER['QUERY_STRING']; echo $myURL; ?> -
I got my eval syntax wrong in my post, it should be like this: eval("\$email_content = \"{$email_content}\";");
-
It is because that function (checkdate) is an existing function that comes with PHP. You will need to change the name of that function to something different. Also note function names are case insensitive so using checkDate instead of checkdate are the same. Prehaps use check_date as the functions name instead. The same applies to the scandir function too. You should do something like this instead: <?php if(phpversion() < "5.0.0") { function scandir($dirstr) { // php.net/scandir (PHP5) $files = array(); $fh = opendir($dirstr); while (false !== ($filename = readdir($fh))) { array_push($files, $filename); } closedir($fh); return $files; } } ?>
-
If you have PHP code stored in the database then PHP will treat the code as a string. In order for PHP to parse the PHP code coming from a database you will need to pass through the eval function. So you do this when you get the data from the database: $email_content = eval("$email_content");