wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
How to configure PHP 5 with Apache
wildteen88 replied to khurrambilal's topic in PHP Installation and Configuration
Oh sorry I mis understood you. Go to http://windows.php.net/download/ and download the zip package titled VC6 x86 Thread Safe. This will come with the three Apache modules I mentioned earlier. PHP will work fine with Apache2.0.x -
Already did - check 5 to 7 posts above this... You actually posted the handler and the confirmation page, but not the form I'm guessing this is your form The form is fine. However you are using the wrong type of quotes. You should use " to wrap attribute values in and not ”. Change all instances of ” to " and your script should function. This could be why your PHP script is failing.
-
Could you post the code to your form here.
-
You'll have to add it on its own outside of your loops. Add this echo '<a href="?letter=#">#</a> '; Before this line foreach(range('0','9') as $n){ Now you'll get a list like # 0 1 2 3 4 5 6 7 8 9
-
[SOLVED] mysql_fetch_assoc(): supplied argument ERror
wildteen88 replied to dubfoundry's topic in PHP Coding Help
This error usually means your query is failing. To find out why change this line $result = mysql_query($query); to $result = mysql_query($query) or die(mysql_error()); What is the error? -
[SOLVED] For Loop, Commas and SELECT Statement
wildteen88 replied to hoopplaya4's topic in PHP Coding Help
Use the following as the query SELECT group_concat(DISTINCT receiver.usrFirst, ' ', receiver.usrLast SEPARATOR ', ' ) ) as receiver_name, COUNT(DISTINCT receiver.usrFirst) as receiver_count //etc.... This should generate a list like John Smith, John Doe, Jane Doe Now to add the and before the last name you'd use $receiver_name = $row['receiver_name']; $receiver_name = substr_replace($receiver_name, ' and', strrpos($receiver_name, ',')+1, 0); -
This line $letter = isset($_GET['letter']) ? $_GET['letter'] :"A"; Will assign the letter A to the $letter variable by default if the variable $_GET['letter'] doesn't exist. Use the following if you don't want $letter to have a default value $letter = isset($_GET['letter']) ? $_GET['letter'] : null; This ($letter == $n) ? printf('%s ',$n) : printf('<a href="?letter=%s">#</a> ',$n,$n); Needs to be ($letter == $n) ? printf('%s ',$n) : printf('<a href="?letter=%s">%s</a> ',$n,$n); Now numbers will be displayed rather than #'s
-
Post the code you using for generating your templates.
-
How to configure PHP 5 with Apache
wildteen88 replied to khurrambilal's topic in PHP Installation and Configuration
You should get three Apache modules, which are php5apache2_2.dll - This is to be used with Apache 2.2.x php5apache2.dll - This is to be used with Apache 2.0.x php5apache.dll - This is to be used with Apache 1.3.x You need to use the correct module for the version of Apache you're using. You said in your first post you're using Apache2.0.63. This what your LoadModule line should be in the httpd.conf LoadModule php5_module "C:/WEB/PHP/php5apache2.dll" -
extension_dir doesn't change in php.ini
wildteen88 replied to WalterItinOrient's topic in PHP Installation and Configuration
When setting the extension_dir make sure there is no semi-colon ( ; ) infront of the line you're editing. -
Where is the variable $rsWorkshopRegistrants defined? This is set to the number 5 for some reason. mysql_fetch_array expects a result resource as the first argument, not a number.
-
You mean you want to call the recent_posts() function? Im guessing you should be able to do $tpl -> AssignArray(array('recent_posts' => recent_posts()));
-
How to configure PHP 5 with Apache
wildteen88 replied to khurrambilal's topic in PHP Installation and Configuration
NOTE: That tutorial suggests to add these lines to the httpd.conf LoadModule php5_module "C:/WEB/PHP/php5apache2_2.dll" AddHandler application/x-httpd-php .php PHPIniDir "C:/WEB/PHP" As you're using Apache2.0.x The LoadModule line should be LoadModule php5_module "C:/WEB/PHP/php5apache2.dll" php5apache2_2.dll is for Apache2.2.x only. php5apache2.dll is for Apache 2.0.x -
[SOLVED] Does PHP come with GD Library already installed?
wildteen88 replied to jreed2132's topic in PHP Coding Help
On Windows you need to enable the gd extension (php_gd2.dll) within the extension list in the php.ini. *nix based systems will need to be compiled with the --with-gd flag and adding php_gd2.so to the php.ini. -
[SOLVED] Help with script and installation of PHP5.3 on windows.
wildteen88 replied to heldenbrau's topic in PHP Coding Help
There is no extension called php_pdo_mysqli.dll only php_pdo_mysql.dll -
Need help phpMyadmin, PHP
wildteen88 replied to brainfreeze's topic in PHP Installation and Configuration
To run your php scripts you you need to be going to http://localhost You should not get a download dialog box appearing. If this happens Apache is not configured correctly. The line highlighted above should be (note the d after http) AddType application/x-httpd-php .php You should be restarting Apache every time you edit the httpd.conf file (or php.ini) I do not recommend doing that. If you havn't done so already add PHP to the PATH Environment Variable. Doing this eliminates the need to move files to the Windows or System folders. This also helps to prevent problems when enabling extensions. Before enabling extensions in the php.ini you should make sure Apache and PHP are working fine. Before enabling extensions you need to tell PHP where they are. Find the line that starts with extension_dir = in the php.ini This line should be set as extension_dir = "C:/Program Files/PHP/ext" Save the php.ini and restart Apache. Uncomment any extensions you have enabled already. Now create a new file called test.php in Apaches htdocs folder and add the following code <?php phpinfo(); ?> Open your browser and go to http://localhost/test.php You should get page rendered showing PHP's configuration and environment. The first check to make is to see if PHP is reading the php.ini. The line labelled Loaded Configuration File should read C:/Program Files/PHP/php.ini. If that is correct everything appears to be running fine. You can now go ahead and configure PHP as you wish (remember to restart Apache after any changes to the php.ini). -
The reason why is because you only have two possible matches in your rewrite rule. This is why I suggested you to use the following instead rewriteRule ^whatson/([0-9+])/([A-Z0-9_]+)/([A-Z0-9_]+).html$ /whatson.php?event_id=$1&cat_name=$2&event_name=$3 [NC,L] In order for you to understand whats happing in your rewriterule you need to know the basic syntax for regex (regular expressions). Each possible match is wrapped in parenthesis (). Here is a basic visual representation Example URL: RewriteRule You need to write separate rewriteRules for each type of url. So if you have the following possible urls mysite.com/whatson/123/cat_name/event_name.html mysite.com/whatson/123/cat_name.html mysite.com/whatson/123/ You'll have to have the following rules rewriteRule ^whatson/([0-9+])/([A-Z0-9_]+)/([A-Z0-9_]+).html$ /whatson.php?event_id=$1&cat_name=$2&event_name=$3 [NC,L] rewriteRule ^whatson/([0-9+])/([A-Z0-9_]+).html$ /whatson.php?event_id=$1&cat_name=$2[NC,L] rewriteRule ^whatson/([0-9+])/$ /whatson.php?event_id=$1[NC,L]
-
personally I see no need for sprintf here $rResult = mysql_query( sprintf( "SELECT * FROM comments ORDER BY created ASC", ) // line 110 ); Remove sprint $rResult = mysql_query("SELECT * FROM comments ORDER BY created ASC");
-
@barney0o0 Just to let you know your current rewriteRule will not work as you'd expect. it will only pass over the event id and category. You should this as the rewrite rule instead: rewriteRule ^whatson/([0-9+])-([A-Z0-9_]+)-([A-Z0-9_]+).html$ /whatson.php?event_id=$1&cat_name=$2&event_name=$3 [NC,L]
-
Basically yes.
-
That is down to your rewrite rule. Which is The url to the right (highlighted) is what your PHP script see's. The parts in red will be your $_GET vars. As I mention earlier
-
barney0o0 is using mod_rewrite. So not sure what you're suggesting
-
As you would normally would using the $_GET superglobal. The variables you'll need are $_GET['event_id'] $_GET['cat_name'] $_GET['event_name']
-
You change the link to your new SEO friendly url. So it'll be <a href="whatson/<?php echo $row_main['event_id']; ?>-<?php echo $row_main['cat']; ?>-<?php echo $row_main['eventname']; ?>"