
wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
Looked at your php.ini and open_basedir is set to /home/acoole/:/usr/lib/php:/usr/local/lib/php:/tmp however its a local value, which means it is not being set in the main php.ini by somewhere else such as a .htaccess/custom php.ini or httpd.conf. This is most probably set-up in your httpd.conf if you want to remove this restriction you'll need to find where this is being set to.
-
MySQL not showing up in phpinfo
wildteen88 replied to peranha's topic in PHP Installation and Configuration
Whether its a working php.ini or not something else may need to be configured in order for the mysql (php) extension (not mysql server) to function correctly. Can you post the steps you used to install Apache and PHP. Also what OS are you using on your laptop and server. -
Earlier I instructed you to added the PHPIniDir directive to the httpd.conf did you follow this step after: Save the httpd.conf and restart Apache. Rerun phpinfo() and check that the Loaded Configuration File line is set to C:\Program Files\PHP\php.ini Is the Loaded Configuration File line set correct? This line needs to be set to the php.ini path PHP is reading. Also in order to identify whether the mysql extension has loaded successfully is by looking for a separate MySQL heading when running phpinfo().
-
OOP Database connection using a custom config file
wildteen88 replied to OtaconSN's topic in PHP Coding Help
I presume settings is a variable if it is all variables should start with a dollar sign ($$settings[1]) or if the settings variable is a class variable then use $this->settings[0] instead -
I don't have any VB/ASP programming background but what does that code do? EDIT: Sorry should of done my homework first. I believe the vbCrLf allows for a newline to be outputted. If thats the case then the PHP equivalent is the PHP_EOL constant, eg: echo 'Hello ' . PHP_EOL . ' World'; /* OUTPUT: Hello World */
-
Or remove the quotes completely.
-
This will not work: if($row['attempts'] == 5 OR 4 OR 3 OR 2){ You'll have to do each comparison separately, eg: if($row['attempts'] == 5 OR $row['attempts'] == 4 etc all the way to two){ However it'll be better if you did a range: if($row['attempts'] <= 5 && $row['attempts'] >=2) { Also these two queries: $query="UPDATE admins SET attempts = 5 WHERE username='$username'"; $query="UPDATE admins SET uid='$random' WHERE username='$username'"; would be better of being as one: $query="UPDATE admins SET attempts = 5 AND uid='$random' WHERE username='$username'";
-
I need some help with logins and sessions and string functions
wildteen88 replied to elite_prodigy's topic in PHP Coding Help
Not the best, but its a starting point: $bad_words = array('apples', 'berries', 'nuts'); $str = 'I like apples and berries'; $bad_word_count = 0; foreach($bad_words as $bad_word) { if(eregi($bad_word, $str)) { $bad_word_count++; } } if($bad_word_count == 0) { echo "'$str is clean!"; } else { echo "bin '$str' not clean!"; } -
I'm a complete novice at Flash and actionscript - rarely use it. PHP is a programming language, like all programming languages it takes time to grasp.
-
Try providing the port number for the database aswell $this->vars['db_host'] = 'veraci7y.net:3306'; Also verify that the MySQL server at veraci7y.net is allowing for remote connections, which thorpe suggested earlier.
-
If you remove AND pw.property_id='1' from the query it should loop through all rows.
-
I need some help with logins and sessions and string functions
wildteen88 replied to elite_prodigy's topic in PHP Coding Help
php does provide a function tostrip html tags from a string. Surprisingly its called strip_tags. It can be configured to only allow certain html tags too. You can use str_replace to filter out offensive words, eg: // add bad words to the bad_words array. $bad_words = array('badword1', 'badword2', 'etc...'); // now to remove them $clean_text = str_replace($bad_words, 'replacement_text_here', $text_to_filter); -
Looking at the Flash manual for the sendAndLoad function Flash can receive data from the page. Change the following in the in unlink.php: if(is_dir($dir_path) && file_exists($file_path)) { unlink($file_path); } to: if(is_dir($dir_path) && file_exists($file_path)) { unlink($file_path); echo '&deleted=OK&'; } Then in your flash change this: del.onLoad = function(){ tracer = "file removed - "+this.removed; } to: del.onLoad = function() { if(this.deleted== 'OK') { tracer = "file removed'; } }
-
Why are you creating a new table to store a name? You should create just one table to store the names and insert each name as a new row
-
To provide the directory over the url, it'll need to be like this: http://yoursiter.com/unlink.php?dir=path/to/file Then in php you'd do: if(isset($_GET['dir']) && isset($_POST['delstr'])) { $dir_path = $_SERVER['DOCUMENT_ROOT'] . '/' . $_GET['dir']; $file_path = $dir_path . '/' . $_POST['delstr']; if(is_dir($dir_path) && file_exists($file_path)) { unlink($file_path); } else { 'ERROR: File (' . $file_path . ') does not exist!'; } } else { die('Invalid data!'); }
-
Duplicate post. You already opened the same topic here Thread locked.
-
Searching google this appears to be a hostname or ipaddress issue. What are you using to connect to the remote mysql server?
-
Help Please - very simple I am sure problem with array
wildteen88 replied to jipacek's topic in PHP Coding Help
If your query returns multiple rows you'll need to use a while loop to loop through all the results. Just calling mysql_fetch_array on its own will only return the first row. EDITE: Beaten to it mysql_connect('localhost', 'jipak', 'password'); mysql_select_db('contacts'); mysql_query('SELECT name FROM contacts'); $result = mysql_query('SELECT name FROM contacts'); // loop through result while($row = mysql_fetch_assoc($result)) { // add name to $names array $names[] = $row['name']; } // display $names array echo '<pre>' . print_r($names, true) . '</pre>'; -
I see you attached the php.ini Is that a fresh php.ini you have downloaded or is that the actual php.ini from your host? As currently open_basedir is not setup in that php.ini nor is safe_mode. Can you link to your phpinfo? Create a script call it info.php with the following code: <?php phpinfo(); ?> provide a link to info.php
-
Add or die(mysql_error()); at the end of the mysq_connect() function call, eg: $remote_sql_conn = mysql_connect('serverhostname/ipaddress', 'user', 'pass') or die('Connection error: ' . mysql_error()); it is better to retrieve the error from MySQL than PHP.
-
There's your problem PHP is not reading the php.ini in C:\Program Files\PHP In Apache's httpd.conf file have you set the PHPIniDir directive? If you havn't add the following to the httpd.conf: PHPIniDir "C:/Program Files/PHP" Save the httpd.conf and restart Apache. Rerun phpinfo() and check that the Loaded Configuration File line is set to C:\Program Files\PHP
-
Am I safe to reboot apache?
wildteen88 replied to fnsnoop's topic in PHP Installation and Configuration
That error is saying PHP is unable to load the sitebuilder.so or php_ioncube_loader_lin_5.0.so extensions. You can reboot Apache, however you wont be able to use any the function libraries which the above extensions offer in your PHP app. -
To use a newline in a string you need to use double quotes not single quotes: $str = "string with \n new lines in \n it"; echo '<pre>' . $str . '</pre>';
-
You do not modify any of the code in the createThumbs or createGallery functions. You need call them like so: createThumbs( "images/general/", "images/gen_th/", 100 ); //you will have to use your locations obviously createGallery("images/general/", "images/gen_th/" ); images/genral is the location of your images images/gen_th is the path in which the generated thumbnails get stored to.
-
By specifying the ipaddress/hostname for the SQL database: $remote_sql_conn = mysql_connect('serverhostname/ipaddress', 'user', 'pass'); mysql_select_db('remote_db', $remote_sql_conn);[/code]