php-general Digest 4 Nov 2005 05:00:04 -0000 Issue 3774
Topics (messages 225058 through 225084):
Re: Pictureupload
225058 by: Jay Blanchard
225059 by: Richard Davey
225060 by: twistednetadmin
225061 by: Jay Blanchard
225064 by: James Benson
225066 by: twistednetadmin
225070 by: James Benson
225077 by: comex
Re: SSL & normal sessions stored differently?
225062 by: Jesse Guardiani
225063 by: Jesse Guardiani
Can figure out whats wrong
225065 by: Anders Gjermshus
225068 by: Jochem Maas
Convert fake Unicode to real UTF-8
225067 by: Andreas Jakl
225069 by: Minuk Choi
small windows odd problem
225071 by: matt VanDeWalle
225073 by: James Benson
Re: proc_open, fwrite, 16384 bytes magic
225072 by: Philip Hallstrom
Classes and Functions and If's (Problems Again)
225074 by: Unknown Unknown
225075 by: Jasper Bryant-Greene
225076 by: Robin Vickery
client server question
225078 by: bruce
to the freelancers!!
225079 by: bruce
Re: Email Validation built-in? RFC
225080 by: bruce
Re: PHP from the command line
225081 by: David Tulloh
225082 by: bruce
225083 by: Robbert van Andel
225084 by: bruce
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 ---
[snip]
I have made this script to upload pictures into a picturegallery on a
website.
The script works just as I expected, but with one huge flaw. It doesn't work
from every users computer.
I can upload pictures with no problem, but another user get's an
errormessage. the other user emailed the picture to me and I could upload it
with no errors.
[/snip]
What error message do they get?
--- End Message ---
--- Begin Message ---
Hi twistednetadmin,
Thursday, November 3, 2005, 4:50:33 PM, you wrote:
> I have made this script to upload pictures into a picturegallery on a
> website.
> The script works just as I expected, but with one huge flaw. It doesn't work
> from every users computer.
> I can upload pictures with no problem, but another user get's an
> errormessage. the other user emailed the picture to me and I could upload it
> with no errors.
> Here's the script.
> <form name="guildimage_upload" method="post" action="<?php
> $_SERVER['PHP_SELF'] ?>" enctype="multipart/form-data">
> <table class="normal" border="0" align="center">
> <tr>
> <td height="200" align="center" valign="bottom"
> class="holyheader18">Screenshot upload</td></tr>
> <tr>
> <td align="center" colspan="2">
> <table border="1">
> <tr>
> <td>
> Only pictures with the .jpg extension and size 300kb or less will be
> uploaded!<br>
> Imagenames should not contain quotes or any special signs!!<br>
> </td>
> </tr>
> </table>
> </td>
> </tr>
> <tr>
> <td>
> File:
> <input type="hidden" name="MAX_FILE_SIZE" value="300000">
> <input type="file" name="guildimage">
> </td>
> </tr>
> <tr>
> <td>
> Comment:
> <input name="guildimage_comment" type="text" size="40" maxlength="40">
> </td>
> <td>
> <input type="submit" name="submit" value="Summon">
> </td>
> </tr>
> </tr>
> <tr>
> <td height="160" colspan="2" class="maintext" valign="top">
> <?php
> chmod("/guildimages/", 0777);
> ######################################################
> ###Uploads the image and checks if the image exists already###
> ######################################################
> if (isset($_POST['submit'])) //If you push the submit-button
> {
> $sysfolder="/guildimages/";
> $filename="".$_FILES['guildimage']['name']."";
> if (file_exists($sysfolder . $filename)) //If the filename exists.
> {
> echo "Filename exists or no file selected. Please rename the file or select
> a file";
> }
> elseif ($_FILES['guildimage']['type'] == "image/jpeg") //And if the image
> is .jpg less or equal 300kb...
> {
> copy ($_FILES['guildimage']['tmp_name'],
> "/guildimages/".$_FILES['guildimage']['name']) //Copy the image to
> /guildimages
> or die("Could not copy file"); //Or don't if it's wrong size or format
> $insertSQL = sprintf("INSERT INTO guildimages (guildimage_date,
> guildimage_name, guildimage_comment, posted_by) VALUES (NOW(), '%s', '%s',
> '%s')",
> ($_FILES['guildimage']['name']),
> ($_POST['guildimage_comment']),
> ($_SESSION['logname']));
> $guildimage_upload = mysql_query($insertSQL) or die(mysql_error());
> //insert all info to the DB
> echo "Result:<br>\n";
> echo "Filename: ".$_FILES['guildimage']['name']."<br>\n";
> echo "Filesize: ".$_FILES['guildimage']['size']." byte<br>\n";
> echo "Filtype: ".$_FILES['guildimage']['type']."<br>\n";
> echo "Congrats! It worked!\n";
> }
> else
> {
> echo "Result:<br>\n";
> echo "Now that didn't seem to work... <br>\n
> Did you try a wrong format or size? <br>\n
File that failed-->> (".$_FILES['guildimage']['name'].")<br>";
> }
> }
?>>
> </td>
> </tr>
> </table>
> </form>
> Can anyone see what's wrong? Since it works from some computers and not from
> all?
How large was the image? Could it be that the script is timing out
during an upload? I recently had to change the max_input_time value on
one site because the uploads were so large they kept timing the script
out, yet some people (on really fast connections) could upload just
fine.
Cheers,
Rich
--
Zend Certified Engineer
PHP Development Services
http://www.corephp.co.uk
--- End Message ---
--- Begin Message ---
The errormessage is from this part of the script.
echo "Result:<br>\n";
echo "Now that didn't seem to work... <br>\n
Did you try a wrong format or size? <br>\n
File that failed--> (".$_FILES['guildimage']['name '].")<br>";
So it seems that the file is wrong type or size, but as it works with the
same picture from my own computer that is odd.
The timeout part I have to check before I answer to, but I have 4mb
connection and the last user it failed for has a 2mb connection. 300kb
shouldn't make the script time out? Or could it? Where do I check the
timeout settings btw? PHP.ini?
Or can I run phpinfo() on it?
--- End Message ---
--- Begin Message ---
[snip]
The timeout part I have to check before I answer to, but I have 4mb
connection and the last user it failed for has a 2mb connection. 300kb
shouldn't make the script time out? Or could it? Where do I check the
timeout settings btw? PHP.ini?
Or can I run phpinfo() on it?
[/snip]
Check your php.ini as well as your httpd.conf (Apache) for timeout values.
Remember to restart your web server after you have made and changed settings
in either of these files.
--- End Message ---
--- Begin Message ---
twistednetadmin wrote:
I have made this script to upload pictures into a picturegallery on a
website.
The script works just as I expected, but with one huge flaw. It doesn't work
from every users computer.
I can upload pictures with no problem, but another user get's an
errormessage.
Should we guess the error message or play hang man for it?
Can I have a P please :)
--- End Message ---
--- Begin Message ---
As I'm not the serveradmin I have only checked the phpinfo wich says:
mysql.connect_timeout60
default_socket_timeout60
Keep-Alive 300
HTTP_KEEP_ALIVE 300
Timeouts Connection: 300 - Keep-Alive: 15
Wich of these I should work out from and what they all have to say, I'm not
sure of though since I'm quite new to this.
The errormessage is written above James.
--- End Message ---
--- Begin Message ---
twistednetadmin wrote:
I have made this script to upload pictures into a picturegallery on a
website.
The script works just as I expected, but with one huge flaw. It doesn't work
from every users computer.
I can upload pictures with no problem, but another user get's an
errormessage. the other user emailed the picture to me and I could upload it
with no errors.
Here's the script.
<form name="guildimage_upload" method="post" action="<?php
$_SERVER['PHP_SELF'] ?>" enctype="multipart/form-data">
<table class="normal" border="0" align="center">
<tr>
<td height="200" align="center" valign="bottom"
class="holyheader18">Screenshot upload</td></tr>
<tr>
<td align="center" colspan="2">
<table border="1">
<tr>
<td>
Only pictures with the .jpg extension and size 300kb or less will be
uploaded!<br>
Imagenames should not contain quotes or any special signs!!<br>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
File:
<input type="hidden" name="MAX_FILE_SIZE" value="300000">
<input type="file" name="guildimage">
</td>
</tr>
<tr>
<td>
Comment:
<input name="guildimage_comment" type="text" size="40" maxlength="40">
</td>
<td>
<input type="submit" name="submit" value="Summon">
</td>
</tr>
</tr>
<tr>
<td height="160" colspan="2" class="maintext" valign="top">
<?php
chmod("/guildimages/", 0777);
######################################################
###Uploads the image and checks if the image exists already###
######################################################
if (isset($_POST['submit'])) //If you push the submit-button
{
$sysfolder="/guildimages/";
$filename="".$_FILES['guildimage']['name']."";
if (file_exists($sysfolder . $filename)) //If the filename exists.
{
echo "Filename exists or no file selected. Please rename the file or select
a file";
}
elseif ($_FILES['guildimage']['type'] == "image/jpeg") //And if the image
is .jpg less or equal 300kb...
{
You may want to also do something like
if(filesize($filename) > 300) {
echo "File too large";
}
copy ($_FILES['guildimage']['tmp_name'],
"/guildimages/".$_FILES['guildimage']['name']) //Copy the image to
/guildimages
or die("Could not copy file"); //Or don't if it's wrong size or format
Here you should be using move_uploaded_file() instead of copy()
http://php.net/move_uploaded_file
$insertSQL = sprintf("INSERT INTO guildimages (guildimage_date,
guildimage_name, guildimage_comment, posted_by) VALUES (NOW(), '%s', '%s',
'%s')",
($_FILES['guildimage']['name']),
($_POST['guildimage_comment']),
($_SESSION['logname']));
$guildimage_upload = mysql_query($insertSQL) or die(mysql_error());
//insert all info to the DB
You probably want to do some checks above (before inserting), maybe use
http://php.net/manual/en/function.is-uploaded-file.php
echo "Result:<br>\n";
echo "Filename: ".$_FILES['guildimage']['name']."<br>\n";
echo "Filesize: ".$_FILES['guildimage']['size']." byte<br>\n";
echo "Filtype: ".$_FILES['guildimage']['type']."<br>\n";
echo "Congrats! It worked!\n";
}
else
{
echo "Result:<br>\n";
echo "Now that didn't seem to work... <br>\n
Did you try a wrong format or size? <br>\n
File that failed--> (".$_FILES['guildimage']['name'].")<br>";
}
}
?>
</td>
</tr>
</table>
</form>
Can anyone see what's wrong? Since it works from some computers and not from
all?
--- End Message ---
--- Begin Message ---
> if (isset($_POST['submit'])) //If you push the submit-button
Maybe the user pressed ENTER instead of clicking the button.
--- End Message ---
--- Begin Message ---
James Benson <jb <at> jamesbenson.co.uk> writes:
>
> Could it be you have two differnt domain names, PHP could be using a
> different cookie/session for each one.
Yeah, but I'm setting the session_id manually. I've checked my session
storage path and only one file is created with that session id. Wouldn't
force feeding PHP the session id override any domain problems anyway?
I think the problem is that I have session.auto_start turned on. I can't
turn it off for fear of breaking a production site.
Is there any way to feed PHP a session id with auto_start ON?
--
Jesse Guardiani
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Jesse Guardiani <jesse <at> wingnet.net> writes:
>
> James Benson <jb <at> jamesbenson.co.uk> writes:
>
> >
> > Could it be you have two differnt domain names, PHP could be using a
> > different cookie/session for each one.
>
> Yeah, but I'm setting the session_id manually. I've checked my session
> storage path and only one file is created with that session id. Wouldn't
> force feeding PHP the session id override any domain problems anyway?
>
> I think the problem is that I have session.auto_start turned on. I can't
> turn it off for fear of breaking a production site.
>
> Is there any way to feed PHP a session id with auto_start ON?
Here's a solution I found: I'm just passing the session_id via GET
to the secure site, then doing this on the index page:
session_write_close();
if (isset($_GET['PHPSESSID'])) {
session_id($_GET['PHPSESSID']);
}
session_start();
I had tried that yesterday, but it didn't work. The trick in this case
(since auto_start is ON) is to call 'session_write_close();' before
setting the session_id. Nothing magic about it after all. :)
Thanks for the help!
--
Jesse Guardiani
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
I have I strange problem /bug in my function and I hoping someone can tell
me whats wrong.
This function return the timestamp for midnight Monday on the given week
number.
Its working fine, but on week 44 and week 45 it misses with 3600 seconds (1
hour)
I wounder if it's a bug in strtotime() or it something I'm doing, it only
week 44 and 45.
I hope someone can give me an answer on this problem.
function week2Timestamp ($weekno)
{
$first_day_of_year = date('w', mktime(0,0,0,1,1, date('Y')));
if ($first_day_of_year == 0)
{
$first_day_of_year = 7;
}
$day = ($weekno -1) * 7 + 1 - $first_day_of_year;
$timestamp = strtotime('next Monday', mktime(0, 0, 0, 1, $day,
date('Y')));
return $timestamp;
}
- Anders
--- End Message ---
--- Begin Message ---
freudian slip in the subject me thinks.
Anders Gjermshus wrote:
I have I strange problem /bug in my function and I hoping someone can tell
me whats wrong.
This function return the timestamp for midnight Monday on the given week
number.
Its working fine, but on week 44 and week 45 it misses with 3600 seconds (1
hour)
something about the clocks going back?
I wounder if it's a bug in strtotime() or it something I'm doing, it only
week 44 and 45.
--- End Message ---
--- Begin Message ---
I've been searching for quite some time now and tried several functions,
but didn't find a solution. I hope somebody can point me in the right
direction.
The problem:
Russian text is entered through a web form. It's a rather badly
administrated external webserver with old versions of everything, so I
can not set the table to UTF-8. In the MySQL-Table the text gets
converted to something like "Га" as an ASCII text.
Using PHP I need to get the text out into a plain text file, as a real
UTF-8 string.
How can I convert this? All the conversion methods from PHP that I tried
failed, as the text seems to really consist of the individual ASCII
chars like "&", "#". Therefore, a normal to-unicode-conversion doesn't
change anything.
Thanks in advance,
Andreas Jakl
--- End Message ---
--- Begin Message ---
Have you tried feeding that through htmlentities()?
e.g. echo htmlentities("Га");
see if that outputs what you want on the page.
-Mk
Andreas Jakl wrote:
I've been searching for quite some time now and tried several functions,
but didn't find a solution. I hope somebody can point me in the right
direction.
The problem:
Russian text is entered through a web form. It's a rather badly
administrated external webserver with old versions of everything, so I
can not set the table to UTF-8. In the MySQL-Table the text gets
converted to something like "Га" as an ASCII text.
Using PHP I need to get the text out into a plain text file, as a real
UTF-8 string.
How can I convert this? All the conversion methods from PHP that I tried
failed, as the text seems to really consist of the individual ASCII
chars like "&", "#". Therefore, a normal to-unicode-conversion doesn't
change anything.
Thanks in advance,
Andreas Jakl
--- End Message ---
--- Begin Message ---
hello all,
I have just installed php-4.4.0 on my windows xp system and added the
directory to the path c:/php-4.4.0-Win32 but I am having problems with the
cli version of php. I can get into the program but after i type a bit of
code, I try the following keys to get output but it never parses it. I
have tried ctrl-z and ctrl-m and ctrl-d but none of these will execute a
darn thing. The bit of code I tried is as follows
<?
echo "hello world";
?>
but like i said, nothing is output when i hit ctrl-m, ctrl-z, or ctrl-d
on linux i am using php 4.3.10 and the command line works perfectly
--- End Message ---
--- Begin Message ---
If you mean entering code directly onto the command line then you dont
need the opening/closing PHP tags,
use something like...
php -r "echo 'hello world';"
matt VanDeWalle wrote:
hello all,
I have just installed php-4.4.0 on my windows xp system and added the
directory to the path c:/php-4.4.0-Win32 but I am having problems with
the cli version of php. I can get into the program but after i type a
bit of code, I try the following keys to get output but it never parses
it. I have tried ctrl-z and ctrl-m and ctrl-d but none of these will
execute a darn thing. The bit of code I tried is as follows
<?
echo "hello world";
?>
but like i said, nothing is output when i hit ctrl-m, ctrl-z, or ctrl-d
on linux i am using php 4.3.10 and the command line works perfectly
--- End Message ---
--- Begin Message ---
Sorry, as a follow-up, I just realized that from 'cat' I AM finally getting an
error in the log file, which will perhaps help trace the issue:
cat: stdout: Broken pipe
Could be wrong, but I think you're getting that error because you are
closing $pipes[0] which well, closes the pipe and results in a broken
pipe. Maybe... maybe not.
Anyway, on FreeBSD 5.4 running CLI PHP 5.0.5 with your previously sent
script I get output of:
10240
10240
anyway, thought that might be helpful...
The output is:
10240
6144
which makes up exactly the magic 16384 bytes. So it's certainly not a
qmail issue.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi everyone, i have some code that proccesses a login form. i have an object
$DB which works only in SOME areas, this is the code:
<?php
require_once("Include.php");
global $DB;
$Username= $_REQUEST['Username'];
$Password= $_REQUEST['Password'];
$SQL=" SELECT * FROM members WHERE Username='$Username' AND
Password='$Password'; ";
$DB->Query($SQL);
$UserInfo=$DB->QueryInfo("Array");
if($UserInfo==0) $Login="FALSE";
else $Login="TRUE";
//Make Sure the user is not a duplicate user trying to log in again
if($Login="TRUE")
{
global $DB;
$RL="__";
$LoginD="__";
$ID=$UserInfo['ID'];
echo $ID;
$DB="membersp";
$SQL="SELECT ID FROM membersonline WHERE ID='$ID' ";
$DB->Query($SQL);
$CheckFD=$Result;
if($CheckFD!=0) $LoginD="TRUE";
else $LoginD="FALSE";
if($LoginD=="TRUE")
{
$RL="TRUE";
//code to allow user onto next page without interfering with the security
measures
$DB="membersp";
$SQL="SELECT * FROM membersonline WHERE ID=$ID";
DBConnect($DB,$SQL);
$Slide=$Result;
$NextCode=$Slide['NextCode'];
}
if($LoginD=="FALSE")
{
// Now we start to create and write the data that will let other pages know
if the user is logged in or not
$Seed= rand();
srand($Seed);
$NextCode= rand();
$PageNumber="1";
$DB="membersp";
$SQL="INSERT INTO MembersOnline (ID, Seed, PageNumber, NextCode) VALUES
('{$ID}', '$Seed', '$PageNumber', '$NextCode') ";
DBConnect($DB,$SQL);
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php
Init(2);
?>
<title></title>
</head>
<body>
<?php
if($Login=="FALSE") echo("<p class='error'>Login failed, wrong username
and/or password please <a href='Login.php'>Try Again</a> or <a href='
Register.php'>Register</a></p>");
if(@$RL=="TRUE") echo("<p class='error'>You have already logged in, click <a
href='Projects.php?Code={$NextCode}'>Here</a> to go on</p>");
?>
</body>
</html>
i get an error saying:
*Fatal error*: Call to a member function Query() on a non-object in *
D:\Apache\Apache(re)\Apache2\htdocs\LoginP.php* on line *21*
but before line 21 i use $DB and it works fine, but line 21 is a problem,
any help appreciated
--- End Message ---
--- Begin Message ---
On Thu, 2005-11-03 at 18:37 -0500, Unknown Unknown wrote:
> Hi everyone, i have some code that proccesses a login form. i have an object
> $DB which works only in SOME areas, this is the code:
>
> <?php
> require_once("Include.php");
> global $DB;
There is no need to global $DB here. You are already in the global
scope.
> $Username= $_REQUEST['Username'];
> $Password= $_REQUEST['Password'];
> $SQL=" SELECT * FROM members WHERE Username='$Username' AND
> Password='$Password'; ";
> $DB->Query($SQL);
> $UserInfo=$DB->QueryInfo("Array");
> if($UserInfo==0) $Login="FALSE";
> else $Login="TRUE";
Why aren't you using real boolean values here?
> //Make Sure the user is not a duplicate user trying to log in again
> if($Login="TRUE")
> {
> global $DB;
Again, no need to global $DB. You are still in the global scope.
> $RL="__";
> $LoginD="__";
> $ID=$UserInfo['ID'];
> echo $ID;
> $DB="membersp";
Here is your problem. You just replaced the $DB object with a string.
Maybe you meant to set a property on the $DB object?
I think you may need to do some reading on OOP, perhaps start at
http://php.net/oop for PHP4 or http://php.net/oop5 for PHP5.
--
Jasper Bryant-Greene
General Manager
Album Limited
e: [EMAIL PROTECTED]
w: http://www.album.co.nz/
b: http://jbg.name/
p: 0800 4 ALBUM (0800 425 286) or +64 21 232 3303
a: PO Box 579, Christchurch 8015, New Zealand
--- End Message ---
--- Begin Message ---
On 11/4/05, Unknown Unknown <[EMAIL PROTECTED]> wrote:
> Hi everyone, i have some code that proccesses a login form. i have an object
> $DB which works only in SOME areas, this is the code:
>
[...]
> $DB="membersp";
> $SQL="SELECT ID FROM membersonline WHERE ID='$ID' ";
> $DB->Query($SQL);
[...]
> i get an error saying:
>
> *Fatal error*: Call to a member function Query() on a non-object in *
> D:\Apache\Apache(re)\Apache2\htdocs\LoginP.php* on line *21*
> but before line 21 i use $DB and it works fine, but line 21 is a problem,
> any help appreciated
You've not indicated which is line 21, but I presume it's the bit
shortly after you assigned a string to $DB. A string is not an object,
hence the error message.
-robin
--- End Message ---
--- Begin Message ---
hi...
a rather basic question. i'm looking for examples of client/server apps. i'm
also looking for input as to what's the best way to implement the underlying
messaging protocols. i've started looking at soap/rpc, but i'm not sure as
to how these protocols would fit/work..
the client/server apps are both web based apps on different servers.
i'm envisioning a test app (client) where a user logs into a web app. the
user is able to enter some information, do some functions, etc...
the client app is then able to communicate with the 'server app' (server) to
exchange information, and perform some actions. the actions might be to
upload/download/delete/update information, or some other function. if
possible i'd also like the ability to 'push' information from the server, to
the client apps, or would it make more sense to have some type of client
cron process that continuously checks the server app, and pulls any required
information.
i'd like the communication between client/server to be
encrypted/authenticated/secure. i'd also like to be able to support multiple
clients simultaneously communicating with the server.
these are kind of basic thoughts to my putting this test app together.
-bruce
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Hi,
Just a quick question. Had a conversation with a person who works for a
non-profit, and she was describing some of her dealings with obtaining
grants for the development of 'open source' apps.Got me to thinking. If a
company sponsored the initial development of an 'open source' kind of app
(the exact licensing would need to be fleshed out) what do yout think would
be the response of people to work on the apps..
I started to wnoder if there would be a pool of talented people who would be
interested in working on projects that are initially funded. The funding
would go to pay the resources, set up the project, do initial grass roots
marketing, etc... The idea would be to focus in on the
projects/technologies/apps that a given business would agree to initially
support/fund.
Thoughts/comments/etc...
-bruce
[EMAIL PROTECTED]
ps. I'm not talking about a freshmeat.net/sourceforge kind of environment.
The obvious goal of this kind of process would be to turn small
applications/projects into profitable applications. My curiousity is whether
you could then create applications/services that could be built along the
same model as nagios/mysql/etc.. where you have a free/open version, as well
as a fee based application/service.
--- End Message ---
--- Begin Message ---
just to add my 0.02 worth to this conversation....
after throwing things at the wall regarding email verification/validation, i
finally decided to cheat. i went with using the perl/cpan email function
(can't recall right now) and created a wrapper around it. the perl function
has been around alot longer than almost any other function that i could
find, and it appeared to follow the rfc standard.
but yeah, it would be nice/good if there was a verified/valid/accurate php
email_valid function, as most of the ones that i found were really
lacking...
-bruce
-----Original Message-----
From: Robin Vickery [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 25, 2005 5:31 AM
To: [email protected]
Subject: Re: [PHP] Re: Email Validation built-in? RFC
On 10/25/05, Mark Charette <[EMAIL PROTECTED]> wrote:
> Ben Litton wrote:
>
> > You could certainly write an extension to do so. That's what I did
> > (mostly I was writing one for another purpose and added a function I
> > stole from O'Reilly.
>
> As you stated in your article, it isn't rfc822 compliant (it isn't even
> close). Richard was pretty specific in his needs.
Just in case anyone's inspired to read through the specs; It's
RFC-2822 these days. RFC-822 is obsolete.
-robin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Many linux distributions use a different php config file for the apache
and cli versions.
Using two different configurations might explain the problems you are
seeing.
David
Robbert van Andel wrote:
I run a linux webserver with Apache and PHP5. Does anyone out there know
why a php script would work from the command line but fail when running it
through a web browser? In particular, I'm trying to get a connection to an
MSSQL server but PHP fails to connect when I run the script with a web
browser. My regular scripts (i.e. ones without any mssql functions) work
fine from the browser. When I run the script from the command line, the
connection succeeds. Any idea if this is a PHP error or an apache error. If
this is an apache error, does anyone know what I need to search for to find
an answer?
Thanks,
Robbert van Andel
--- End Message ---
--- Begin Message ---
what's the error that you're getting from the web php app...
also, what do you get from the php_info() for the web app? this tells you a
great deal of information regarding your php/web setup (if you didn't
already know!)
get us the information and we can help track down your issue...
also, is there a user/passwd setup to access the mssql db?
-bruce
-----Original Message-----
From: David Tulloh [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 03, 2005 6:22 PM
To: Robbert van Andel
Cc: [email protected]
Subject: Re: [PHP] PHP from the command line
Many linux distributions use a different php config file for the apache
and cli versions.
Using two different configurations might explain the problems you are
seeing.
David
Robbert van Andel wrote:
>I run a linux webserver with Apache and PHP5. Does anyone out there know
>why a php script would work from the command line but fail when running it
>through a web browser? In particular, I'm trying to get a connection to an
>MSSQL server but PHP fails to connect when I run the script with a web
>browser. My regular scripts (i.e. ones without any mssql functions) work
>fine from the browser. When I run the script from the command line, the
>connection succeeds. Any idea if this is a PHP error or an apache error.
If
>this is an apache error, does anyone know what I need to search for to find
>an answer?
>
>
>
>Thanks,
>
>Robbert van Andel
>
>
>
>
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
>From the web, all I get is that the connection failed. Nothing more useful
than that. PHP_INFO tells me that it sees the MS SQL ini file and the MS
SQL configuration settings are displayed further down the list.
The username and password work in the script because I am able to connect
using the exact same script from the command line.
-----Original Message-----
From: bruce [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 03, 2005 7:28 PM
To: 'David Tulloh'; 'Robbert van Andel'
Cc: [email protected]
Subject: RE: [PHP] PHP from the command line
what's the error that you're getting from the web php app...
also, what do you get from the php_info() for the web app? this tells you a
great deal of information regarding your php/web setup (if you didn't
already know!)
get us the information and we can help track down your issue...
also, is there a user/passwd setup to access the mssql db?
-bruce
-----Original Message-----
From: David Tulloh [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 03, 2005 6:22 PM
To: Robbert van Andel
Cc: [email protected]
Subject: Re: [PHP] PHP from the command line
Many linux distributions use a different php config file for the apache
and cli versions.
Using two different configurations might explain the problems you are
seeing.
David
Robbert van Andel wrote:
>I run a linux webserver with Apache and PHP5. Does anyone out there know
>why a php script would work from the command line but fail when running it
>through a web browser? In particular, I'm trying to get a connection to an
>MSSQL server but PHP fails to connect when I run the script with a web
>browser. My regular scripts (i.e. ones without any mssql functions) work
>fine from the browser. When I run the script from the command line, the
>connection succeeds. Any idea if this is a PHP error or an apache error.
If
>this is an apache error, does anyone know what I need to search for to find
>an answer?
>
>
>
>Thanks,
>
>Robbert van Andel
>
>
>
>
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
ok..
show us the connection code you're using to access the db..
-bruce
-----Original Message-----
From: Robbert van Andel [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 03, 2005 8:37 PM
To: [EMAIL PROTECTED]; 'David Tulloh'
Cc: [email protected]
Subject: RE: [PHP] PHP from the command line
>From the web, all I get is that the connection failed. Nothing more useful
than that. PHP_INFO tells me that it sees the MS SQL ini file and the MS
SQL configuration settings are displayed further down the list.
The username and password work in the script because I am able to connect
using the exact same script from the command line.
-----Original Message-----
From: bruce [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 03, 2005 7:28 PM
To: 'David Tulloh'; 'Robbert van Andel'
Cc: [email protected]
Subject: RE: [PHP] PHP from the command line
what's the error that you're getting from the web php app...
also, what do you get from the php_info() for the web app? this tells you a
great deal of information regarding your php/web setup (if you didn't
already know!)
get us the information and we can help track down your issue...
also, is there a user/passwd setup to access the mssql db?
-bruce
-----Original Message-----
From: David Tulloh [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 03, 2005 6:22 PM
To: Robbert van Andel
Cc: [email protected]
Subject: Re: [PHP] PHP from the command line
Many linux distributions use a different php config file for the apache
and cli versions.
Using two different configurations might explain the problems you are
seeing.
David
Robbert van Andel wrote:
>I run a linux webserver with Apache and PHP5. Does anyone out there know
>why a php script would work from the command line but fail when running it
>through a web browser? In particular, I'm trying to get a connection to an
>MSSQL server but PHP fails to connect when I run the script with a web
>browser. My regular scripts (i.e. ones without any mssql functions) work
>fine from the browser. When I run the script from the command line, the
>connection succeeds. Any idea if this is a PHP error or an apache error.
If
>this is an apache error, does anyone know what I need to search for to find
>an answer?
>
>
>
>Thanks,
>
>Robbert van Andel
>
>
>
>
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---