Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




IF Statements Not Working


My IF statements are not working as I need them to work. Every varible in the sub= statement has to be filled with something. If the variables are filled with nothing, then the script does not work. The variables come into the script from a form. I have fundamental errors in how I have put the IF statements together. Code:




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Two While Statements Not Working Together?
I have two while statements in a php script. However, the second one is not outputting the way it should. When I test them individually, both work. Can anyone have a look at the code and tell me what I must edit to get both working together. PHP Code:

If Else Statements
I am having trouble with the else section of my if else code. In my database the email address of clients is stored as $yfemail.

The clients have listed the websites, email, etc for others in a search page like environment. Whend displaying the listings I am trying to create an if else statement that displays "no email given" if $yfemail == 'community1@blahblah.com' This is not a problem.

The problem lies in my else statement. I do not want to give the actual email address out to the general public, so I can't just add a simple else echo $yfemil type of code. We have a page on the site that allows users to e-mail the clients anonymously. This means in the else staement I need to send the user to another page on our site and pass the email address in the url. PHP Code:

For Statements
i have two values i wish to use in the one for(); Ill make an example below which will make it easier to understand what im trying to do.

<?php
$value1 = 100;
$value2 = 100;

for ($i=0;$i<???;$i++){
$value1 = $value1 - rand(0,10);
$value2 = $value2 - rand(0,10);
echo("Value1 is now $value1, And Value2 is now $value2");
if ($value1 < 0){ ???=1; }
if ($value2 < 0){ ???=1; }
}
The question marks () is the section that im not sure how to do... As i have two values that are 100 but $value1 or $value2 will reach 0 first and i wish it to stop once either have become 0.

Pagination + While Statements = ???
How would I do that? I've added pagination to some of my scripts before,, but I always used if statements for that.. how to do it in while statements?

Case Statements
I am fairly new to php and I was wondering if there was something similar to case statements in C++.

It would be a lot easier than writing about 20 if statements.

Joining WHILE Statements?
is it possible to join WHILE statements as just putting multiple WHILE statements one after another doesn't work.

Using Heredoc For SQL Statements
I've used heredocs for single SQL statements without a problem. Also,
I've tried this using the SQL form on PhpMyAdmin and it works so I
conclude it should work in PHP.

Problem: getting syntax error with following SQL statement:

$_sql = <<<SQLDOC
LOCK TABLES `table_name` WRITE;
INSERT INTO `table_name` ('col_a', 'col_b') VALUES ('value_a1',
'value_a2');
INSERT INTO `table_name` ('col_a', 'col_b') VALUES ('value_b1',
'value_b2');
UNLOCK TABLES;
SQLDOC;

Error Message:

"You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use
near ' INSERT INTO `table_name`..."

Parsing SQL Statements
can anyone tell me whether there is a way to get SQL statements parsed. First idea that I could get out of my head is mysql's COMMIT-ROLLBACK syntax. But I am not sure about it. Actually deleting,inserting and redeleting-reinserting seems a bit unnecessary.

Echo Statements
I'm trying to change the user password - how? First, the user enters his old password, enter the new password twice. If the old password does'nt match with that of in the table, displays an error message.If the new password entered twice is not the same, also displays an error message.

If the old password matches with that of in the table and the new password entered twice is same, then the password is updated.MY CODE ALSO WORKS ABSOLUTELY FINE!!!! But, I've problems in displaying these error messages - Like,

1.If the old password does'nt match with that of in the table,and the newpassword which is entered twice is same, it has to display an error message "Old password is wrong"
2.If the entered old password matches with that of in the table, and the new password which is entered twice does'nt matches, then it has to display an error message "New password does'nt match"

3.If everything goes well, it has to display "Password updated successfully" PHP Code:

Ereg Statements
Is this a good ereg statement?

if
(!ereg("^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]{1,})*.([a-z]{2,}){1}$",$email_1
or $email_2))
{
unset($_GET['do']);
$message_new = "<font color='#cc0000'>$email_1 or $email_2 is not a
valid email address.
Please try again.</font>";
include("login_form.php");
exit();

I am just trying to check if the e-mail fields _1 & _2 on the form contain
valid characters, without getting to complicated. The form I am using it in
keeps returning that I am not entering a valid e-mail address, such
"chris.bolton@ntlworld.com", or "chris@myweb.co.uk",or "chris@ntlworld.com"
not sure why this is the case?

Include Statements
I am currently using a perl script to process form data. I don't want
to lose the functionality I have with this script but need to output
the data to a mysql db. Someone mentioned that I should use includes
to process the form with a php script. Can one form be processed by
two scripts at the same time. If so is this a bad idea? It sounds like
it would solve my problem if it would work. The problem is that I have
done nothing more than setup a fre script that requires no coding. I
don't even know how to implement an include statement.

Multiple WHERE Statements
I'm trying to run multiple WHERE statements in a single query but it's not working out. How would I do this?

$q1=("SELECT * FROM roster WHERE (Position<='4' AND Terminated='0') ORDER BY Position");

If Statements W/MySQL DB
I have been working on for a few days now, getting an if statement to work with reading from a MySQL database.  My goal is to have my web site to entirely run off index.php.

I have taken a look at a very simple, manual-written if statement, and I am trying to incorporate it to work with MySQL.  I will comment brlow what I don't sunderstand how to do. Code:

Use OR Statements In A Url GET Method?
Just wondering if it is possible to use an OR statment within a url that is processed by the GET method?

How could you change this for example to be groupid 10 OR 1?

www.myscript.com/index.php?groupid=10&groupid=1;

Statements Per Call?
I was told the PHP MySQL library will only execute one statement per call to mysql_query. Is this true and could this be affecting a line of code like this?

// if id provided, then delete that record
if (isset($_GET['id'])) {
    // create query to delete record
    $query = "DELETE FROM purchase WHERE sale_id = ".$_GET['id'];
   
    // run the query
    mysql_query($query);

Use Of SQL UPDATE Statements In PHP Pages
I felt that this would be the most appropriate forum to post in. If this is not the case, feel free to move it)

Is it true that in the current version of mySQL, there is no support for using the UPDATE statement in a query on a webpage?

I saw this feature listed in a "to do" list in future releases, but I wasn't sure if I was misinterpreting what they were saying.

http://www.mysql.com/doc/en/TODO_future.html

Context: I'm using an Update stamement to, ... well, to update news entries I post from a form, to my site. Here's a snippet:

Nested Select Statements
I have used nested select statements in ORACLE before but it seems to be trouble some.

I want to split my results of a query into pages on a web page. Yes it is easy using LIMIT but the problem is that when you sort/order you results the LIMIT doesn't apply to the new order.

I have tried a nested select statement but it wouldn't work. MySQL respond with a syntax error message.

For example

SELECT VARIABLE1 FROM (SELECT VARIABLE1 FROM TABLE1 ORDER BY VARIABLE2) LIMIT 0, 10

Hope someone can help me.....

Nesting Elseif And If Statements?
Can someone tell me if I can nest if and elseif statements?
How deep can they be nested? Are they read from the outside in or from the inside out?

Query With Multiple OR Statements
trying to match the HTTP VARS application_id to the table products.products_application1
The code below works, but I need it to also check products_application2, products_application3, products_application4, products_application5, products_application6 for the same HTTP VARS value. PHP Code:

Getting Order From Select Statements Right
I'm pulling a bunch of times in 24 hour format from a db so values range between 6:00 and 20:00

problem is when i do the order by asc it counts 10:00 before 8:00

I also have the values translated to decimal values, so 10:45 would be 10.75, but the ordering will still put 2 digit values before the single digit, ie 10.75 will come before 9.75

is there any way to force it to go in actual numeric order...

If Statements When Submitting Form
I'm setting up a form and want to check if some conditions are met when
the form submits. If they aren't, the form displays a missing field
message and the user has to go back to fill in the missing data. If it
is met, the form continues processing. I have the $state variable coming
from a drop down SELECT option with "" being the SELECTED default.

The if statements are included inside the form tags on the form page,
not on the processing page.

<?php
if (isset($state)) { //if state is set, require the following fields
?>
<input type="hidden" name="require"
value="name,address,city,state,zipcode,phone,email,questi on">
<?php
}
if (!isset($state)) { //if state is not set, require the following fields
?>
<input type="hidden" name="require"
value="name,address,city,country,zipcode,phone,email,ques tion">
<?php
}

These both work properly. But where I'm running into trouble is when I
want to further define the if statement to contain like:

if ((!isset($state)) && ($country == "USA")) {
?>
<input type="hidden" name="require"
value="name,address,city,state,zipcode,phone,email,questi on">
<?php
}

This doesn't work. It will allow the empty $state and the value "USA" in
$country to submit. How can I prevent this?

How To Formulate If Statements Within While Statement?
How would I formulate a if statement that is within a mysql output that would check the following: If variable x is equal to or greater than 1 then output <y> code, else skip to area <z> of code:below is my idea of the logic, mostly wrong. Code:

Conditional Statements And Loops
Not long ago I was asked to give PHP lections to some private IT
school. I'm on second lection now, and will be teaching my :) students
conditional statements (if..else and switch) and loops (while and for).
That was my story, now the question.

Can you give me an advise on some geeky use of those statements to stir
up some enthusiasm in students.

Multiple Statements In Query
Is it possible to query multiple statements at once?
Like:
$query = "set @p := 1; select @p + 1";
$results = mysql_query($query);

I'm thinking of PHP4. There is in mysqli the prepare statement,
but I can't use that.

< ? Php $string ? > Within Html Statements?
I'm trying to reduce my code in html by calling a page.php file which blocks out the html for me. I was having a hell of a time since my html wouldn't parse the php code so in page.php I ended and started php and used regular html in between.

my problem is that I'm trying to use a string to lable my blocks of html (you know .... a links menu < home > < go here > < go there > with the $ string lableling each header area. Everything is parsing except for the $ string name --- so I have lots of nested tables with everything filling except the title of the block, Code:

Question On Conditional Statements
I'm a perl programmer and am trying to learn PHP.

So far I have figured out most of the differences, but have not been able to
find out how to do the following:

When running through a loop, how can you test two separate conditions
against the same $element of an array. For example, this is how I thought it
would be done (similar to Perl), but it did not work:

if (eregi("apple", $line) and (eregi("orange", $line) {

do whatever;

}

Basically testing each line of an array to see if both the words "apple" and
"orange" are present.

Also, is there any equivalent to the following from Perl while running
through a loop:

next if (whatever conditions);
last if (whatever conditions);

Shorter Select Statements?
I have always wondered if there is a way of doing a quicker select statement than the one below;

$userID = $_GET['userID'];
$result = mysql_query("SELECT name FROM users WHERE userID = $userID");
$row = mysql_fetch_row($result);
echo $row[0];

Can this query be shortened for simple queries like this one where I just want to retrieve a single field from one row?

Handling Multiple Sql Statements
I am trying to do multiple queries from two databases on two different servers.I try to always use comments, what i'm doing here is having a select option, the select option has a value based on a session, basically session_id = userid, select userid in products,, print products, that.

From there, store the product id in a variable, and call the product id, as well as the form to get me info from the other database, and then display the info. Sounds easy when I write it like this, but when I write it in code, it doesn't seem to work, it pulls me info, from the product id, but it's not taking any data in the form. I know I should not have a form submitted this way, it's bad for security reasons, but honestly I have no idea how put it in another form, and then call the info back to put it in the specific spot of the table. Can anyone tell me why it's not taking my form data, and also how I can make a query that goes something like this

 $query1 = "SELECT * FROM ei10800010001200708 WHERE NumeroExterno = '$productid'"; and (part I don't know how to search for) in between fetchadesde and fetchahasta where fetchadesde = $startdate and fetchahasta = $enddate and in between horadesde and horahasta where horadessde = $starthour and horahasta = $endhour

That is a type of query i'm trying to get for my results, and I apoligize for the Spanglish, but I work for a spanish company and don't speak good spanish, which frankly just makes life hard. Does anyone have any recommendations? My code:

Managing Multiple Sql Statements
Am already using scripts and queries that allow for various functions.
For example, some fields within database are: 'id','name','score','date'

As I mentioned, I am already running if/then/else statements, but am wondering
what is the best way to run multiple statements under one if statement?
Am just running two duplicate lines of if statements with each different criteria, but
wonder if there is a way to tighten up code. Code:

Value Isn't Processing Properly In If Statements??
I want to print $total according to which 2 values were chosen from $size and $quantity. But the $total always stays the value of each If validation section.. So if the $size = postcard4-6 then the $total is always 324.95 instead of 39.95 Code:

Fast Templates With If And While Statements
If i, for example, have a template where i want a number of entries to be while'd, outputting a long tables of names, for instance. How would anything allow me to do that when I'm using some sort of fast template/template class? The .tpl file will not be split into several parts, so how is it done?

This would also apply to if statements, if i, for example, want to show some text to a logged in user, and another text to a user that's not logged in.

IF Statements Inside Arrays
Is it possible to put an IF statement inside an array?  I want to display a member's IP adderess but only to admins/moderators and need an if statement to do it.  I have the address displayed in a template file in which i have arrays replacing words with strings.  I don't want to have any php in the template file so would the following work?

'IP_ADDRESS' => if($perm == 1){ echo "$ip_address"; },

Would that work?  If not, I know there are other ways to do it, but I'm not sure what they are.  How else could I do this?

Mysql Insert Statements Problem
i've created a site locally on my machine using php 4 and mysql3 all working fine, however having bought a new laptop i decided to upgrade to php 5 and mysql 5. i've sorted any other problems i had but bizarrely none of my mysql insert statements throughout the site work any more? they worked before? is there a syntax change to inserts or something that i'm missing?

Multiple PHP/MySQL INSERT Statements
I have a text file of data in a file (add2db.txt) where the entries are
already entered on separate lines in the following form:

INSERT INTO `reviews` VALUES("", "Tony's", "Lunch", "Great atmosphere.
Good food.", " (Harry Houdini - 03/01/2004)");

INSERT INTO `reviews` VALUES("", "Le Chow Place", "Lunch", "yada yada",
" (Herbert Hoover - 03/03/2004)");

INSERT INTO `reviews` VALUES("", "Golden Dragon", "Lunch", "Exquisite.
Good food.", " (Minnie Mouse - 01/03/2004)");

etc etc

These have been parsed from a review form that a client already
submitted. What I need to do now after I have reviewed the information
for appropriateness and grammer is to insert it into my MySQL database.
I would write single line entries like this:

// Set Mysql Variables
$host = "localhost";
$user = "root";
$pass = "";
$db = "rest";
$table = "reviews";

// Connect to Mysql, select the correct database, and run the query
which adds the data gathered from the file into the database

mysql_connect($host,$user,$pass) or die(mysql_error());
mysql_select_db($db) or die(mysql_error());
$add_review = "INSERT INTO $table
values('','$rname','$umeal','$ucomment','$uname')";
mysql_query($add_all) or die(mysql_error());

But how would I write the $add_review to read each line of the
add2db.txt and enter it as a separate entry?

Include() And Short Echo Statements
I seem to have some very strange behaviour from the include() command. Script 1 contains:
include("http://www.myurl.com/dir/script2.php"); and script 2 contains: echo "12345678";
If I do that, I get the error message:

Warning: main() [function.main]: stream does not support seeking in http://www.myurl.com/dir/script2.php on line 078l(,@¨Ê

The garbage at the end seems pretty random except the first few chars relate to the end of the echo statement. However once I get to 14+ chars in the echo statement or if I reference the include via /home/login/public_html... it works fine. Is this a known thing with PHP or is it more likely the PHP is corrupted somewhere?

If(empty) Statements/session Variables
1. I have a 2 page form. When the user fills out the info on page form he is directed to the 2nd page of the form. A session variable has been created in the 2nd form to hold all the data from the 1st page. When the 2nd page is submitted all the data (stored from page 1 and new from page 2) are sent to the database.

2. Here is the problem. On page 1, I have several form fields (like combo boxes) that need to work together. For example: I have a text field (name=phylum) in which investigators add new phylum names which are eventually sent to database field "phylum" of the same name. Next to that is a select box (name=newphylum) that has all the names that the investigors have previously entered and that are dynamically retrieved from the database field "phylum".

So when a researcher fills out page 1 of the form he/she can either add a new name or select an already existing name from the select box. But just one of these values can be sent to the database, not both.

QUESTION 1: How can I say and where would I put something that basically says the following: if the phylum text field is left EMPTY (i.e. they don´t add a new name) and they select instead from the select box, that it is the value from the select box and not the text box that gets sent to the database.

QUESTION 2: How do I pass the statement from question 1 into the session variable on page 2 of my form?

Executing A Sequence Of Mysql Statements
I need to execute a sequence of mysql statements, like
creating a new database, then creating a few tables, and
then copy some records from tables of an old database to
this new one. what's the best way to implement it with
PHP?

I think I shall write a SQL script file, and let PHP read
and execute it. Am I right here? How shall I deal with
the returns of all these SQL statements? Can I ignore them
if no error occurs?

Avoiding Endless Conditional Statements
Here is my problem. I want to make a webapp that will basically take
the work out of finding what tool works for what situation. There are
5 factors that go into tool selection. 1)Material Group, 2)Insert
Radius, 3)Insert Type and Size, and 2 others that I can't remember
off-hand. There are probably about 1000 different scenarios that I
have to code for..(there are several blank table cells and it's not
setup as you might imagine, there is a lot of overlapping), and I
desperately want to avoid making a gigantic conditional statement. I'm
afraid that I really have to provide a picture of what I'm doing here,
so I will do that. Here is the link.
You only see 3 of the 5
factors on this page, and the other 2 have to do with whether this
table or one of many other tables (not pictured) will be used.

So, now that I've confused everyone. That's my table. What's a good
way to go about programming that sucker in so that people don't have to
do all the "work" involved to figure out what tools they need. They
should just be able to choose selections from 5 dropdown boxes and get
one tool back. A tool is something like "10.655.600".

Variables Combined With String In SQL Statements
I get this error "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' , , , , , , , , , , , )' at line 1"

My sql statement is this:

mysql_query("INSERT INTO players (player_id, match_id, kills, deaths) VALUES ('$user_id', ".$_POST['match_id'].",".$_POST['kills$username'].", ".$_POST['deaths$username'].")") or die ('Error adding new player '.mysql_error());

I'm thinking it must be to do with me combining string and variables together.
So is ".$_POST['kills$username']." correct?

Template Class - Include Statements
I have managed to build a small template class that can so far parse template variables. Now, to move one step further, I have begun to put in a template include part (includes separate templates within a template file). Here's what I have so far (only the include parts are shown): Code:

Problem Binding Variables To Oracle Statements
I'm experimenting with PHP5, ORacle 9i and ADODB and have run into
problems trying to bind and output variable.

I can make a successful connection to our database via the MSDAORA
provider but the following simple statement will not work:

$oCMD = new COM("ADODB.command");
$oCMD->ActiveConnection = $dbConn; /// $dbConn generated
earlier ...
$oCMD->Prepared = True;

$oCMD->CommandText = "SELECT 12345 INTO :num FROM dual";

$oCMD->Parameters->Append($oCMD->CreateParameter("num",adInteger,adParamOutput,5));
$oCMD->Execute();
$ans = $oCMD->Parameters->Item("num")->Value;
echo "answer: [$ans] <br />";

This generates the following : answer: []

I've tried binding via the '?' spaceholder as I've been told that
can be used as well but it fails with the following:

Fatal error: Uncaught exception 'com_exception' with message
'Source: Provider
Description: Unspecified error' ....

Mysqli: Prepared Statements And Fetch_array Method?
I'm rewriting a database interface that our company currently has.
Currently it's using the Pear::DB interface, but we found that that was
introducing a bit too much overhead. I'm rewriting the interface to use
mysqli. Most of what the interface does is to simplify getting results in
the form of arrays (ordered and associative). Most of the code using the
interface used sql queries with placeholders and parameters. For that
reason I'd like to use prepared statements in mysqli, but I'm running into
a few problems.

The mysql_result object has a fetch_array method that I'd like to use, but
as far as I can tell it doesn't appear that prepared statements (the
mysqli_stmt class) even uses the mysql_result class. It appears that,
with prepared statements, you must bind variables to the mysqli_stmt
object with bind_result, which causes the statement to set those variables
when you use it's fetch() method. The mysqli_result object can only be
obtained (as far as I can see) using the mysqli_query method with an
unprepared query. (Please let me know if I'm mistaken on this.)

That's were I ran into a more significant problem. When variables are
bound to the statements results, mysqli attempts to convert them to the
appropriate php data types, and I can't find any way to prevent it from
doing so. This makes it impossible to select large integers (larger than
the php integer size) into string variables. mysqli always tries to
convert them to integers and this of course wraps. The existing code
using my interface simply has to have the ability to do this...changing
the underlying SQL to cast columns or the like isn't an option.

Interestingly, the mysqli_result fetch_array method appears to select
everything as strings, much like the old mysql interface. I would prefer
that, as I have code in my interface to do data conversions if and when I
need to. But again, I see no way of using this with prepared statements.

Unless I'm mistaken on this I may have to scrap using prepared statements
altogether and emulate prepared statements by parsing and replacing the
queries placeholders myself (much like pear does) which I'd rather avoid.

Template Issue > Remove Sql Statements From Evaled Code
I have set up a template system for my site where sections from the outputed page are stored. I am using eval to pull out the data. This, so far, has been fairly successful. However, I have a section that is evaled called "menu" that contains an if statement. (currently in db).

Due to the fact the fact that I would like users to be able to select new templates or skins, I need to be able to create a new row in my database with modified code.
This again, is not a problem in itself, except the afore mentioned "menu" section is very long and quite complex.

I was wondering how to eval the "menu" row to take into account the if /else conditions. I was thinking that I should put "menu" as an external file, then eval it,
then where "menu" used to in the database put the template code. This is an example (am at work, code at home - but hopefully this will give you an idea) : PHP Code:

I Moved My Software To A New Server And Now The Include Statements Won't Work At All
I wrote a PHP content management system and it worked fine on old
servers. I just moved it to a new server on Rackspace. I'm trying to
debug. At the top of the first file (index.php) I need to include a
file. The file won't be included. In the code below, $success remains
false. I've checked a million times and the file is there.

error_reporting(E_ALL);

$success = include("ppKernel/McControllerForAll.php");
if (!$success) $success = include("ppExtras/McControllerForAll.php");
if (!$success) $success = include("McControllerForAll.php");
if (!$success) $success = @include("../McControllerForAll.php");
if (!$success) $success = @include("../../McControllerForAll.php");
if (!$success) $success = @include("../../../McControllerForAll.php");
if (!$success) $success =
@include("../../../../McControllerForAll.php");

Dynamically Generate MySql Create Index Statements
I know in mySql you can run "show indexes from TableName" and it will show you a list of all the index's for that table. What I would like to do is run this query to generate a create index statement that I can run on another database all thru PHP. Has anyone allready built something like this in PHP to post some code?

mysql> SHOW INDEXES FROM reviews;
+---------+---------------+--------+------+------------+---------+
| Table   | Column_name   | Packed | Null | Index_type | Comment |
----------+---------------+--------+------+------------+---------+
| reviews |  id           | NULL   |      | BTREE      |         |
| reviews |  data         | NULL   | YES  | FULLTEXT   |         |
+---------+---------------+--------+------+------------+---------+
2 rows in set (0.01 sec)

Sessions Working, Then Not Working?
I wrote a login script (one that I have used on quite a few sites previously) and have found that it was working, then not working, then working again now not working - all without me changing any code. Here is the process:

1) l/p gets sent to login.php to query the db

2) if login successful, set $sid = session_id, and other session variables, register them in the session, and redirect to main.php

3) first thing on main.php is check_login function, all this does is see if $sid is set and equal to the current session_id(). If succeed continue to display data on main.php based on registered user data. If fail, redirect to error.php with the appropriate error code. this all takes place on a shared ssl server if that matters.

The trouble I'm having is the check_login function is failing because no session variables are present, including $sid. I'm 99.9 percent certain it's not a code issue because 1) I have done this same script many times before with no trouble, and 2) this particular one was working before So I am really looking for php configuration issues to check on, or things like that.

Working On CMS
I want to start customizing open source CMSs. But I could not understand how to start. Can anyone help me on this regard?

PHP Working With IIS 5
I have been trying to get PHP working with IIS 5.0 Server 2K for days now with no luck. I have searched everywhere I can think of for examples.

Need Help Getting Php Working
I have an apache 2.0.55 w/ php 4.4 on gentoo. When I browse to my url,
all
it shows is a directory listing so I don't think I have php properly
installed because it doesn't seem to be processing my php pages.

In my /etc/apache2/httpd.conf file I have a line ...

Include /etc/apache2/modules.d/*.conf

and I have an /etc/apach2/modules.d/70_mod_php.conf file which
contains ...
-----
<IfDefine PHP4>

# Load the module first
<IfModule !sapi_apache2.c>
LoadModule php4_module modules/libphp4.so
</IfModule>

# Set it to handle the files
<IfModule mod_mime.c>
AddType application/x-httpd-php .php
AddType application/x-httpd-php .phtml
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .php4
AddType application/x-httpd-php-source .phps
</IfModule>

AddDirectoryIndex index.php index.phtml
</IfDefine>


Copyright © 2005-08 www.BigResource.com, All rights reserved