php-general Digest 31 Mar 2002 17:17:13 -0000 Issue 1259

Topics (messages 90857 through 90887):

MySQL Connection Error - mysql_select_db
        90857 by: Patrick Hartnett

Case Statements - lil help please
        90858 by: Patrick Hartnett
        90864 by: Dennis Moore

php form mail - what am I doing wrong?
        90859 by: lmlweb

Re: Sql results
        90860 by: Alberto Wagner
        90861 by: Patrick Hartnett
        90862 by: Jason Wong
        90863 by: Patrick Hartnett
        90868 by: Miguel Cruz

Re: Php.ini
        90865 by: Dennis Moore
        90871 by: jtjohnston

Postgres question
        90866 by: Robert Abbate
        90882 by: Thalis A. Kalfigopoulos

Re: Why?
        90867 by: andy thomas
        90877 by: Ernesto

Changing black to blue (2)
        90869 by: Andy
        90883 by: Hugh Bothwell

HTML Question
        90870 by: jtjohnston

fetching a parameter from url like on php.net A mirarcle?
        90872 by: Andy
        90873 by: Demitrious S. Kelly
        90875 by: Rasmus Lerdorf
        90876 by: Rasmus Lerdorf
        90880 by: Andy

FREE HOSTING
        90874 by: Dani

Re: Any easy way to go from MySQL Dates to PHP dates?
        90878 by: Ernesto

PHP / cgiwrap - weird problem
        90879 by: Frank

Websites on help for building PHP database sites
        90881 by: Denis L. Menezes
        90885 by: Jason Wong

APACHE + SSL + PHP
        90884 by: Septic Flesh
        90887 by: Tyler Longren

[APACHE-PHP-WIN] : $_SESSION problems
        90886 by: John Mpaliza

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Thanks for all the help so far, great to have others out there helping.

Only way it will let me connect is to explicitly use the connection 
information in the connect statement and the select_db statements, can't 
pass in the variables.

This seems a little on the insecure side, and a pain.  Is it supposed to be 
like this, or is it just something that is wrong on my php implementation?  
It would just be nice to have the connection information in 1 file, so that 
if it is updated or changed, it can be modified in one file, instead of all 
files that need it.

Thanks for the help!

-Patrick


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.

--- End Message ---
--- Begin Message ---
Are case statements not implemented in PHP4?

If so, can someone help me debug this one, I seem to have some syntax 
incorrect, and am not sure what exactly is wrong with the statement.  I get 
a parse error on the first line, but can't find any documentation on case 
statements in PHP4, so I am kinda stuck.
thanks
-Patrick

#############


// check the error code and generate an appropriate error message switch
($e) {
        case -1:
                $message = "No such user.";
                break;

        case 0:
                $message = "Invalid username and/or password.";
                break;

        case 2:
                $message = "Unauthorized access.";
                break;

        default:
                $message = "An unspecified error occurred.";
                break;
}

_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com

--- End Message ---
--- Begin Message ---
Try the following...

// check the error code and generate an appropriate error message

switch($e) {
    case( -1):
        $message = "No such user.";
    break;

    case(0):
        $message = "Invalid username and/or password.";
    break;

    case(2):
        $message = "Unauthorized access.";
    break;

    default:
        $message = "An unspecified error occurred.";
    break;
}

----- Original Message -----
From: "Patrick Hartnett" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, March 31, 2002 12:03 AM
Subject: [PHP] Case Statements - lil help please


> Are case statements not implemented in PHP4?
>
> If so, can someone help me debug this one, I seem to have some syntax
> incorrect, and am not sure what exactly is wrong with the statement.  I
get
> a parse error on the first line, but can't find any documentation on case
> statements in PHP4, so I am kinda stuck.
> thanks
> -Patrick
>
> #############
>
>
> // check the error code and generate an appropriate error message switch
> ($e) {
> case -1:
> $message = "No such user.";
> break;
>
> case 0:
> $message = "Invalid username and/or password.";
> break;
>
> case 2:
> $message = "Unauthorized access.";
> break;
>
> default:
> $message = "An unspecified error occurred.";
> break;
> }
>
> _________________________________________________________________
> Send and receive Hotmail on your mobile device: http://mobile.msn.com
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
I'm suffering eye fatique, and after reading the code for the maybe
millionth of time, I still can't figure out what I'm doing wrong in this
one.

Ideally, you get to this registration form by clicking on a link in a
previous page, so the registration form automatically enters in the event
name. The registrant then fills in the information.

When you click on submit, you should be getting the "thank you" screen, but
instead, it's being redirected back to the previous page, the events
listings page.

I'm sure I'm missing something but I cant figure out what it is.

The email form code is from Aitsh (as indicated) and is shown here:

<?php
// Checks to see if there's an selected event ID
if (!$sel_eventID) {
 header("Location: index_test.php");
 exit;
 }

// connects to database
include("../admin/cnx_db.inc");

// set up a query where there's a match for the event_ID
$sql = "SELECT * FROM events WHERE event_ID='$sel_eventID'";

// perform query and get results
$sql_result = mysql_query($sql);
 if (!$sql_result) {
    echo "Can't execute $sql " . mysql_error();
    exit;
 }
 else {
  $row = mysql_fetch_array($sql_result);
  $id = $row["event_ID"];
  $esc_title = $row["TITLE"];
  $esc_date = $row["DATE"];
  $esc_city = $row["CITY"];
  $esc_province = $row["PROVINCE"];
  $esc_fee = $row["FEE"];

// strips out formatting slashes
  $title = stripslashes($esc_title);
    $date = stripslashes($esc_date);
  $city = stripslashes($esc_city);
  $province = stripslashes($esc_province);
  $fee = stripslashes($esc_fee);
  }

// Disconnects from database and free up resources
include("../admin/byebye.inc");

// the following is the Form Email Script.
// written by Aitsh
//
/***************************************************************************
********
*   script        :   aitsh mail
*   version       :   1.0b
*   author        :   advanced it services holland
*   email         :   [EMAIL PROTECTED]
*   date          :   10/10/1999 (original : 08/07/1999)
*   country       :   the netherlands, europe
*   copyright     :   you are free to modify this script,
                      as long as you keep this header in your script.
*   description   :   a dynamic mail-script
*   comments      :   simple to set-up and to configure/adjust it
*   installation  :   edit the vars below and your ready !!! [after
uploading :-)]
*   things to do  :   automatic reply to visitor,
                      better documentation inside the script, and more...
*   things done   :   added 'required' fields
****************************************************************************
*******/

/* if no recipient is given, mail should go this address */
$no_recipient = "specialneedslaw";

/*  if a user doesn't enter an email-address, use this address instead (if
not defined as a required field) */
$no_email = "[EMAIL PROTECTED]";

/* if a user doesn't enter a subject, use this subject instead (if not
defined as a required field)*/
$no_subject = "Events Registration submitted from website";

/* if a user doesn't enter a name, use this name instead [if not defined as
a required field] */
$no_contact_person = "No Name Brand";

/* your company name */
$company_name = "The Canadian Legal Network for Children with Special
Needs";

/* $page_title    : the title of your mail pages */
$page_title = "Registration Form for Event Registration";

/* domain name */
$domain = "lmlweb.com";

/* the filename of your script */
$scriptname = "register.php";

/* the form fields you want to be required */
$required =
array("fname","lname","address","city","province","areacode","phone");

/* say yes if your mail-agent can handle html-mail, else say no
NOTE: always a good idea to keep the default set to no to keep it
usable - not all mail browsers can handle HTML */

$html_mail = "no";

/* if the mail.php?to= has a predefined value, change the 'to: name' */
if($recipient == "info") {
$recipientname = "$company_name Info"; }
elseif($recipient == "webmaster") {
$recipientname = "$company_name Webmaster"; }
else {
$recipientname = "$company_name"; }
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd";>
<html lang="en-us"><!-- #BeginTemplate "/Templates/forms_pages.dwt" -->
<head>
<!-- #BeginEditable "doctitle" -->
<title>Register for an Event</title>
<!-- #EndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="../styles.css" type="text/css">
<script language="JavaScript"
src="http://specialneedslaw.lmlweb.com/includes/breadcrumb.js";
type="text/javascript">
</script>
</head>

<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0"
marginwidth="0" marginheight="0">
<table cellspacing="0" cellpadding="0" width="720">
  <tr>
    <td rowspan="3" width="81" height="85" align="right"><img
src="../gfx/logo.gif" width="81" height="85" alt="The Canadian Legal Network
for Children with Special Needs"></td>
    <td width="1"><img src="../gfx/spacer.gif" width="1" height="35" alt="
"></td>
    <td align="right" width="638"><a href="../index.html"><img
src="../gfx/urlgif.gif" width="134" height="22" alt="www.specialneedslaw.ca"
border="0"></a></td>
  </tr>
  <tr>
    <td colspan="2" bgcolor="#FFF2E5" align="left"><img
src="../gfx/logotype.gif" width="559" height="25" alt=" "></td>
  </tr>
  <tr>
    <td width="1">&nbsp;</td>
    <td align="right" width="638">&nbsp;</td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" width="720">
  <tr>
    <td>
       <script language="JavaScript" type="text/javascript">
   <!-- begin hide
   breadCrumbs('specialneedslaw.lmlweb.com','<img
src="http://specialneedslaw.lmlweb.com/gfx/bread_arrow.gif"; alt=">"
>','index.html','Breadcrumb','BreadcrumbTitle','None','0');
  // end hide -->
  </script><noscript class="Breadcrumb"><a
href="../index.html">Home</a></noscript>
    </td>
    <td align="right"> <span class="DateStamp">
      <?php include("http://specialneedslaw.lmlweb.com/includes/today.inc";)
?>
      </span></td>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="8" width="720" >
  <tr>
    <td width="20%" valign="top"> <!-- #BeginLibraryItem
"/Library/leftnav.lbi" --><div class="LeftNav">
        <p class="NavCategory"><a href="../index.html"
class="NavCategory">Home</a></p><p class="NavCategory"><a
href="../about_us/index.html" class="NavCategory">About
          Us</a></p><p class="LeftNavText">> <a
href="../about_us/index.html">About Us</a></p><p class="LeftNavText">> <a
href="../about_us/contact_us.html">Contact
          Us</a></p><p class="NavCategory"><a
href="../legal_resources/index.html" class="NavCategory">Legal
          Resources</a></p><p class="LeftNavText">> <a
href="../legal_resources/legal_cases/index.html">Legal
          Cases</a></p><p class="LeftNavText">> <a
href="../legal_resources/international_law/intl_law.html">International
          Law</a></p><p class="LeftNavText">> <a
href="../legal_resources/lawyer_ref.html">Need
          a Lawyer or Advocate?</a></p><p class="NavCategory"><a
href="../health_resources/index.html" class="NavCategory">Health
          Resources</a></p><p class="LeftNavText">> <a
href="../health_resources/index.html">Health
          Resources</a></p><p class="NavCategory"><a
href="../special_education/index.html" class="NavCategory">Special
          Education</a></p><p class="LeftNavText">> <a
href="../special_education/index.html">Special
          Education</a></p><p class="NavCategory"><a href="index.html"
class="NavCategory">Events</a></p><p class="LeftNavText">> <a
href="index.html">Events</a> </p><p class="NavCategory"><a
href="../other_links/index.html" class="NavCategory">
          Links</a></p><p class="LeftNavText">&gt; <a
href="../other_links/index.html">Links</a></p></div><!-- #EndLibraryItem -->
      <!--<FORM method=get
ACTION="/cgi-bin/webglimpse/home/laurie/lmlweb-www">
   <div class="BlueBox">
   <p class="BoxBoxTitle">Search This Site</p>
          <p class="BlueBoxText" align="center">
            <INPUT NAME=query size=15>
            <br>
            <input type="image" name="Submit" src="../gfx/searchbutton.gif"
width="43" height="27" border=0>
          </p>
  </div>
        </form> -->
    </td>
    <td valign="top" width="80%">
      <h1 class="ContentTitle"><!-- #BeginEditable "Content
Title" -->Registration
        Form <!-- #EndEditable --></h1>
      <img src="../gfx/orange_spacer.gif" height="1" alt="--------------"
align="left" width="100%"><br>
   <!-- #BeginEditable "Content" -->

      <?
   // first part of mail script
  if($action == "send") {

   $reset = reset($required);
   while (list($key, $value) = each($required)) {
    if($form[$value] == "") {
     $count++;
    }
   }

  if($count > 0) {
  ?>
      <form action="<?php echo $scriptname; ?>?action=send" METHOD="POST">
        <h2>
          <input type="HIDDEN" name="recipient" value="<?php echo
$recipient; ?>">
          All fields marked with an asterisk (<font
color="#FF6600">*</font>)
          must be filled in before the events details can be submitted.
Please
          make sure you've filled in all of the required fields below. </h2>
        <table cellspacing="2">
          <tr>
            <td align="LEFT">
              <p><font color="#FF6600">*</font>First Name:</p>
            </td>
            <td align="LEFT" nowrap>
              <input type="TEXT" name="form[fname]" value="<?php echo
$form[fname]; ?>" size="35">
            </td>
          </tr>
          <tr>
            <td align="LEFT">
              <p><font color="#FF6600">*</font>Last Name:</p>
            </td>
            <td align="LEFT" nowrap>
              <input type="TEXT" name="form[lname]" value="<?php echo
$form[lname]; ?>" size="35">
            </td>
          </tr>
          <tr>
            <td align="LEFT">
              <p><font color="#FF6600">*</font>Address:</p>
            </td>
            <td align="LEFT" nowrap>
              <input type="TEXT" name="form[address]" value="<?php echo
$form[address]; ?>" size="35">
            </td>
          </tr>
          <tr>
            <td align="LEFT">
              <p><font color="#FF6600">*</font>City:</p>
            </td>
            <td align="LEFT" nowrap>
              <input type="TEXT" name="form[city]" value="<?php echo
$form[city]; ?>" size="35">
            </td>
          </tr>
          <tr>
            <td align="LEFT">
              <p><font color="#FF6600">*</font>Province/State:</p>
            </td>
            <td align="LEFT" >
              <select name="form[province]"><option value="<?php echo
$form[province]; ?>" selected>
                <?php echo $form[province]; ?>
                </option>
                <option value="">- Select Province/State -</option>
                <option value="Alberta">Alberta</option>
                <option value="British Columbia">British Columbia</option>
                <option value="Manitoba">Manitoba</option>
                <option value="New Brunswick">New Brunswick</option>
                <option value="Newfoundland">Newfoundland</option>
                <option value="Northwest Territories">Northwest
Territories</option>
                <option value="Nunavut">Nunavut</option>
                <option value="Nova Scotia">Nova Scotia</option>
                <option value="Ontario">Ontario</option>
                <option value="Prince Edward Island">Prince Edward
Island</option>
                <option value="Quebec">Quebec</option>
                <option value="Saskatchewan">Saskatchewan</option>
                <option value="Yukon">Yukon</option>
                <option value="">-----</option>
                <option value="Alabama">Alabama</option>
                <option value="Alaska">Alaska</option>
                <option value="Arizona">Arizona</option>
                <option value="Arkansas">Arkansas</option>
                <option value="California">California</option>
                <option value="Colorado">Colorado</option>
                <option value="Connecticut">Connecticut</option>
                <option value="Delaware">Delaware</option>
                <option value="Florida">Florida</option>
                <option value="Georgia">Georgia</option>
                <option value="Hawaii">Hawaii</option>
                <option value="Idaho">Idaho</option>
                <option value="Illinois">Illinois</option>
                <option value="Indiana">Indiana</option>
                <option value="Iowa">Iowa</option>
                <option value="Kansas">Kansas</option>
                <option value="Kentucky">Kentucky</option>
                <option value="Louisiana">Louisiana</option>
                <option value="Maine">Maine</option>
                <option value="Maryland">Maryland</option>
                <option value="Massachusetts">Massachusetts</option>
                <option value="Michigan">Michigan</option>
                <option value="Minnesota">Minnesota</option>
                <option value="Mississippi">Mississippi</option>
                <option value="Missouri">Missouri</option>
                <option value="Montana">Montana</option>
                <option value="Nebraska">Nebraska</option>
                <option value="Nevada">Nevada</option>
                <option value="New Hampshire">New Hampshire</option>
                <option value="New Jersey">New Jersey</option>
                <option value="New Mexico">New Mexico</option>
                <option value="New York">New York</option>
                <option value="North Carolina">North Carolina</option>
                <option value="North Dakota">North Dakota</option>
                <option value="Ohio">Ohio</option>
                <option value="Oklahoma">Oklahoma</option>
                <option value="Oregon">Oregon</option>
                <option value="Pennsylvania">Pennsylvania</option>
                <option value="Puerto Rico">Puerto Rico</option>
                <option value="Rhode Island">Rhode Island</option>
                <option value="South Carolina">South Carolina</option>
                <option value="South Dakota">South Dakota</option>
                <option value="Tennessee">Tennessee</option>
                <option value="Texas">Texas</option>
                <option value="Utah">Utah</option>
                <option value="Vermont">Vermont</option>
                <option value="Virginia">Virginia</option>
                <option value="Washington">Washington</option>
                <option value="Washington DC">Washington D.C.</option>
                <option value="West Virginia">West Virginia</option>
                <option value="Wisconsin">Wisconsin</option>
                <option value="Wyoming">Wyoming</option>
                <option value="Other">Other</option>
              </select>
            </td>
          </tr>
          <tr>
            <td align="LEFT">
              <p><font color="#FF6600">*</font>Phone: </p>
            </td>
            <td align="LEFT" nowrap>
              <input type="TEXT" name="form[areacode]" value="<?php echo
$form[areacode]; ?>" size="3">
              <input type="TEXT" name="form[phone]" value="<?php echo
$form[phone]; ?>" size="8">
            </td>
          </tr>
          <tr>
            <td align="LEFT">
              <p>Email:</p>
            </td>
            <td align="LEFT" nowrap>
              <input type="TEXT" name="form[email]" value="<?php echo
$form[email]; ?>" size="35">
            </td>
          </tr>
          <tr align="CENTER">
            <td colspan="2">
              <input type="SUBMIT" value="Submit" name="SUBMIT2">
              &nbsp;
              <input type="RESET" value="Reset" name="RESET2">
            </td>
          </tr>
        </table>
        <p>&nbsp;</p>
      </form>
      <?
   }
  else {
   if(!$form[email]) {
    $form[email] = "$no_email"; }
   if(!$form[contact_person]) {
    $form[contact_person] = "$no_contact_person"; }
   if(!$form[subject]) {
    $form[subject] = "$no_subject";}
   $final_recipient = "$recipient@$domain";

  /* following is for html formatting - ignore unless you want to
  create an html-formatted email */
   if($html_mail == "yes") {
    mail("$recipientname <$final_recipient>","$form[subject]","<html><!--
nothing here, not using HTML formatted emails in this case. --></html>",
"From: $form[contact_person] <$form[email]>\nReply-To: $form[contact_person]
<$form[email]>\nContent-type: text/html\nX-Mailer: PHP/" . phpversion());
  /* end of html formatted email set up */
    }
   else {
  /* the real meat of the email form */
   mail("$recipientname <$final_recipient>","$form[subject]","$form[fname]
($form[lname]) sent the following Events Registration Form for $title to
$recipientname ($final_recipient) : \n\n Name: $form[fname] $form[lname] \n
Address: $form[address] \n $form[city] $form[province] \n Phone:
$form[areacode] $form[phone] \n\n","From: $form[fname] $form[lname]
<$form[email]>\nReply-To: $form[contact_person]
<$form[email]>\nContent-type: text/plain\nX-Mailer: PHP/" . phpversion());
    }
  ?>
      <div align="center">
        <h2>Thank you</h2>
        <p>Your events registration will be send immediately to </p>
        <p><b>Canadian Legal Network for Children with Special
Needs.</b></p>
        <p>You will receive a confirmation email as soon as possible.</p>
      </div>
      <?
   }
  }
 else {
  if($to == "") {
   $recipient = "$no_recipient";
   }
  else {
   $recipient = $to; } ?>
      <p class="topmargin">To register for this event, <b><?php echo $title
?></b>,
        please fill out the form below.</p>
      <p class="topmargin">Alternatively, you can contact us by e-mail or
telephone
        us at (add number)</p>
      <p><b><?php echo $title ?></b></p>
      <form action="<?php echo $scriptname; ?>?action=send" METHOD="POST">
        <input type="HIDDEN" name="recipient" value="<?php echo $recipient;
?>">
        <table cellspacing="2">
          <tr>
            <td align="LEFT">
              <p><font color="#FF6600">*</font>First Name:</p>
            </td>
            <td align="LEFT" nowrap>
              <input type="TEXT" name="form[fname]" size="35">
            </td>
          </tr>
          <tr>
            <td align="LEFT">
              <p><font color="#FF6600">*</font>Last Name:</p>
            </td>
            <td align="LEFT" nowrap>
              <input type="TEXT" name="form[lname]" size="35">
            </td>
          </tr>
          <tr>
            <td align="LEFT">
              <p><font color="#FF6600">*</font>Address:</p>
            </td>
            <td align="LEFT" nowrap>
              <input type="TEXT" name="form[address]" size="35">
            </td>
          </tr>
          <tr>
            <td align="LEFT">
              <p><font color="#FF6600">*</font>City:</p>
            </td>
            <td align="LEFT" nowrap>
              <input type="TEXT" name="form[city]" size="35">
            </td>
          </tr>
          <tr>
            <td align="LEFT">
              <p><font color="#FF6600">*</font>Province/State:</p>
            </td>
            <td align="LEFT" >
              <select name="form[province]">
                <option value="" selected>- Select Province/State -</option>
                <option value="Alberta">Alberta</option>
                <option value="British Columbia">British Columbia</option>
                <option value="Manitoba">Manitoba</option>
                <option value="New Brunswick">New Brunswick</option>
                <option value="Newfoundland">Newfoundland</option>
                <option value="Northwest Territories">Northwest
Territories</option>
                <option value="Nunavut">Nunavut</option>
                <option value="Nova Scotia">Nova Scotia</option>
                <option value="Ontario">Ontario</option>
                <option value="Prince Edward Island">Prince Edward
Island</option>
                <option value="Quebec">Quebec</option>
                <option value="Saskatchewan">Saskatchewan</option>
                <option value="Yukon">Yukon</option>
                <option value="">-----</option>
                <option value="Alabama">Alabama</option>
                <option value="Alaska">Alaska</option>
                <option value="Arizona">Arizona</option>
                <option value="Arkansas">Arkansas</option>
                <option value="California">California</option>
                <option value="Colorado">Colorado</option>
                <option value="Connecticut">Connecticut</option>
                <option value="Delaware">Delaware</option>
                <option value="Florida">Florida</option>
                <option value="Georgia">Georgia</option>
                <option value="Hawaii">Hawaii</option>
                <option value="Idaho">Idaho</option>
                <option value="Illinois">Illinois</option>
                <option value="Indiana">Indiana</option>
                <option value="Iowa">Iowa</option>
                <option value="Kansas">Kansas</option>
                <option value="Kentucky">Kentucky</option>
                <option value="Louisiana">Louisiana</option>
                <option value="Maine">Maine</option>
                <option value="Maryland">Maryland</option>
                <option value="Massachusetts">Massachusetts</option>
                <option value="Michigan">Michigan</option>
                <option value="Minnesota">Minnesota</option>
                <option value="Mississippi">Mississippi</option>
                <option value="Missouri">Missouri</option>
                <option value="Montana">Montana</option>
                <option value="Nebraska">Nebraska</option>
                <option value="Nevada">Nevada</option>
                <option value="New Hampshire">New Hampshire</option>
                <option value="New Jersey">New Jersey</option>
                <option value="New Mexico">New Mexico</option>
                <option value="New York">New York</option>
                <option value="North Carolina">North Carolina</option>
                <option value="North Dakota">North Dakota</option>
                <option value="Ohio">Ohio</option>
                <option value="Oklahoma">Oklahoma</option>
                <option value="Oregon">Oregon</option>
                <option value="Pennsylvania">Pennsylvania</option>
                <option value="Puerto Rico">Puerto Rico</option>
                <option value="Rhode Island">Rhode Island</option>
                <option value="South Carolina">South Carolina</option>
                <option value="South Dakota">South Dakota</option>
                <option value="Tennessee">Tennessee</option>
                <option value="Texas">Texas</option>
                <option value="Utah">Utah</option>
                <option value="Vermont">Vermont</option>
                <option value="Virginia">Virginia</option>
                <option value="Washington">Washington</option>
                <option value="Washington DC">Washington D.C.</option>
                <option value="West Virginia">West Virginia</option>
                <option value="Wisconsin">Wisconsin</option>
                <option value="Wyoming">Wyoming</option>
                <option value="Other">Other</option>
              </select>
            </td>
          </tr>
          <tr>
            <td align="LEFT">
              <p><font color="#FF6600">*</font>Phone: </p>
            </td>
            <td align="LEFT" nowrap>
              <input type="TEXT" name="form[areacode]" size="3">
              <input type="TEXT" name="form[phone]" size="8">
            </td>
          </tr>
          <tr>
            <td align="LEFT">
              <p>Email:</p>
            </td>
            <td align="LEFT" nowrap>
              <input type="TEXT" name="form[email]" size="35">
            </td>
          </tr>
          <tr align="CENTER">
            <td colspan="2">
              <input type="SUBMIT" value="Submit">
              &nbsp;
              <input type="RESET" value="Reset">
            </td>
          </tr>
        </table>
      </form>
  <?
   }
  ?>
      <!-- #EndEditable --></td>
  </tr>
  <tr align="center">
    <td colspan="2">
      <p class="Content"><a href="../about/index.html">About Us</a> | <a
href="../legal_notes.html">Legal
        Notes</a> | <a href="../about/contact_us.html">Contact Us</a> | <a
href="../webmaster.html">Problems?</a></p>
    </td>
  </tr>
</table>
</body>
<!-- #EndTemplate --></html>


--- End Message ---
--- Begin Message ---
But I Want a way to do something if there isn't any result



31/03/2002 01:52:10, Jason Wong <[EMAIL PROTECTED]> wrote:

>On Sunday 31 March 2002 07:29, Alberto Wagner wrote:
>> $Sql_Query_Login Returns an empty mysql array like:
>>
>> $Sql_Query_Login = Mysql_Query("SELECT Nome FROM users WHERE User =
>> 'Anyone'")
>>
>> There isn't a user if name Anyone...
>>
>> Why
>>
>> If (!$Sql_Query_Login) {
>>    Echo "Ninguem";
>> }
>>
>> Is returning False?
>
>mysql_query() returns a resource id, which is a *pointer* to the results and 
>not the actual results themselves.
>
>To get at the actual results you need to follow up with one of:
>
>mysql_fetch_array()
>mysql_fetch_row()
>mysql_fetch_assoc()
>
>See manual for details and examples.
>
>Also you should put some error-checking in your code as per the examples in 
>the manual.
>
>
>-- 
>Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
>
>/*
>Bennett's Laws of Horticulture:
>       (1) Houses are for people to live in.
>       (2) Gardens are for plants to live in.
>       (3) There is no such thing as a houseplant.
>*/
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>




--- End Message ---
--- Begin Message ---
try this, it sees if there is a result, and you can then proceed to do what 
you need to do.

        if (mysql_num_rows($result) == 1) //match found
        {
                //do something here;
        }
        // no match found
        else
        {
                //do something here;
        }


>From: Alberto Wagner <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Re: [PHP] Sql results
>Date: Sat, 30 Mar 2002 21:44:29 -0300
>
>But I Want a way to do something if there isn't any result
>
>
>
>31/03/2002 01:52:10, Jason Wong <[EMAIL PROTECTED]> wrote:
>
> >On Sunday 31 March 2002 07:29, Alberto Wagner wrote:
> >> $Sql_Query_Login Returns an empty mysql array like:
> >>
> >> $Sql_Query_Login = Mysql_Query("SELECT Nome FROM users WHERE User =
> >> 'Anyone'")
> >>
> >> There isn't a user if name Anyone...
> >>
> >> Why
> >>
> >> If (!$Sql_Query_Login) {
> >>    Echo "Ninguem";
> >> }
> >>
> >> Is returning False?
> >
> >mysql_query() returns a resource id, which is a *pointer* to the results 
>and
> >not the actual results themselves.
> >
> >To get at the actual results you need to follow up with one of:
> >
> >mysql_fetch_array()
> >mysql_fetch_row()
> >mysql_fetch_assoc()
> >
> >See manual for details and examples.
> >
> >Also you should put some error-checking in your code as per the examples 
>in
> >the manual.
> >
> >
> >--
> >Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> >
> >/*
> >Bennett's Laws of Horticulture:
> >     (1) Houses are for people to live in.
> >     (2) Gardens are for plants to live in.
> >     (3) There is no such thing as a houseplant.
> >*/
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
>
>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>


_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx

--- End Message ---
--- Begin Message ---
On Sunday 31 March 2002 08:44, Alberto Wagner wrote:
> But I Want a way to do something if there isn't any result

mysql_num_rows() ?


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
The road to Hades is easy to travel.
                -- Bion
*/
--- End Message ---
--- Begin Message ---
use it after your query to see if there is a result set.  Like follows:

$result = mysql_query($query) or die ("Error in query: " . mysql_error());

        // if row exists -> user/pass combination is correct
        if (mysql_num_rows($result) == 1)
        {
                return 1;
        }
        // user/pass combination is wrong
        else
        {
                return 0;
        }


>From: Jason Wong <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: [EMAIL PROTECTED]
>Subject: Re: [PHP] Sql results
>Date: Sun, 31 Mar 2002 13:17:29 +0800
>
>On Sunday 31 March 2002 08:44, Alberto Wagner wrote:
> > But I Want a way to do something if there isn't any result
>
>mysql_num_rows() ?
>
>
>--
>Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
>
>/*
>The road to Hades is easy to travel.
>               -- Bion
>*/
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>


_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx

--- End Message ---
--- Begin Message ---
On Sat, 30 Mar 2002, Alberto Wagner wrote:
> But I Want a way to do something if there isn't any result
> 
> 31/03/2002 01:52:10, Jason Wong <[EMAIL PROTECTED]> wrote:
> 
> >On Sunday 31 March 2002 07:29, Alberto Wagner wrote:
> >> $Sql_Query_Login Returns an empty mysql array like:
> >>
> >> $Sql_Query_Login = Mysql_Query("SELECT Nome FROM users WHERE User =
> >> 'Anyone'")

  if (!mysql_num_rows($Sql_Query_Login))
  {
     print 'ninguem';
  }

miguel

--- End Message ---
--- Begin Message ---
I do not know about a separate php.ini file but you can assign specific
values in your <VIRTUAL HOST> settings or you can set them using your
.htaccess file pending on how you have set up your server.  Assuming you are
running Apache on a UNIX type machine....

ie
php_value upload_max_filesize 5000000

go to chapter 3 of the documentation for more details...


----- Original Message -----
From: "Chris Kay" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, March 30, 2002 5:45 PM
Subject: [PHP] Php.ini


>
> Question I have is,
>
> Is it possible to specify a php.ini in each virtual host?
> That way allowing each website to run a different configuration.
>
> Cause I have a website that I want to use
> Session_set_save_handler = user but I want another website to use the
> default php
> Files handle.
>
> Also for things like session auto start ect....
>
> Just a thought that it would make it easier.
>
> Thanks in advance.
>
> -------
> Chris Kay, Eleet Internet Services
> [EMAIL PROTECTED]
> -------
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
Once upon a time on another (Windows) server I could place a php.ini in a
directory and it would choose that one first before it defaulted to
c:\windows\php.ini. It doesn't work on my Apache server today, but who
knows?

Chris Kay wrote:

> Question I have is,
>
> Is it possible to specify a php.ini in each virtual host?
> That way allowing each website to run a different configuration.
>
> Cause I have a website that I want to use
> Session_set_save_handler = user but I want another website to use the
> default php
> Files handle.
>
> Also for things like session auto start ect....
>
> Just a thought that it would make it easier.
>
> Thanks in advance.
>
> -------
> Chris Kay, Eleet Internet Services
> [EMAIL PROTECTED]
> -------

--
John Taylor-Johnston
-----------------------------------------------------------------------------

  ' ' '   Collège de Sherbrooke:
 ô¿ô   http://www.collegesherbrooke.qc.ca/languesmodernes/
   -     Université de Sherbrooke:
          http://compcanlit.ca/
          819-569-2064


--- End Message ---
--- Begin Message ---
Greetings to all!

I have a webhosting company, and I'm trying to be able to use PHP to
calculate each of my hosting customer's Postgres database disk usage. It
doesn't seem as easy as MySQL (since MySQL uses the user name to store all
their database files).

Does anyone know how I can calculate PostgreSQL disk space usage for each of
my hosting user accounts?

It seems I'm going to have to find out how Postgres keeps track of which
user's database name is and it's corresponding number (so far, I've been
able to determin that Postges uses numbers instead of names).

Can anyone give me some insight?

Thanks!
Robert


--- End Message ---
--- Begin Message ---
There is a utiliti under contrib/ called oid2name which returns the name of the object 
given its oid. This will probably help you locate which directories correspond to 
which database.

cheers,
--thalis


On Sat, 30 Mar 2002, Robert Abbate wrote:

> Greetings to all!
> 
> I have a webhosting company, and I'm trying to be able to use PHP to
> calculate each of my hosting customer's Postgres database disk usage. It
> doesn't seem as easy as MySQL (since MySQL uses the user name to store all
> their database files).
> 
> Does anyone know how I can calculate PostgreSQL disk space usage for each of
> my hosting user accounts?
> 
> It seems I'm going to have to find out how Postgres keeps track of which
> user's database name is and it's corresponding number (so far, I've been
> able to determin that Postges uses numbers instead of names).
> 
> Can anyone give me some insight?
> 
> Thanks!
> Robert
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--- End Message ---
--- Begin Message ---


On Sat, 30 Mar 2002, Michael Kimsal wrote:

> Alberto Wagner wrote:
> > Why everyone uses $foo or $foobar as examples?
> >
> >
> >
>
> Why not?  They are relatively benign words that are simply to
> type and aren't terribly language centric.
>
> $moo and $moocow would work just as well, or $asdf or $qwerty
> or others.
>
> As far as I know, they have no specific connotation,
> but they've been used as placement holder names since
> at least the early 80's when I started programming.

Yes, the manual for Microsoft's M80 8080 macro assembler was the first
time I came across foo and bar. This was dated 1979.

Andy

--- End Message ---
--- Begin Message ---
Alberto Wagner wrote:
> Why everyone uses $foo or $foobar as examples?
>
>
>

foo
/foo/ 1. interj. Term of disgust. 2 [very common] Used very generally as a
sample name for absolutely everything, esp. programs and files (esp. scratch
files). 3. First on the list of metasyntactic variables used in syntax
examples. See also bar, baz, gux, guux, corge, grault, garply, waldo, fred,
plugh, xyzzy, thud.
When 'foo' is used in connection with 'bar' it has generally traced to the
WWII-era Army slang acronym FUBAR ('Fucked Up Beyond All Repair'), later
modified to foobar. Early versions of the Jargon File interpreted this
change as post-war bowdlerization, but it now seems more likely that FUBAR
was itself a derivative of 'foo' perhaps influenced by German 'furchtbar'
(terrible) - 'foobar' may actually have been the original form.
For, it seems, the world 'foo' itself had an immediate prewar history in
comic strips and cartoons. The earlies documented uses were in the "Smokey
Stover" comic strip popular in the 1930s, which frequently included the word
'foo'. Bill Holman, the author of the strip, filled it with off jokes and
personal contrivances, including other nonsense phrases such as "Notary
Sojac" and "1506 nix nix". According to the Warner Brothers Cartoon
Companion Holman claimed to have found the word 'foo' on the bottom of a
chinese figurine. This is plausible; chinese statuettes often have
apotropaic inscriptions, and this may have been the chinese word 'fu'
(sometimes transliterated 'foo'), which can mean "happiness" when spoken
with the proper tone (the lion-dog guardians flanking the steps of many
chinese restaurants are properly called 'fu dogs'). English speakers'
reception of Holman's 'foo' nonsense word was undoubtely influenced by
Yiddish 'feh' and english 'fooey' and 'fool'.
... (etc.)

(From Babylon Translator).

"Michael Kimsal" <[EMAIL PROTECTED]> escribió en el mensaje
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Alberto Wagner wrote:
> > Why everyone uses $foo or $foobar as examples?
> >
> >
> >
>
> Why not?  They are relatively benign words that are simply to
> type and aren't terribly language centric.
>
> $moo and $moocow would work just as well, or $asdf or $qwerty
> or others.
>
> As far as I know, they have no specific connotation,
> but they've been used as placement holder names since
> at least the early 80's when I started programming.
>
>
>
> Michael Kimsal
> http://www.phphelpdesk.com
> PHP support when you need it
> 734-480-9961
>


--- End Message ---
--- Begin Message ---
Hi there,

I know I already posted this prob 2 days ago, but I am still stuck. What I
tryed
is to use imagefill what BvR suggested, but the problem is, that I would
need to know where the black part is to set the start pixel color. This is
not
possible. Also Hugh was asking why I do not do this in Photos. Thats because
I have 250 images and don't want to save the same image twice. There must
be a way to do this in php.

The sittuation is as follows:
I have a map of the world with all countries. I have 250 maps of the same
size
as png where only one country is black, rest is transp.
Now I neeed to set this country color to blue or red to indicate a special
spot.
I just don't want to save the same map double or tripple.

How could I color the black spot inside the transparent png?

Thanx a lot for any hint.

Andy

PS: The old message is underneath

I would like to change the color on a png file from black to blue. This png
file is
transparent and contains only a spot which is black. It is needed to stay
transparent
because I am gonna merge it later on with a jpeg.

I tryed imagecolorset but anyhow I do not understand the syntax.

Here is my try:

  # set home color
  $farbe_b = imagecolorallocate($country_image,0,0,0);  // create index for
the black color
  imagecolorset($country_image,$farbe_b,51,51,204); // darker blue

Can anybody help on this.


Thanx in advance,

Andy



--- End Message ---
--- Begin Message ---
> I have a map of the world with all countries. I have
> 250 maps of the same size as png where only one
> country is black, rest is transp.
> Now I neeed to set this country color to blue or red
> to indicate a special spot.
> I just don't want to save the same map double or tripple.

Good!  Makes much more sense.

Call this like
<img src='country.php?cty=germany&col=255,0,0'>
(functions in bold you will have to write yourself)
====== country.php ===========
<?php
    Header("Content-type: image/png");
    $mapURL = '\images\countrymask\'.MAKESAFE($cty);

    // load image
    $img = ImageCreateFromPNG($mapURL.$mapname)
        or MAKEDEFAULTIMAGE();

    // parse new desired color
    $newcolor = split(',', $col);

    // find black
    $oldcolor = ImageColorResolve($img, 0, 0, 0);

    // change to new color
    ImageColorSet($img, $oldcolor, $newcolor[0], $newcolor[1],
$newcolor[2]);

    // ... and return result
    ImagePNG($img);
?>

Note that depending on how much this gets used,
it may indeed be better (faster, less computationally
intensive) in the long run to use multiple image
copies, ie country_red.png, country_blu.png etc.


--- End Message ---
--- Begin Message ---
I suppse this is an HTML question more than PHP.
I have a server elsewhere that does not have PHP accessible. Stupid &
cheap of them, but true.
I want to display a page within a page, WITHOUT using <?php ... ?> which
won't work.

I tried stuff like:

<IFRAME SRC="http://www.somewhere.ca/test.php"; frameborder="no"
border="0" MARGINWIDTH="0" MARGINHEIGHT="0" SCROLLING="no">
</IFRAME>

Does not work of course.

Can I even do this?

--- End Message ---
--- Begin Message ---
Hi there,

I am wondering how to get a parameter from url like on php.net Example:
php.net/functionname

I guess this is a server config isn't it? The server would otherwise asume
this is a file and return a 404 error.
How could I tell the server to run index.php if the file name is not on the
server. And then .. how to get a 404 if
this is not a function, but really a not existant page?

Maybe someone of the php.net team could uncouver the miracle :-)

Thanx Andy


--- End Message ---
--- Begin Message ---
I believe this is done with mod_rewrite

-----Original Message-----
From: Andy [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, March 31, 2002 12:54 AM
To: [EMAIL PROTECTED]
Subject: [PHP] fetching a parameter from url like on php.net A mirarcle?

Hi there,

I am wondering how to get a parameter from url like on php.net Example:
php.net/functionname

I guess this is a server config isn't it? The server would otherwise
asume
this is a file and return a 404 error.
How could I tell the server to run index.php if the file name is not on
the
server. And then .. how to get a 404 if
this is not a function, but really a not existant page?

Maybe someone of the php.net team could uncouver the miracle :-)

Thanx Andy



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--- End Message ---
--- Begin Message ---
ErrorDocument 404 your_script.php

then in your_script.php look at $REQUEST_URI

Or stick a phpinfo() call there initially to see what is set.

-Rasmus

On Sun, 31 Mar 2002, Andy wrote:

> Hi there,
>
> I am wondering how to get a parameter from url like on php.net Example:
> php.net/functionname
>
> I guess this is a server config isn't it? The server would otherwise asume
> this is a file and return a 404 error.
> How could I tell the server to run index.php if the file name is not on the
> server. And then .. how to get a 404 if
> this is not a function, but really a not existant page?
>
> Maybe someone of the php.net team could uncouver the miracle :-)
>
> Thanx Andy
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
> I believe this is done with mod_rewrite

Nope.  Absolutely no reason to incur the wrath of mod_rewrite for
something this simple.  Just an ErrorDocument entry in your httpd.conf.

-Rasmus

--- End Message ---
--- Begin Message ---
thanx


"Rasmus Lerdorf" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> ErrorDocument 404 your_script.php
>
> then in your_script.php look at $REQUEST_URI
>
> Or stick a phpinfo() call there initially to see what is set.
>
> -Rasmus
>
> On Sun, 31 Mar 2002, Andy wrote:
>
> > Hi there,
> >
> > I am wondering how to get a parameter from url like on php.net Example:
> > php.net/functionname
> >
> > I guess this is a server config isn't it? The server would otherwise
asume
> > this is a file and return a 404 error.
> > How could I tell the server to run index.php if the file name is not on
the
> > server. And then .. how to get a 404 if
> > this is not a function, but really a not existant page?
> >
> > Maybe someone of the php.net team could uncouver the miracle :-)
> >
> > Thanx Andy
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>


--- End Message ---
--- Begin Message ---
Hi,

I'm just wondering if anybody know if there is a free web hosting with
MYSQL and PHP. I don't need a hugh space. mya be I need only 50Meg (for
practise my PHP)

thanks!

regards,
Dani

--- End Message ---
--- Begin Message ---

Use strtotime().

$result = mysql_query("SELECT datefield FROM mytable");
$row = mysql_fetch_array($result);
$datevar=strtotime($row['datefield']);
echo date('m-d-Y', $datevar);

Regards,

"David Johansen" <[EMAIL PROTECTED]> wrote:
> I was just wondering if there's any way to work with dates returned from a
> MySQL query in PHP. Right now I do all of different stuff in my MySQL
query
> but it's really cumbersome, so I would like to be able to do it all with
> PHP. Is there any way to do that? Thanks,
> Dave
>
> Here's my MySQL query:
>
> $result = mysql_query("SELECT *, WEEKDAY(time0_name) AS day,
> DATE_FORMAT(time0_name,'%m/%d/%y') AS print_date, DATE_FORMAT(time0_name,
> '%l:%i %p') AS begin_time0, DATE_FORMAT(DATE_ADD(time0_name, INTERVAL 2
> HOUR), '%l:%i %p') AS end_time0, DATE_FORMAT(time1_name, '%l:%i %p') AS
> begin_time1, DATE_FORMAT(DATE_ADD(time1_name, INTERVAL 2 HOUR), '%l:%i
%p')
> AS end_time1, DATE_FORMAT(time2_name, '%l:%i %p') AS begin_time2,
> DATE_FORMAT(DATE_ADD(time2_name, INTERVAL 2 HOUR), '%l:%i %p') AS
end_time2,
> DATE_FORMAT(time3_name, '%l:%i %p') AS begin_time3,
> DATE_FORMAT(DATE_ADD(time3_name, INTERVAL 2 HOUR), '%l:%i %p') AS
end_time3,
> DATE_FORMAT(time4_name, '%l:%i %p') AS begin_time4,
> DATE_FORMAT(DATE_ADD(time4_name, INTERVAL 2 HOUR), '%l:%i %p') AS
end_time4,
> DATE_FORMAT(time5_name, '%l:%i %p') AS begin_time5,
> DATE_FORMAT(DATE_ADD(time5_name, INTERVAL 2 HOUR), '%l:%i %p') AS
end_time5
> FROM pickup_times",$dbh);
>
> I could do it a lot easier if in PHP I think, so I was just wondering if
> anyone could point me to a thing that talked about converting MySQL
DATETIME
> to PHP date stuff.
>
>


--- End Message ---
--- Begin Message ---

Dear List,

I have been using cgiwrap for many years, always with the .php extension 
added like an AddType like this.

httpd.conf:
     Action application/php-script       /cgi-bin/php.cgi
     AddHandler application/php-script  .php4 .php3 .php

Works perfectly.

But in this case I don't want to serve the .php-extension in general. I 
have also moved the executable binary php out of the web tree, compiled it 
with "--enable-discard-path" and added #!/usr/local/bin/php in the scripts.

So instead of above, httpd.conf has

  ScriptAlias /cgi-bin/ "/usr/home/httpd/bin/"

and scripts can be invoked in the browser like:

http://www.myname.com/myscript1.cgi

E.g. "myscript1.cgi" could be

#/usr/local/bin/php
<?php  phpinfo() ?>

This works fine.

And cgiwrap works fine. I can call other scripts as intended - e.g. I can 
call this script

#!/bin/sh
echo "Content-type: text/html\n\n"
ls /

or Perl

#!/usr/bin/perl
print("Content-type: text/html\n\n");
print("Hello, World!");

as http://www.myname.com/cgi-bin/cgiwrapd/frank/myscript2.cgi

So everything as expected.

But with PHP something very strange happen: The above script 
"myscript1.php" seems to output the cgi-wrap's code when I load it in the 
browser as

http://www.myname.com/cgi-bin/cgiwrapd/frank/myscript1.cgi

and not info about PHP.

Why is that?  Since scripts with #!/bin/sh worked I have even tried to call 
php from such a script and output the result to a file:

#/bin/sh
/usr/local/bin/php /somepath/testphp.php > /somepath/testphp.htm
ls /

Same result.  testphp.htm contains nice phpinfo when the script is called 
from the command line - and lots of binary code when the script called by 
cgiwrap. But the result of "ls /" reaches the browser correctly!

What is special about PHP in combination with cgiwrap here? What can 
cgiwrap "do" to php to make it output unintended code where sh and Perl 
behaves normally? Is something missing in the environment when called from 
cgiwrap? If so what?

I am completely clueless, despite spending 10 hours on the problem.

Oh. and one more thing: When PHP is compiled wrongly for this purpose - 
like with "--enable-force-cgi-redirect" - then there's suddenly nothing 
strange - the script correctly outputs an error-message from PHP, also when 
called over cgiwrap!

If anyone can point me in the right direction or suggest some good things 
to try I'd me more than grateful - I'd be impressed! :-)

Best regards

Frank

--- End Message ---
--- Begin Message ---
Hello friends,

can anyone give me the links to websites who have instructions on developing
interactive webiste using MySQL and PHP?

I have 2 books, but I need to know some things which are not in these books.

Thanks
denis

--- End Message ---
--- Begin Message ---
On Sunday 31 March 2002 22:41, Denis L. Menezes wrote:
> Hello friends,
>
> can anyone give me the links to websites who have instructions on
> developing interactive webiste using MySQL and PHP?
>
> I have 2 books, but I need to know some things which are not in these
> books.

Have you tried google?


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
"Everything should be made as simple as possible, but not simpler."
-- Albert Einstein
*/
--- End Message ---
--- Begin Message ---
I download apache 1.3.24 + php 4.1.2 + mod_ssl-2.8.8-1.3.24

$ compile all

$install all (not php yet)

apache runs ok with or without ssl

then compile php and install it..

I get an error cannot load shared library libphp4.so....

y ? I compile apache -enablemodule-ssl/so
what I miss out and I get that

cannot load shared library libphp4.so..

file exists . . in the directory that apache reads it but . . .what is wrong
?


Thanks..



--
~~~~~~~~~~~~~~~~

Sapilas@/dev/pinkeye

~~~~~~~~~~~~~~~~


--- End Message ---
--- Begin Message ---
This isn't a correct apache configure flag:
-enablemodule-ssl/so

I suggest you use this howto:
http://www.devshed.com/Server_Side/PHP/SoothinglySeamless/page1.html

It gives you step by step examples on how to do exactly what you want to.

Tyler Longren
Captain Jack Communications
[EMAIL PROTECTED]
www.captainjack.com

----- Original Message -----
From: "Septic Flesh" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, March 31, 2002 10:22 AM
Subject: [PHP] APACHE + SSL + PHP


> I download apache 1.3.24 + php 4.1.2 + mod_ssl-2.8.8-1.3.24
>
> $ compile all
>
> $install all (not php yet)
>
> apache runs ok with or without ssl
>
> then compile php and install it..
>
> I get an error cannot load shared library libphp4.so....
>
> y ? I compile apache -enablemodule-ssl/so
> what I miss out and I get that
>
> cannot load shared library libphp4.so..
>
> file exists . . in the directory that apache reads it but . . .what is
wrong
> ?
>
>
> Thanks..
>
>
>
> --
> ~~~~~~~~~~~~~~~~
>
> Sapilas@/dev/pinkeye
>
> ~~~~~~~~~~~~~~~~
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
 
I configured well ( I think) my system (win32-apache 1.3.24-php4.1.2) and every think is working except session variables. Codes like this don't work:
page1.php
<?php
   session_start();
   $_SESSION['test']="adding";
   header("Location: page2.php?".SID);
   exit;
?>
 
page2.php
<?php
   session_start();
   print $_SESSION['test'];
?>
 
Question:
-----------
Why in the 2nd page $_SESSION['test'] is not set and so   no available?
N.B: All codes I wrote first for php4.1.0 don't work with the new version of php........
 
Please help me....
Thank you. 
_______________________________________________________________________________
  IncrediMail - il mondo della posta elettronica si è finalmente evoluto - Clicca Qui
--- End Message ---

Reply via email to