wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
Displaying rows of data with an alternating colour sequence?
wildteen88 replied to Solarpitch's topic in HTML Help
This can easily be accomplished using PHP in a while loop if you are getting data from a database with PHP. However if you are using plain old HTML then you have to code in manually or you can use javascript which will seek out your table rows and alternate the colors for each row one by one. -
Your remote site is doing the same thing as what it does locally, except it doesn't show the notice message. Most probably because your host has disabled the display_errors directive or has set error_reporting directive to ignore notices. Also notices do not stop a script from running. Only error messages do. However as I did say in my last post you [b]should[/b] put apostrophes around associative indices. The only time you don't put apostrophises is when you use numerical indices.
-
Its because you are supposed to use apostrophes around associative arrays. Otherwise PHP thinks you're using a constant and thus you get a Notice message. Also it is not a configuration setting within the php.ini!
-
Hi ober. There is a mod available for 1.1RC3 which can be installed via the AdminCP called [url=http://mods.simplemachines.org/index.php?mod=63]Enhanced Quick Reply (Default Theme)[/url], download enhanced_qr_11rc3.zip Now upload the zip to the packages folder in the root of the SMF install. Then login to AdminCP and go to the Packages option and select Install option for the Enhanced Quick Reply mod. It will install it for you automatically. When its installed Quick Reply becomes the same as when you click the Reply button.
-
And did it solve any problems? or are you now getting problems with Apache? If you are then reset the httpd.conf by copying httpd.conf from the default folder (C:/Program Files/Apache Software Foundation/Apache2.2/conf/default/) to the conf folder overwriting the existing http.conf file Now restart Apache. It should load up now. However without PHP support as we got rid of that. Is Apache now loaded up?
-
Give the forms some color!!!!!!!!!
wildteen88 replied to linkoovi's topic in PHPFreaks.com Website Feedback
Nowadays most modern browsers FF and Opera, not sure about IE7 - allow you to create user defined CSS styles for websites so you can change how a sites looks to your needs by adding you own custom CSS rules. -
A bit bloated but works: [code=php:0]$file = $document_root . "/core/configuration.php"; // Check if file exists if (file_exists($file)) { // Open configuration file $handle = fopen($file, "r+"); $config_content = fread($handle, filesize($file)); fclose($handle); $handle = fopen($file, "w"); $var = 'www.google.com'; $string = preg_replace("#define\(\"WEBSITE_URI\", \"(.*?)\"\);#", "define(\"WEBSITE_URI\", \"$var\");", $config_content); $write = fputs($handle, $string); fclose($handle); } else { echo "Unable to configuration file.<br />\n"; }[/code]
-
GD under Windows Apache 2
wildteen88 replied to justcrapx's topic in PHP Installation and Configuration
If you are using Windows and you have PHP installed. Then all you need to do is uncommentt the following line in the php.ini: [b];extension=php_gd2.dll[/b] to uncomment the above line remove the semi-colon (;) at the start of the line. Save the php.ini and restart the Apache server. NOTE: Make sure the [b]extension_dir[/b] directive is set up to point to PHP extension directory, (example: C:\php\ext). Also I'm moving this to the Installation forum too. -
Yes the HEREDOC syntax is recommended for this (see post above). Note when using HEREDOC syntax do not indent or put anything else on the same line as the closing delimiter (_HTML; in the example above). Otherwise you'll get an unexpected $end error message. Also when you use variables in HEREDOC you may need to wrap curly braces around them to help PHP out a little, especially with arrays (if yoou use them). Example: [code=php:0]$var = <<<EOF This is some {$var}, when using an array you also need to use curly braces {$myarray['key_here']} EOF;[/code]
-
Probably because of PHP not able to start up. Have you tried any of my suggests yet?
-
auto_increment works, but how do you decrement?
wildteen88 replied to Solarpitch's topic in MySQL Help
This is how auto_increment works and should not be changed. -
What is you forms submit method? This is defined in the form tag via the method attribute. Also little confused about your last post. What do you mean [b]already checked this[/b]. $Valeur = $_Post["Username"]; should be $Valeur = $_POST["Username"];
-
Yeah it is our IPS that you are invoking. The IPS monitors whats being sent to and from the server. If it detects anything bad it will kill the connection to the server and thus you maybe getting a host not found error or page cannot be found message.
-
[quote author=taith link=topic=116159.msg473141#msg473141 date=1164384746] $vars = array(); is completly unnessecary as [code] $vars[] = ''; [/code] works just the same without being told to be an array... its only used as a placeholder for programmers... however, if the $vars is already a string, it will give errors... [/quote] $var = array(); and $var[] = ''; is not the same. The latter creates an array with an emtpy item. Where as $var = array(); creates just an empty array. I agree too it is good programming practice to initiate your variables first before filling them.
-
You will have to use fopen and dread functions. Then using a regular expression you can search for the following line: define("WEBSITE_URI", "www.domain.co.uk"); and redefine its value.
-
Looking at your php.ini you have not setup the [b]extension_dir[/b] directive (located on line 520) . Change: [code]extension_dir = "./"[/code] to: [code]extension_dir = "C:/PHP/ext"[/code] Also turn on the following directives too: [b]display_errors[/b] (line 356) [b]display_startup_errors[/b] (line 361) Save php.ini and restart Apache. If PHP is having trouble loading up, they should popup when Apache is starting up. Also make sure your PHP folder is added to the Windows PATH variable too. To add the PHP folder to the Windows PATH variable, make sure you're logged in as the administrator account. Now go to Start > Control Panel > System > Advanced Tab > Environment Variables button > Environment Variables Box Scroll to the Path variable. Left click the Path variable row and click the edit button. Now press the End key on your keyboard type in the following exactly: ;C:\PHP; Click Ok on the three open dialog boxes to close them. Restart Windows. if you don't restart Windows then new Path variable wont come available until you do.
-
Please read [url=http://www.phpfreaks.com/forums/index.php/topic,108327.msg435982.html#msg435982]this post[/url]. It will walk you through installing Apache server and PHP on Windows
-
Don't implode the array. Just use $mytbls[2] instead.
-
Is this a php version issue, and how to fix?
wildteen88 replied to Shamrox's topic in PHP Coding Help
You are putting your POST'd data straight into the database and you are not doing any sort of validation. So your whole site is prone to SQL injection attacks, and yes this is because of magic_quotes (being off). Do not turn magic quotes on. Leave it off. Look into using mysql_real_escape_string on your user input that you are inserting into your database. This will help to prevent SQL Injection attacks. -
[quote author=ProjectFear link=topic=116002.msg472476#msg472476 date=1164262621] i think a mod or something should make a sticky thread because this question has been asked a lot lately. [/quote] There is an FAQ thread in the [url=http://=http://www.phpfreaks.com/forums/index.php/board,41.0.html]FAQ/Code Snippet Repository]=http://www.phpfreaks.com/forums/index.php/board,41.0.html]FAQ/Code Snippet Repository[/url] forum made by me.
-
Huh! phpMyAdmin is a PHP script. All you have to do is upload the phpMyAdmin folder to your host and then you'll need to edit the config.inc.php file to your needs. Anyway if your host has cPanel then phpMyAdmin should be installed as it comes with cPanel.
-
Is this a php version issue, and how to fix?
wildteen88 replied to Shamrox's topic in PHP Coding Help
That is a another issue, Looks like you're not escaping your quotes. The single quotes are breaking your SQL query. Post the relevant code for the error here. -
Oh crap!! Yeah whitespace characters only work in double quotes.This should work for you: [code=php:0]<?php $someStr = "this has \r\nnewlines \ncha\n\n\nrac\nters in \it!"; echo nl2br($someStr); ?>[/code]
-
He is just giving an example. However not a very clear example.
-
If you want to make a variable optional you'll need to give it a default value. This is the only way to make optional parameters for functions.