Re: [PHP] counter for HIGH traffic site

2002-04-08 Thread Jim Lucas [php]

as long as you are only inserting information into the mysql db on each page
load, then you shouldn't have a problem.  make sure you keep you indecies
down to a minimum.

Jim Lucas

- Original Message -
From: "Craig Westerman" <[EMAIL PROTECTED]>
To: "php-general-list" <[EMAIL PROTECTED]>
Sent: Saturday, April 06, 2002 11:57 PM
Subject: [PHP] counter for HIGH traffic site


> I'm needing counter for site that receives 60 to 80 hits a minute. Many I
> have tried cause excessive server load and need to be deactivated or they
> lose data and return to zero without warning. All tried so far have been
> written in Perl.
>
> Anyone here know of a PHP counter that would handle HIGH traffic with
little
> added server load? Would using MySQL to store count be of any benifit?
>
> Thanks
>
> Craig ><>
> [EMAIL PROTECTED]
>


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




Re: [PHP] Phone number validation

2002-04-08 Thread Jim Lucas [php]

try this

preg_match("/[a-zA-Z]+/i", $str);

and if you want to go the other route.

do this

preg_match("/[^0-9\(\)\-\.\ ]+/i", $str);
this will return true if it is anything other then what is listed.
numbers 0-9
"("
")"
"-"
"."
" "

Jim Lucas

- Original Message - 
From: "Gary" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, April 06, 2002 6:52 PM
Subject: [PHP] Phone number validation


> Hi All,
>   I tried to cut a corner and use an  alphabetic validation I am using 
> elsewhere
>   $stuff = "/^[a-zA-Z]+$/";
> if(preg_match($stuff, $value))
> 
> looks like I forgot about +( )- being in phone number. What is the 
> easiest way to allow these 4  characters? Are there any other characters 
> that people use?
> 
> TIA
> Gary
> 
> 
> -- 
> 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




Re: [PHP] Array in a Loop Question

2002-03-26 Thread Jim Lucas [php]

I think to get the results you are wanting, you might try this.


the address[]  tells the form that this element is an array and when
submitted, will be converted into an indexed array on the process page.

so you take this new array on the process page and do something like this.


foreach($address AS $k => $v)
{
echo "$k : $v";
}

Jim Lucas
www.bend.com

- Original Message -
From: "Jeff Hatcher" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, March 26, 2002 10:18 AM
Subject: [PHP] Array in a Loop Question


I have a form that gets repeated depending on number of members in a
group(1 form surrounds all members). I separate the entries by assigning
a count value to the names of the inputs (Ex. ). Does anyone know how I can pull the values
back out of the $_POST[]?

Example of ideal scenario that does not work:
case "process1":
for ($i=0;$i<$_POST[count];$i++)
{
$_POST[address$i]
}

--
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




Re: [PHP] Array Question

2002-03-26 Thread Jim Lucas [php]

I can make this just a little easier..  try this

$query = "SELECT * FROM mytable WHERE t_state_id_state in ('" .join("', '",
$state). "')";

if $state happens to be the name of the array that is passed from the
multi-select

Jim Lucas
www.bend.com
- Original Message -
From: "Rick Emery" <[EMAIL PROTECTED]>
To: "'John Fishworld'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, March 26, 2002 10:07 AM
Subject: RE: [PHP] Array Question


> $n =sizeof($state);
>
> $srch = "";
> while( $x=0; $x<$n; $x++)
> {
>... do something with array element $state[$x] ...
>$srch .= $state[$x].", ";
> }
> $srch = rtrim($srch,", ");
> $query = "SELECT * FROM mytable WHERE t_state_id_state in ($srch)";
>
> -Original Message-
> From: John Fishworld [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, March 26, 2002 11:51 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Array Question
>
>
> I have some multiple select boxes in a form
> ie
>  
>   all Regions 
>   Region19 
>   Region14
>   Region15
>
> these then get passed and I want to use them in mysql query
>
> blah blah
> WHERE
>   (t_state_id_state = $state[0])
>
> Whats the best way of finding out how many items are in my array ?
> And how can I step through the ones the exist ?
> And can I only use LIKE % when my value is all ?
>
> thanks
>
>
>
> --
> 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
>
>


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




Re: [PHP] Still REG EX

2002-03-23 Thread Jim Lucas [php]

what are you trying to do?

Jim Lucas
www.bend.com

- Original Message - 
From: "John Fishworld" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, March 23, 2002 4:33 PM
Subject: [PHP] Still REG EX


> I'm still playing about trying to validate an url
> www(dot)something(dot)something !
> 
> I thought this would work but know
> 
> if (ereg("^(w{3})(\\.)([a-zA-Z]+)(\\.)([a-z]{2,4})$", $str))
> 
> can anyone explain why not ???
> 
> ^(w{3}) = three w at start of string ??
> 
> (\\.) = literal dot ??
> 
> ([a-zA-Z]+) match any word with letters ??
> 
> (\\.) = literal dot ??
> 
> ([a-z]{2,4})$ = at least 2 leters eg de but upto 4 eg info
> 
> but it doesn't !
> 
> thanks in advance
> john
> 
> 
> 
> 
> 
> -- 
> 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




Re: [PHP] included files not reread by php when i edit the files

2002-03-22 Thread Jim Lucas [php]

how about giving an example of the error message(s)...

- Original Message - 
From: "Chris" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 22, 2002 12:59 PM
Subject: [PHP] included files not reread by php when i edit the files


> While editing pages, for some reason (default setting? / configuration 
> problem?) the changes i make in included files (with sometimes quite 
> some nesting) are not recognized when reloading a page. So i see 
> errors that belong to the previous version.
> 
> What setting could do this?
> 
> I'm quite sure the browser is not caching the page.
> 
> Win98 + 'foxserv', that is: apache, mysql. php, zend.
> Using: Postnuke 0.7.1 with sessions (it did not happen before the 
> sessions, but cannot imagine the sessions do this.).
> I would suspect zend but it also happened with the normal php 4.06.
> 
> cheers,
> Chris
> 
> -- 
>  ! please check my email address !  
>  ! only my email [EMAIL PROTECTED] works !
>  ! email [EMAIL PROTECTED] is a black hole since januari 2002 !
> 
> Chris Hayes - Droef 35 - Wageningen
> 
> 
> -- 
> 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




Re: [PHP] $HTTP_SESSION_VARS with unset()

2002-03-14 Thread Jim Lucas [php]

I must ask first, why don't you just use the session_destroy() function?

it will kill all related sessions variables and reset the PHPSESSID (if
that's you have it named)

Jim Lucas
www.bend.com

- Original Message -
From: "SpamSucks86" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 14, 2002 4:54 PM
Subject: [PHP] $HTTP_SESSION_VARS with unset()


> when someone logs in, it sets $HTTP_SESSION_VARS with the appropriate
> information. to log them out, I tried just using
> unset($HTTP_SESSION_VARS['valid_user']) but it doesn't actually remove
> it from the session. it will only work if valid_user was set on the same
> script call (for example, if it logs me in and then immediately logs me
> out without making another call to the script). How come
> $HTTP_SESSION_VARS won't destroy session variables unless they're
> created during the same script call? Or maybe it just has to do with if
> $HTTP_SESSION_VARS creates any variable before it deletes any. Thanks
> for your help =)
>


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




Re: [PHP] require() vs include()

2002-03-14 Thread Jim Lucas [php]

Plus, depending on how you are calling the file.  Meaning if the file name
that you are calling is a static file name or dynamic file name

require() and require_once()  will include a file before the php parser
starts its job, but this will only happen if the name isn't dynamic.

meaning that if you have this

require("myfile.inc");  //static
and
require($var. ".inc"); //dynamic

the first one will be included into the before parsing and the second will
wait until the parser comes along and defines the $var value.

if you call require()  or require_once() with a variable in the file handler
name space, it will downgrade (in a way) to just working like an include()
or include_once()

with include() or include_once() it doesn't matter if the file handle name
has a variable in it.  it will always include the file after the parser
starts its job.

Jim Lucas
www.bend.com

- Original Message -
From: "SHEETS,JASON (Non-HP-Boise,ex1)" <[EMAIL PROTECTED]>
To: "'David McInnis'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, March 14, 2002 3:56 PM
Subject: RE: [PHP] require() vs include()


> They are much the same, both "include" a file.
>
> To quote the PHP manual "require() and include() are identical in every
way
> except how they handle failure. include() produces a Warning while
require()
> results in a Fatal Error. In other words, don't hesitate to use require()
if
> you want a missing file to halt processing of the page. include() does not
> behave this way, the script will continue regardless. Be sure to have an
> appropriate include_path setting as well."
>
> That said I would use require_once and include_once instead of just
include
> and require, these functions ensure the file is only included once which
> prevents a lot of problems.
>
> Jason
>
> -Original Message-
> From: David McInnis [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, March 14, 2002 4:47 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] require() vs include()
>
>
> Are these redundant functions or are they different?  I seem to be able
> to use the interchangeably.
>
> David McInnis
>
>
>
> --
> 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
>
>


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




Re: [PHP] php array

2002-03-12 Thread Jim Lucas [php]

you could referance the element id of the form

something like

if(window.document.form.element[1].value = "")
{
do_something();
}

not sure of the exact js construct, but you get my idea.

Jim Lucas
www.bend.com
- Original Message -
From: "Rodrigo Peres" <[EMAIL PROTECTED]>
To: "PHP" <[EMAIL PROTECTED]>
Sent: Tuesday, March 12, 2002 10:10 AM
Subject: [PHP] php array


> Hi list,
>
> I think this could be an idiot question but I couldn't find an answer.
> I have 4 input text in a html, and I'd like to store them as a list, so
I've
> named it Name[]. OK, php understand it as an array, but how can I make an
> validation code with javascript to know if the user didn't typed in this
> fields??? I couldn't do javascript recognize my name[] field
>
>
> Thank's in advance
>
> Rodrigo
> --
>
>
>
> --
> 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




Re: [PHP] safe mode and file handling

2002-03-01 Thread Jim Lucas [php]

if you are on a unix system running with apache, you could modify the
virtual host block and have apache run as your user name and then change the
permissions of the docroot so you are the owner and group.

Jim Lucas
www.bend.com
- Original Message -
From: "Mika Lindqvist" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 01, 2002 1:21 PM
Subject: [PHP] safe mode and file handling


> I and my www space provider have fought with a problem. All
> files/directories created by PHP are owned by nobody/nobody and we want
> them to be created by my own uid/guid. How this would be solved by least
> amount of modification in the scripts.
>
> The problem is in that safe mode requires that the script and the
> directory containing the file/directory to be accessed is owned by me
> and only me. If I tell PHP to create a directory test1 under my www root
> and then change to that directory and tell it to create another
> directory for example called test2, it fails because test1 is owned by
> nobody, not me.
>


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




Re: [PHP] Damned HTTP_HOST

2002-02-26 Thread Jim Lucas [php]

I should mention that if you HTTP_HOST resolves to a DNS entry, that is what
gets displayed in the HTTP_HOST

Jim
- Original Message -
From: "Dominique van der Wal" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 26, 2002 6:38 AM
Subject: [PHP] Damned HTTP_HOST


> Hi,
>
> I'm trying to find the HTTP_HOST adress of my website.
>
> I've try the followings :
>
> $HTTP_HOST  : nothing
> $ALL_HTTP["HTTP_HOST "] : nothing
> $_SERVER["HTTP_HOST "] : nothing
>
>
> But when I print $ALL_HTTP or $_SERVER, I obtain the followings lines :
>
> HTTP_ACCEPT_CHARSET iso-8859-1,*,utf-8
> HTTP_ACCEPT_LANGUAGE en,fr-BE
> HTTP_ACCEPT_ENCODING gzip
> HTTP_PRAGMA no-cache
> HTTP_ACCEPT image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
> HTTP_HOST 193.190.218.xxx
>
> So, how can I receive this damned HTTP_HOST adress ?
>
> Thank you in advance
> Dominique van der Wal
>
>
>
> --
> 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




Re: [PHP] Damned HTTP_HOST

2002-02-26 Thread Jim Lucas [php]

there is always a way.

$IP = $GLOBALS['SERVER_ADDR'];
$IP = $GLOBLAS['HTTP_HOST'];
$IP = $GLOBALS[HTTP_SERVER_VARS][HTTP_HOST];

do a print_r() on $HTTP_SERVER_VARS and see what you get  or use this
function

 $value)
  {
echo "$key: $value\n";
  }
}
list_array ($GLOBALS[HTTP_SERVER_VARS]);
?>

Jim Lucas

- Original Message -
From: "Dominique van der Wal" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 26, 2002 6:38 AM
Subject: [PHP] Damned HTTP_HOST


> Hi,
>
> I'm trying to find the HTTP_HOST adress of my website.
>
> I've try the followings :
>
> $HTTP_HOST  : nothing
> $ALL_HTTP["HTTP_HOST "] : nothing
> $_SERVER["HTTP_HOST "] : nothing
>
>
> But when I print $ALL_HTTP or $_SERVER, I obtain the followings lines :
>
> HTTP_ACCEPT_CHARSET iso-8859-1,*,utf-8
> HTTP_ACCEPT_LANGUAGE en,fr-BE
> HTTP_ACCEPT_ENCODING gzip
> HTTP_PRAGMA no-cache
> HTTP_ACCEPT image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
> HTTP_HOST 193.190.218.xxx
>
> So, how can I receive this damned HTTP_HOST adress ?
>
> Thank you in advance
> Dominique van der Wal
>
>
>
> --
> 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




Re: [PHP] format text

2002-02-26 Thread Jim Lucas [php]

try nl2br()

it converts \n into 

Jim
- Original Message - 
From: "eoghan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 26, 2002 2:23 AM
Subject: [PHP] format text


> hello
> i am looking for a way of formatting my text
> when i select it from mysql, looking for a function
> like cold fusion paragraphformat() that will preserve
> line breaks etc when i select my data from the database.
> 
> thanks
> 
> -- 
> 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




Re: [PHP] header problem

2002-02-26 Thread Jim Lucas [php]

question, is this on a process page or on  a page that renders text?

Jim Lucas
- Original Message -
From: "Michael P. Carel" <[EMAIL PROTECTED]>
To: "george Pitcher" <[EMAIL PROTECTED]>
Cc: "php" <[EMAIL PROTECTED]>
Sent: Monday, February 25, 2002 5:44 PM
Subject: Re: [PHP] header problem


> Thank you George you are right, Im looking for a redirector once details
> have been checked in the form and written in the database, but how can i
do
> it what whould be the second option? i 've searching for javascript
> redirector but i cant find one. Could you please help me im stuck here.
>
>
>
> Regards,
> Mike
>
>
> - Original Message -
> From: "george Pitcher" <[EMAIL PROTECTED]>
> To: "Michael P. Carel" <[EMAIL PROTECTED]>
> Sent: Friday, February 22, 2002 5:44 PM
> Subject: Re: [PHP] header problem
>
>
> > Michael,
> >
> > You cannot have any 'displayed' text prior to using the header function.
> > You'll need to do this another way.
> >
> > Are you looking for automatic submission after completing a form or
> > redirection once details have been checked.
> >
> > The first one is only possible with client-side scripting such as
> > javascript (and I'm not sure if it's possible there). The second option
> > is easy.
> >
> > HTH
> >
> > George
> >
> >
> >
> > On Fri, 2002-02-22 at 09:28, Michael P. Carel wrote:
> > > Hi ,
> > >
> > > I  have a problem in using the Header() function. I want to
> automatically
> > > redirect the page into another php script after a form completion but
im
> > > receiving this error "Warning: Cannot add header information - headers
> > > already sent by .."
> > >
> > > Heres the script line:
> > >
> > > header("Location: 8D_Anaform_Admin.php?action=form");
> > >
> > > Please help im stuck here.
> > >
> > >
> > >
> > >
> > > Regards,
> > > Mike
> > >
> > >
> >
> >
> >
> > _
> > Do You Yahoo!?
> > Get your free @yahoo.com address at http://mail.yahoo.com
>
>
> --
> 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




Re: [PHP] pg_result pg_fetch_row pg_fetch_array

2002-02-18 Thread Jim Lucas [php]

http://php.blue-box.net/manual/en/function.pg-result.php
http://php.blue-box.net/manual/en/function.pg-fetch-row.php
http://php.blue-box.net/manual/en/function.pg-fetch-array.php

This should tell you all you need to know.

Jim Lucas
- Original Message - 
From: "* nea *" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 18, 2002 8:55 AM
Subject: [PHP] pg_result pg_fetch_row pg_fetch_array


> 
> Which is the diference between this functions:
> 
> pg_result, pg_fetch_row, and pg_fetch_array
> 
> 
> 
>
>   @@()@@ wWWWw Andrea Hernandez Alfaro
>  (___) Dpto. Computo, Area Internet
> /  YUniversidad Latina de Costa Rica
>  \ | \ |/
> jgs|//   \\|///   "Your mind is your most powerful resource"
> ^^^
> 
> 
> 
> 
> -- 
> 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




Re: [PHP] array variable name

2002-02-14 Thread Jim Lucas [php]

I think you are looking for the function called array_key() 

http://www.php.net/manual/en/function.array-keys.php

Jim Lucas
- Original Message - 
From: "Tomek Golembiewski" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, February 14, 2002 6:20 AM
Subject: [PHP] array variable name


> How can I get the name of array variable into str?
> 
> -- 
> 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




Re: [PHP] browser reload button

2002-02-14 Thread Jim Lucas [php]

about the only way I could think of doing something like this, is to create
a unique value for each link on a page and take on to the end of each link
for each page. then do a select to find out if that unique value has been
entered already.  if you use an MD5 hashing method and combine that with a
unique sessions value, you can pretty much be certain that you wouldn't get
two of the same anytime in the near future.

Jim Lucas
- Original Message -
From: "Rodrigo Peres" <[EMAIL PROTECTED]>
To: "PHP" <[EMAIL PROTECTED]>
Sent: Thursday, February 14, 2002 7:03 AM
Subject: [PHP] browser reload button


> Hi list,
>
> I've made a log to my site, that counts the hits per page. My problem is,
> there is some way to detect when the user presses the reload button?? I
need
> this, or other suggestion, in order to prevent the log to input data for
the
> reload, that isn't a real visit.
>
> My script is just a insert into a table, and I put it in the beggining of
my
> page with require();
>
> Thank's in advance
>
> Rodrigo Peres
> --
>
>
>
> --
> 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




Re: [PHP] a user_auth script. 1 down any more ?

2002-02-12 Thread Jim Lucas [php]

forgive me, I did count wrong,  the problem happens to be that you are using
an ELSE on the end of a while loop.  :P

Jim Lucas
- Original Message -
From: "Matthew Darcy" <[EMAIL PROTECTED]>
To: "Jim Lucas [php]" <[EMAIL PROTECTED]>; "hugh danaher"
<[EMAIL PROTECTED]>; "php" <[EMAIL PROTECTED]>
Sent: Tuesday, February 12, 2002 11:04 AM
Subject: RE: [PHP] a user_auth script. 1 down any more ?


> you surprise me I counted { + } and got six of each. I'll double check.
> Thanks for the input.
>
> Matt.
>
>
> -Original Message-
> From: Jim Lucas [php] [mailto:[EMAIL PROTECTED]]
> Sent: 12 February 2002 18:55
> To: [EMAIL PROTECTED]; hugh danaher; php
> Subject: Re: [PHP] a user_auth script. 1 down any more ?
>
>
> Try closing all your "{" & "}".  count them up, you are missing the
closing
> bracket on your while statment..
>
> Jim Lucas
> - Original Message -
> From: "Matthew Darcy" <[EMAIL PROTECTED]>
> To: "hugh danaher" <[EMAIL PROTECTED]>; "php"
> <[EMAIL PROTECTED]>
> Sent: Tuesday, February 12, 2002 10:25 AM
> Subject: RE: [PHP] a user_auth script. 1 down any more ?
>
>
> > Massive Help Hugh,
> >
> > I missed that one and learnt the lesson make sure statements are closed.
> >
> > I am now getting complaint of an error on line 68. I still can't see
> > anymore.
> >
> > More help is appriciated.
> >
> > Thanks,
> >
> > Matt.
> >
> >
> > -Original Message-
> > From: hugh danaher [mailto:[EMAIL PROTECTED]]
> > Sent: 12 February 2002 16:20
> > To: [EMAIL PROTECTED]; php
> > Subject: Re: [PHP] a user_auth script.- Anyone see the problem ?
> >
> >
> > Check for a closing bracket on this statement
> >
> > if($row["account_password"]==$login_name // line 14 or 15 needs )
> >
> > Hope this helps
> > Hugh
> >
> > - Original Message -
> > From: "Matthew Darcy" <[EMAIL PROTECTED]>
> > To: "hugh danaher" <[EMAIL PROTECTED]>; "php"
> > <[EMAIL PROTECTED]>
> > Sent: Tuesday, February 12, 2002 12:59 AM
> > Subject: [PHP] a user_auth script.- Anyone see the problem ?
> >
> >
> > >
> > >
> > >  > >
> > > include("../dbconnect.php");
> > >
> > > if ($submit == "sign!")
> > > {
> > > $admin_string_auth=("select account_name, account_password,
> > > account_admin_level from account_details where
> > account_name='$login_name'")
> > > or die ("Cant run auth string");
> > >
> > > while ($row=mysql_fetch_array($admin_string_auth))
> > >
> > > {
> > > if($row["account_password"]==$login_name
> > >
> > > {
> > >
> > > $query = "insert into account_details
> > > (account_type,
> > > account_name,
> > > account_address,
> > > account_address1,
> > > account_address2,
> > > account_address3,
> > > account_address4,
> > > account_address5,
> > > account_contact,
> > > account_phone,
> > > account_fax,
> > > account_email,
> > > account_start_date,
> > > account_authorised_credit,
> > > account_pin,
> > > account_disabled_flag,
> > > metered_jobs,
> > > unmetered_jobs,
> > > account_pin_activate) values
> > >
> > > ('$account_type',
> > > '$account_name',
> > > '$account_house',
> > > '$account_street',
> > > '$account_street1',
> > > '$account_town',
> > > '$account_city',
> > > '$account_postcode',
> > > '$account_contact',
> > > '$account_phone',
> > > '$account_fax',
> > > '$account_email',
> > > '$account_start',
> > > '$account_credit_authorised',
> > > '$account_pin',
> > > '$account_disabled_flag',
> > > '$metered_job_count',
> > > '$unmetered_job_count',
> > > '$account_pin_activated')";
> > >
> > >
> > > mysql_query($query) or
> > > die (mysql_error());
> > >
> > > }
> > > else
> > > {printf("could not update");
> > > }
> > >
> > > }
> > >
> > > else
> > > {printf("Error wrong PAssword");
> > > }
> > > ?>
> > >
> > >
> > >  Data Submitted 
> > >   View the records 
> > >  > > }
> > >
> > > else
> > > {
> > > include("insert_test_data.php");
> > > }
> > > ?>
> > >
> > >
> > >
> > > --
> > > 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
> >
> >
> > --
> > 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
>
>


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




Re: [PHP] a user_auth script. 1 down any more ?

2002-02-12 Thread Jim Lucas [php]

Try closing all your "{" & "}".  count them up, you are missing the closing
bracket on your while statment..

Jim Lucas
- Original Message -
From: "Matthew Darcy" <[EMAIL PROTECTED]>
To: "hugh danaher" <[EMAIL PROTECTED]>; "php"
<[EMAIL PROTECTED]>
Sent: Tuesday, February 12, 2002 10:25 AM
Subject: RE: [PHP] a user_auth script. 1 down any more ?


> Massive Help Hugh,
>
> I missed that one and learnt the lesson make sure statements are closed.
>
> I am now getting complaint of an error on line 68. I still can't see
> anymore.
>
> More help is appriciated.
>
> Thanks,
>
> Matt.
>
>
> -Original Message-
> From: hugh danaher [mailto:[EMAIL PROTECTED]]
> Sent: 12 February 2002 16:20
> To: [EMAIL PROTECTED]; php
> Subject: Re: [PHP] a user_auth script.- Anyone see the problem ?
>
>
> Check for a closing bracket on this statement
>
> if($row["account_password"]==$login_name // line 14 or 15 needs )
>
> Hope this helps
> Hugh
>
> - Original Message -
> From: "Matthew Darcy" <[EMAIL PROTECTED]>
> To: "hugh danaher" <[EMAIL PROTECTED]>; "php"
> <[EMAIL PROTECTED]>
> Sent: Tuesday, February 12, 2002 12:59 AM
> Subject: [PHP] a user_auth script.- Anyone see the problem ?
>
>
> >
> >
> >  >
> > include("../dbconnect.php");
> >
> > if ($submit == "sign!")
> > {
> > $admin_string_auth=("select account_name, account_password,
> > account_admin_level from account_details where
> account_name='$login_name'")
> > or die ("Cant run auth string");
> >
> > while ($row=mysql_fetch_array($admin_string_auth))
> >
> > {
> > if($row["account_password"]==$login_name
> >
> > {
> >
> > $query = "insert into account_details
> > (account_type,
> > account_name,
> > account_address,
> > account_address1,
> > account_address2,
> > account_address3,
> > account_address4,
> > account_address5,
> > account_contact,
> > account_phone,
> > account_fax,
> > account_email,
> > account_start_date,
> > account_authorised_credit,
> > account_pin,
> > account_disabled_flag,
> > metered_jobs,
> > unmetered_jobs,
> > account_pin_activate) values
> >
> > ('$account_type',
> > '$account_name',
> > '$account_house',
> > '$account_street',
> > '$account_street1',
> > '$account_town',
> > '$account_city',
> > '$account_postcode',
> > '$account_contact',
> > '$account_phone',
> > '$account_fax',
> > '$account_email',
> > '$account_start',
> > '$account_credit_authorised',
> > '$account_pin',
> > '$account_disabled_flag',
> > '$metered_job_count',
> > '$unmetered_job_count',
> > '$account_pin_activated')";
> >
> >
> > mysql_query($query) or
> > die (mysql_error());
> >
> > }
> > else
> > {printf("could not update");
> > }
> >
> > }
> >
> > else
> > {printf("Error wrong PAssword");
> > }
> > ?>
> >
> >
> >  Data Submitted 
> >   View the records 
> >  > }
> >
> > else
> > {
> > include("insert_test_data.php");
> > }
> > ?>
> >
> >
> >
> > --
> > 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
>
>
> --
> 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




Re: [PHP] Checking for plus signs?

2002-02-07 Thread Jim Lucas [php]

try this

if(eregi("/\+/",$variable))

Jim Lucas
- Original Message -
From: "Leif K-Brooks" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, February 07, 2002 5:40 PM
Subject: [PHP] Checking for plus signs?


> I'm trying "if(eregi("+",$variable)){", but it gives me an error.  What do
I
> do?
>


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




Re: [PHP] Quote in input tag value?

2002-02-07 Thread Jim Lucas [php]

you might want to check your coding, but that is a parse error waiting to
happen.

Jim Lucas
- Original Message -
From: "Rick Emery" <[EMAIL PROTECTED]>
To: "'Nathan Cassano'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, February 07, 2002 1:54 PM
Subject: RE: [PHP] Quote in input tag value?


> I prefer:   print" ";
>
> -Original Message-
> From: Nathan Cassano [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, February 07, 2002 3:54 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Quote in input tag value?
>
>
>
> If there is a quote mark in an input tags value what is the correct way
> to print the quote?
>
> 
>
> or
>
> 
>
>
> --
> 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
>
>


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




Re: [PHP] Formatting a MYSQL time

2002-02-07 Thread Jim Lucas [php]

well, from what you show here you are trying to use a MYSQL timestamp format
string in a UNIX Timestamp String.

what you need to do is add add this to your select statement.

SELECT UNIX_TIMESTAMP() From Table;

you want to convert the MYSQL timestamp into a UNIX timestamp.

then just through that into the date function and if should work.

Jim Lucas
www.bend.com
- Original Message -
From: "Frank Miller" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, February 07, 2002 9:21 AM
Subject: [PHP] Formatting a MYSQL time


> Hello,
>
>  Since I'm the only one who uses php at work I run into a
> little problem and was hoping maybe someone could help me. I've set up a
> Mysql database that has an event time. I've set the field in the table
> as:   eventtime  time DEFAULT 00:00:00.
> When I go to print the eventtime I'm pulling it out of Mysql with the
> following code snippet
>
>   while ($row = mysql_fetch_array($result)) {
>$dateofevent = $row["dateofevent"];
>$sponsor = $row["sponsor"];
>$location = $row["location"];
>$eventtime = $row["eventtime"];
>$contact = $row["contact"];
>
> All of this works. I connect to Mysql and pull out the data.
>
> Then I'm formatting $eventtime with $etime = date("g:i a", $eventtime);
>
> The problem is that when I print $etime in an html table all I get is 6:00
> pm  for all the events. When I print $eventtime I get the correct time
that
> is stored in Mysql.  My question is am I doing this correctly or do I need
> to use another function to format a mysql time.
>
> Thanks in advance.
>
> Frank Miller
> Computer Specialist and Webmaster
> Technology and Distance Education
> Texas A&M University-Texarkana
> 2600 North Robison Rd
> Texarkana, Texas 75501
>
> Phone:  903-223-3156
> Fax:  903-223-3139
> Office:   165
>
>
> --
> 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




Re: [PHP] date problems

2002-02-04 Thread Jim Lucas [php]

sounds like it might have something to do with leap year.

Jim Lucas
- Original Message - 
From: "toni baker" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 04, 2002 12:03 PM
Subject: [PHP] date problems


> $date1 = "12/12/2001";
> $date1 = date("D M j Y", strtotime($date1));
> print $date1."";
> 
> When I execute the code above I get the following
> output:
> 
> Tue Dec 11 2001 instead Wed Dec !2 2001
> 
> Why does this happen and how can I get the Dec 12 
> output?  Thanks
> 
> 
> 
> 
> 
> 
> __
> Do You Yahoo!?
> Great stuff seeking new owners in Yahoo! Auctions! 
> http://auctions.yahoo.com
> 
> -- 
> 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




Re: [PHP] Address unknown

2002-02-02 Thread Jim Lucas [php]

instead of using an image map, put the image in



and when you click on the image.  it will submit the form, which you can
have pointing at someplace.php,
and then when you parse the GET/POST vars you can look for the variables
someplace_x & someplace_y.
this will give you the x / y axis you are looking to find.

Jim Lucas
- Original Message -
From: "hugh danaher" <[EMAIL PROTECTED]>
To: "Php-General" <[EMAIL PROTECTED]>
Sent: Saturday, February 02, 2002 1:32 PM
Subject: [PHP] Address unknown


Help,

Some one please tell me to RTFN!, but first tell me where to look. :-)

I have a page with an image of a map which delivers the following info to
the address bar of someplace.php.  the  html code
delivers the coordinates of the cursor when clicked.  What I want to do, is
get the following so that I can parse it.

file:///C:/php/museum/DB_MUSE/someplace.php?98,165

Any help is greatly appreciated.

Hugh



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] adding hidden form values to array

2002-02-01 Thread Jim Lucas [php]

if you name the checkbox fields with all the same names that look like this
(  MyFormElement[] ) then it will act as an array.
then on the next page.  find out if the array count is greater then zero, if
so, generate hidden elements with the value of the MyFormElement[] in a
name/value manner.

Jim Lucas
- Original Message -
From: "Erik Price" <[EMAIL PROTECTED]>
To: "PHP (E-mail)" <[EMAIL PROTECTED]>
Sent: Friday, February 01, 2002 12:42 PM
Subject: [PHP] adding hidden form values to array


> In my system, a user can query a database which is populated with the
> names of image files.  The form is submitted, and the page recalls
> itself but displays all matching results.  In each matching result is a
> checkbox form field, with the primary key of the file as the value (I'm
> using MySQL).  At the bottom of the list of matching results is a new
> submit button -- the idea is to allow the user to check off which image
> files they want and hit the new submit button to add those image files'
> primary keys to a queue.  The user can then choose "done", and move on
> (what happens to the queue is irrelevant to my question), or "more
> files", to start the process all over again with new search criteria,
> but preserve the queue so that in effect they can keep adding to the
> queue.
>
> It seems the best way to do this is to initialize an array, like
> "$queue[]", and set the value of each checkbox as
> "$queue['primary_key']" (of course, using the image's real primary_key
> number, not the word 'primary_key').  That way, for each checked image
> file, I can add the value to the array.  If the user needs to do a new
> search for files but keep the queue intact, the array can be passed
> along as a hidden form field as the page calls itself all over again.
>
> My question: does this seem like a workable scheme?  I was hoping to get
> some insight before writing the whole thing -- can an array be passed as
> a hidden form variable without listing every index in the array?  I'd
> like to keep all of this processing in PHP without storing temporary
> data in MySQL, which is why I have this setup with all the hidden form
> field passing.
>
> Epilogue:  Once the user has selected the images they want, they
> continue to a new page where each image is listed (I'd use explode() to
> extract the selections from the array and print them to the screen) and
> they confirm that this is the selection they want.  If so, then they hit
> "submit" and the list of primary keys is finally stored in MySQL into a
> TEXT field or something.  (That's the less elegant, but easier way to do
> it -- a harder way, but much better way, is to store the many-to-many
> relationship into a foreign key table, but I'm still pondering whether
> or not to go this route...)
>
> Thanks!
> Erik
>
>
>
>
>
> 
>
> Erik Price
> Web Developer Temp
> Media Lab, H.H. Brown
> [EMAIL PROTECTED]
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] php and sym links

2002-02-01 Thread Jim Lucas [php]

nope, should work.
what, if any, error messages are you getting?

Jim Lucas
- Original Message -
From: "swade" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 01, 2002 12:20 PM
Subject: [PHP] php and sym links


>
> hi,
> Is there something about php that would prevent me from doing the
following setup
>
> /var/www/base/index.php
> /var/www/site1/index.php is sym link to /var/www/base/index.php
> /var/www/site2/index.php is sym link to /var/www/base/index.php
> /var/www/site3/index.php is sym link to /var/www/base/index.php
> and so on...
>
> and the script gets its configs from a config file by using its current
directory as a key?
>
> Just curious if this would work or it breaks =)
>
> thanks,
> shawn
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Getting an include file into a string after PHP evaluates the vars?

2002-01-30 Thread Jim Lucas [php]

how you suggest the solution is what I use all the time.
But I thought you wanted to work with is as a string.
sorry for the confusion.

Jim Lucas
- Original Message -
From: "Kevin Stone" <[EMAIL PROTECTED]>
To: "'Jim Lucas [php]'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, January 30, 2002 12:12 PM
Subject: RE: [PHP] Getting an include file into a string after PHP evaluates
the vars?


> Actualy I found it's even easier Jim..
>
> ob_start();
> include("templates/$card[template].html");
> $output = ob_get_contents();
> ob_end_clean();
>
> The include() between the start and clean ob_*() functions won't print
> to the client browser yet still evaluates the  tags within the
> HTML template.
>
> I must say this is a very cool set of functions.  Thanks for the tip!
>
> --
> Kevin Stone
> [EMAIL PROTECTED]
>
> > -Original Message-
> > From: Jim Lucas [php] [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, January 29, 2002 6:42 PM
> > To: Kevin Stone; [EMAIL PROTECTED]
> > Subject: Re: [PHP] Getting an include file into a string after PHP
> > evaluates the vars?
> >
> > yes, there is a way out, you can use readfile().
> > capture the output using ob_*() functions and then parse/eval that
> string
> >
> > listed here are the functions you'll need.
> > http://www.php.net/manual/en/function.readfile.php
> > http://www.php.net/manual/en/function.ob-start.php
> > http://www.php.net/manual/en/function.eval.php
> >
> > Jim Lucas
> > - Original Message -
> > From: "Kevin Stone" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Tuesday, January 29, 2002 3:51 PM
> > Subject: [PHP] Getting an include file into a string after PHP
> evaluates
> > the
> > vars?
> >
> >
> > > I'm using templates to create an interface for a new ePostcard
> script.
> > > The templates are HTML with embedded PHP tags in the likely
> positions
> > > (ie. font, text, bgcolor, etc..).  The script include()'s the chosen
> > > template file and evaluates the variables stored in the active
> session
> > > for display in the browser.
> > >
> > > I don't know why I didn't think of this ahead of time but in order
> to
> > > produce the HTML-based ePostcard email I have to get the evaluated
> > > template into a string.
> > >
> > > I can fopen() the template file and read it into a string but the
> PHP
> > > won't evaluate.  And since most of the template is HTML with some
> > > Javascript of course eval() won't work on the string.
> > >
> > > Did I paint myself into a corner here?  Or is there a way out that I
> > > just don't see.
> > >
> > > Thanks,
> > > Kevin Stone
> > > [EMAIL PROTECTED]
> > > www.helpelf.com
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> > >
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] MySQL Fetch_Array VS. Fetch_Object

2002-01-30 Thread Jim Lucas [php]

oh and mysql_fetch_object is a little slower then mysql_fetch_array()

Jim Lucas
- Original Message - 
From: "Bryan Gintz" <[EMAIL PROTECTED]>
To: "PHP List" <[EMAIL PROTECTED]>
Sent: Wednesday, January 30, 2002 10:48 AM
Subject: [PHP] MySQL Fetch_Array VS. Fetch_Object


> Does anyone know what the pros and cons of using mysql_fetch_object vs. 
> mysql_fetch_array.
> 
> I find it easier to use the object version because you dont have to code 
> any extra statements to put them into regular variables.
> 
> print "$obj->field_name";
> as opposed to
> $field_name = $row["field_name"];
> print "$field_name";
> 
> Im just curious to see if there are any problems (resources, etc) that 
> come with using the object method???
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] MySQL Fetch_Array VS. Fetch_Object

2002-01-30 Thread Jim Lucas [php]

my question to you is, why do you want to put them into "another" variable?
the $row["field_name"]; is already a variable.  why not just use that
instead?

Jim Lucas
- Original Message -
From: "Bryan Gintz" <[EMAIL PROTECTED]>
To: "PHP List" <[EMAIL PROTECTED]>
Sent: Wednesday, January 30, 2002 10:48 AM
Subject: [PHP] MySQL Fetch_Array VS. Fetch_Object


> Does anyone know what the pros and cons of using mysql_fetch_object vs.
> mysql_fetch_array.
>
> I find it easier to use the object version because you dont have to code
> any extra statements to put them into regular variables.
>
> print "$obj->field_name";
> as opposed to
> $field_name = $row["field_name"];
> print "$field_name";
>
> Im just curious to see if there are any problems (resources, etc) that
> come with using the object method???
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Redirect problem.... UGH!!

2002-01-30 Thread Jim Lucas [php]

try puting an exit(); after the header().




Jim Lucas
- Original Message -
From: "Ben Turner" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 30, 2002 10:47 AM
Subject: [PHP] Redirect problem UGH!!


> I am trying to put together a very simple redirect from php.  all it is
> supposed to do is pull down the $p var and ship the user off to the
> destination.
>
> Ready for some code?
>
>   #Header("Location: index.html");
> ?>
>
> When I try this on a Linux server using PHP... everything works fine.  The
> minute I put it on IIS5 (the clients server) I receive "The specified CGI
> application misbehaved by not returning a complete set of HTTP headers. "
>
> I am guessing this is a bu with PHP and IIS but does anyone know how to
> circumvent it?
>
> Thanks!
> Ben
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP & Mysql

2002-01-29 Thread Jim Lucas [php]

you must make sure that the version of PHP that is being used was built with
mysql support and/or that the drivers are being loaded for mysql.

Jim Lucas

- Original Message -
From: "Uma Shankari T." <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 29, 2002 6:24 PM
Subject: [PHP] PHP & Mysql


>
> Hello ,
>
>   I am trying to connect mysql using php script like this
>
> $link= mysql_connect('$servername','$username','$password');
>
>  but it is giving Fatal error call to undefined function mysql_connect()
>
> I have checked wheather php is installed properly by using this
>
> phpinfo();
>
> Everything is okay but it is displaying this error...
>
>
> If anyone came to know the reason for this tell me as soon as possible
>
>
> -Uma
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Getting an include file into a string after PHP evaluates the vars?

2002-01-29 Thread Jim Lucas [php]

yes, there is a way out, you can use readfile().
capture the output using ob_*() functions and then parse/eval that string

listed here are the functions you'll need.
http://www.php.net/manual/en/function.readfile.php
http://www.php.net/manual/en/function.ob-start.php
http://www.php.net/manual/en/function.eval.php

Jim Lucas
- Original Message -
From: "Kevin Stone" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 29, 2002 3:51 PM
Subject: [PHP] Getting an include file into a string after PHP evaluates the
vars?


> I'm using templates to create an interface for a new ePostcard script.
> The templates are HTML with embedded PHP tags in the likely positions
> (ie. font, text, bgcolor, etc..).  The script include()'s the chosen
> template file and evaluates the variables stored in the active session
> for display in the browser.
>
> I don't know why I didn't think of this ahead of time but in order to
> produce the HTML-based ePostcard email I have to get the evaluated
> template into a string.
>
> I can fopen() the template file and read it into a string but the PHP
> won't evaluate.  And since most of the template is HTML with some
> Javascript of course eval() won't work on the string.
>
> Did I paint myself into a corner here?  Or is there a way out that I
> just don't see.
>
> Thanks,
> Kevin Stone
> [EMAIL PROTECTED]
> www.helpelf.com
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Multiple INI Files

2002-01-28 Thread Jim Lucas [php]

what OS are you running them on?

if it is linux with apache, you can override most of the php.ini settings in
the httpd.conf file

http://www.php.net/manual/en/configuration.php#AEN2200

this will show you how to override.  it doesn't show it here, but this will
also work in the  blocks in the httpd.conf file.

Jim Lucas
- Original Message -
From: "charlesk " <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 28, 2002 10:10 AM
Subject: [PHP] Multiple INI Files


> We host many sites with PHP.  Is there any way to have each site use a
different php.ini?
>
> Charles Killmer
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] mixed datatype

2002-01-28 Thread Jim Lucas [php]

 "my name ",
"second_arg" => "is ",
"third_arg" => "Jim.",
));

// this will print 
//  "hi there, my name is Jim."
?>

Hope this helps.

Jim Lucas
- Original Message - 
From: "charlesk " <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 28, 2002 8:23 AM
Subject: [PHP] mixed datatype


> How do you make a function like 
> bool session_register (mixed name [, mixed ...])
> 
> What does the function look like that it can take unlimited arguments?
> 
> Charles Killmer
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Question about 4.0.6-7 Mysql 4.0.1 and Redhat 7.2

2002-01-23 Thread Jim Lucas [php]

I know, the base install installs 4.0.6-7.  but my problem comes when i try
upgrading to mysql 4.0.1.

When I try installing 4.0.1 of mysql it has to uninstall the 3.23.41-1
version and then install 4.0.1

I get a conflict that says that libmysqlclient.so.10 is needed by php.mysql
and a few other things.

Well, the problem is, is that I cannot get any of the built-in mysql
functions (mysql_fetch_ro(), mysql_connect(), ... ) to work at all.
Throught the browser it returns the error,  "Fatal error: Call to undefined
function: mysql_fetch_row() in /var/www/html/index.php on line 2"

any help would be great.

Jim Lucas


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] smarter code (mySQL arrays)

2002-01-21 Thread Jim Lucas [php]

function Build_Array($mysql_result_pointer)
{
if(mysql_num_rows($mysql_result_pointer))
{
$res[] = mysql_field_name($mysql_result_pointer);
while($row = mysql_fetch_array($mysql_result_pointer))
{
$res[] = row;
}
}
return($res);
}

Jim Lucas
bend.com
- Original Message -
From: "Justin French" <[EMAIL PROTECTED]>
To: "php" <[EMAIL PROTECTED]>
Sent: Monday, January 21, 2002 4:12 PM
Subject: [PHP] smarter code (mySQL arrays)


> Hi all,
>
> I've got into the habbit of pulling data out of a table something like
this:
>
>
> $sql = "SELECT * FROM cd_review WHERE publish='yes' ORDER BY id DESC
> LIMIT 3";
> $sql_result = mysql_query($sql);
> print mysql_error();
> while ($sql_myrow = mysql_fetch_array($sql_result))
>   {
>   // pull out the data
>   $id = $sql_myrow["id"];
>   $date = $sql_myrow["date"];
>   $user_id = $sql_myrow["user_id"];
>   $artist = $sql_myrow["artist"];
>   $title = $sql_myrow["title"];
>   // edited out about 10 colums for clarity
>   }
>
> Now, I reckon there must be a way of automating the task of making the
> $title var out of $sql_myrow["title"] etc etc for starters, which would
> really help on tables with lots of columns.
>
> Then, it'd be great if I could automate this further to automaticaly to
> a stripslashes() on each var, then possibly nl2br() etc.
>
>
> In psuedo-code I guess it looks something like:
>
> while($sql_myrow = mysql_fetch_array($sql_result))
>   {
>
>   // we have an array of one row
>
>   
>
>   
>
>create a var ($id)>
>
>   }
>
>
> Of course I'm a way newbie on arrays, and I've read the manual, but am
> unclear on the syntax for the above.
>
>
> Ultimately, I'd like to put this all into a function which I call that
> does it all in one hit, but I'll take that in a smaller step :)
>
>
> Justin French
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Uploads

2002-01-21 Thread Jim Lucas [php]

make sure you increase your script timeout limit.
Jim Lucas
- Original Message -
From: "Ronald Tezuka" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 21, 2002 2:50 PM
Subject: [PHP] Uploads


> If anyone can help me out, that'd be greatly appreciated.  I'm trying to
> create an upload form.  Now I've checked both in books and online, and
maybe
> it's becuase I'm trying a weird application, but I can't seem to get
uploads
> greater than 6 megs.  If it is greater than 6 megs, it loads up a blank
page
> even if I have the PHP script that outputs an HTML file.  Anyway I checked
> online when I was first did this and figured out to increase the max value
> in the php.ini file from 2 megs to much higher.  I'm still having trouble
> though.
> Here's what I am using
> Omnihttpd 2.09
> PHP 4.02
> Windows 98 (4.10.1998)
> and IE 4.72.3110
> So if anyone knows why I can't upload files greater than 6 megs
> (approximate) it'd be greatly appreciated if you'd help me.  Thanks
>
> Ron
>
> _
> Send and receive Hotmail on your mobile device: http://mobile.msn.com
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] 2d array help

2002-01-21 Thread Jim Lucas [php]

$result = mysql_query( "SELECT pkgid FROM plans");
while($row = mysql_fetch_assoc($result))
{
$package = mysql_fetch_assoc(mysql_query( "SELECT * FROM plans WHERE
pkgid='$row[pkgid]'"));
}
obviously this will have

$package = array("key" => "value", ...);

are you wanting to have the above be referanced by the pkgid ?

Jim Lucas
bend.com
- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 21, 2002 2:51 PM
Subject: [PHP] 2d array help


> arg- trying to get the data that I pull outta my db into a 2d assoc
array...
>
> any help?
>
> ~kurth
>
> $result = mysql_query( "SELECT pkgid FROM plans");
> while($row = mysql_fetch_assoc($result)){
> $resultpkg = mysql_query( "SELECT * FROM plans WHERE
> pkgid='$row[pkgid]'");
> $package = mysql_fetch_assoc($resultpkg);
> }
>
> print_r($plan);
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] function trouble: pass by referrence

2002-01-21 Thread Jim Lucas [php]

where ever you are going to referance $HTTP_POST_VARS use
$GLOBALS[HTTP_POST_VARS] and then use that inside your function.

function myFunc()
{
foreach($GLOBALS[HTTP_POST_VARS] AS $k => $i)
{
$GLOBALS[HTTP_POST_VARS][$k] = stripslashes($i);
$GLOBALS[HTTP_POST_VARS][$k] = strip_tags($i);
}
}

and after this function $GLOBALS[HTTP_POST_VARS] will look like you want it
to.

Jim Lucas
bend.com
- Original Message -
From: "Bryan McCloskey" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 21, 2002 2:19 PM
Subject: [PHP] function trouble: pass by referrence


> Hello all,
>
> I'm trying to pass the $HTTP_POST_VARS array into a
> function to run some things like strip_tags, trim, and
> htmlspecialchars on all of the variables. If possible,
> I would like to pass this array by referrence, and
> have the function make changes to the actual array and
> not a copy. Accomplishing this is giving me fits,
> however. Can anyone help?
>
> -bryan
>
> =
> --
-
> Schrodinger may have slept here.
> --
-
>
> __
> Do You Yahoo!?
> Send FREE video emails in Yahoo! Mail!
> http://promo.yahoo.com/videomail/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] foreach array into mail isn´t working

2002-01-21 Thread Jim Lucas [php]

Try this:
 \nTo: \"To Name\" <$address>");
}
?>
Jim Lucas
bend.com
- Original Message -
From: "DL Neil" <[EMAIL PROTECTED]>
To: "Josepablo Pérez" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, January 21, 2002 1:59 PM
Subject: Re: [PHP] foreach array into mail isn´t working


> Josepablo,
>
> >  > $maildb = file("mailaddr.txt");
> >
> > foreach ($maildb as $address)
> > { mail($address, "THis is the subject\n", "This is the message\n",
"From: [EMAIL PROTECTED]\n"); }
> > ?>
> >
> > The mailaddr.txt looks like:
> >
> > [EMAIL PROTECTED]
> > [EMAIL PROTECTED]
> > [EMAIL PROTECTED]
> >
> > However the script does send mails BUT they look like this:
> >
> > From Nobody <[EMAIL PROTECTED]>
> > To [EMAIL PROTECTED]
> > Subject [No Subject]
> >
> > **From here down is the message body***
> >
> > Subject THis is the subject
> > From: [EMAIL PROTECTED]
> >
> > This is the message
> >
> > Anybody have an idea why?? I tried it on 2 servers running PHP4 doesnt
work, however i also tried using the
> mail(...) i used up there but alone and that does work.. so the array is
screwing something up..
>
>
> =which operating system are you using?
> =what does your web server have as its admin mail address?
> =have you tried running without the \n at the end of each field?
>
> =dn
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] ftp functions

2002-01-21 Thread Jim Lucas [php]

the copy()  function is subject to the same problem that the ftp functions
are.  you are trying to call a function that is on the remote server and you
want it to do things to the local machine.  unfortunatly you cannot do this.
through a web browser you have no direct access to the local client machine.

Jim
- Original Message -
From: "sundogcurt" <[EMAIL PROTECTED]>
To: "GENERAL PHP LIST" <[EMAIL PROTECTED]>
Sent: Monday, January 21, 2002 11:34 AM
Subject: Re: [PHP] ftp functions


> Would you suggest that I use the copy function instead?
> I have tried the copy function in a prelim test and I had trouble with
> the function "finding" the file on the local machine. From what I have
> seen in the FAQs on PHPBUILDER and this is not an uncommon problem.
>
> One possible solution was that the path to the file to be uploaded must
> be relative to the location of the script. This doesn't make much sense
> to me though seeing as the file to be uploaded is on the local machine
> and the script on the remote machine.
>
> I'm drowning here, anybody have a rope?
>
>
> [EMAIL PROTECTED] wrote:
>
> >one problem, the ftp functions that you are trying to use are on the
server.
> >therefor you are trying to connect one "server" to another "server".  you
> >are not connecting from your workstation to the remote server.  for what
you
> >are attempting to do, ftp will not work.
> >
> >Jim Lucas
> >- Original Message -
> >From: "sundogcurt" <[EMAIL PROTECTED]>
> >To: "GENERAL PHP LIST" <[EMAIL PROTECTED]>
> >Sent: Monday, January 21, 2002 10:47 AM
> >Subject: [PHP] ftp functions
> >
> >
> >>
> >>Before I get flamed for not reading the manual or trying on my own, I
> >>would just like to say that I have been working on this for a few days
> >>and have read the manual and looked at quite a few examples, all of
> >>which seem to elude me.
> >>
> >>
> >>I want to upload an image, and I want to use the ftp function to do so.
> >>I want to use the ftp functions for two reasons, (1) I have not used
> >>them yet, and (2) I will be loading an array with a list of files to be
> >>uploaded and I think the ftp functions are better suited for this (as
> >>opposed to the copy function).
> >>
> >>On to the trouble
> >>
> >>I can connect just fine.
> >>
> >> >>$ftp_server = "xx.xx.xxx.xx";
> >>$ftp_user_name = "username";
> >>$ftp_user_pass = "password";
> >>
> >>// set up basic connection
> >>$conn_id = ftp_connect($ftp_server);
> >>
> >>// login with username and password
> >>$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
> >>
> >>// check connection
> >>if ((!$conn_id) || (!$login_result)) {
> >>echo "Ftp connection has failed!";
> >>echo "Attempted to connect to $ftp_server for user
> >>$ftp_user_name";
> >>die;
> >>} else {
> >>echo "Connected to $ftp_server, for user $ftp_user_name";
> >>}
> >>
> >>
> >>//The file, even if I write the path out on my own, does not upload
> >>eventually I will have the path put in from a form.
> >>
> >>
> >>// upload the file
> >>$destination_file = "/public_html/valeriemacwilliam/pics/$SID_.jpg";
> >>//(I have tried this without the beginning slash as well)
> >>
> >>$source_file = "C:\\temp\\prestigecars\\bk_jag.jpg";
> >>
> >>$upload = ftp_put($conn_id, $destination_file, $source_file,
FTP_BINARY);
> >>
> >>// check upload status
> >>if (!$upload) {
> >>echo "Ftp upload has failed!";
> >>} else {
> >>echo "Uploaded $source_file to $ftp_server as
> >>$destination_file";
> >>}
> >>
> >>//Even the ftp_close(function fails and causes an error);
> >>// close the FTP stream
> >>ftp_close($conn_id);
> >>?>
> >>
> >>Are the ftp functions depreciated? I have taken this example directly
> >>from the manual and editted the values to reflect my own situation but
> >>none of the function calls have been editted. Usually when this is the
> >>case I have just over looked something VERY simple and easy, please take
> >>a look and see what you can come up with.
> >>
> >>I would even be happy with an FAQ, I have been through the one on
> >>PHP.NET with no joy   \C:
> >>
> >>PHP is the lastest release running on Mandrake 8.1 (w / plenty of
> >>horsepower)
> >>
> >>Thank you for your time.
> >>~Curt~
> >>
> >>
> >>--
> >>PHP General Mailing List (http://www.php.net/)
> >>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>For additional commands, e-mail: [EMAIL PROTECTED]
> >>To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> >
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] ftp functions

2002-01-21 Thread Jim Lucas [php]

one problem, the ftp functions that you are trying to use are on the server.
therefor you are trying to connect one "server" to another "server".  you
are not connecting from your workstation to the remote server.  for what you
are attempting to do, ftp will not work.

Jim Lucas
- Original Message -
From: "sundogcurt" <[EMAIL PROTECTED]>
To: "GENERAL PHP LIST" <[EMAIL PROTECTED]>
Sent: Monday, January 21, 2002 10:47 AM
Subject: [PHP] ftp functions


> 
> Before I get flamed for not reading the manual or trying on my own, I
> would just like to say that I have been working on this for a few days
> and have read the manual and looked at quite a few examples, all of
> which seem to elude me.
> 
>
> I want to upload an image, and I want to use the ftp function to do so.
> I want to use the ftp functions for two reasons, (1) I have not used
> them yet, and (2) I will be loading an array with a list of files to be
> uploaded and I think the ftp functions are better suited for this (as
> opposed to the copy function).
>
> On to the trouble
>
> I can connect just fine.
>
>  $ftp_server = "xx.xx.xxx.xx";
> $ftp_user_name = "username";
> $ftp_user_pass = "password";
>
> // set up basic connection
> $conn_id = ftp_connect($ftp_server);
>
> // login with username and password
> $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
>
> // check connection
> if ((!$conn_id) || (!$login_result)) {
> echo "Ftp connection has failed!";
> echo "Attempted to connect to $ftp_server for user
> $ftp_user_name";
> die;
> } else {
> echo "Connected to $ftp_server, for user $ftp_user_name";
> }
>
>
> //The file, even if I write the path out on my own, does not upload
> eventually I will have the path put in from a form.
>
>
> // upload the file
> $destination_file = "/public_html/valeriemacwilliam/pics/$SID_.jpg";
> //(I have tried this without the beginning slash as well)
>
> $source_file = "C:\\temp\\prestigecars\\bk_jag.jpg";
>
> $upload = ftp_put($conn_id, $destination_file, $source_file, FTP_BINARY);
>
> // check upload status
> if (!$upload) {
> echo "Ftp upload has failed!";
> } else {
> echo "Uploaded $source_file to $ftp_server as
> $destination_file";
> }
>
> //Even the ftp_close(function fails and causes an error);
> // close the FTP stream
> ftp_close($conn_id);
> ?>
>
> Are the ftp functions depreciated? I have taken this example directly
> from the manual and editted the values to reflect my own situation but
> none of the function calls have been editted. Usually when this is the
> case I have just over looked something VERY simple and easy, please take
> a look and see what you can come up with.
>
> I would even be happy with an FAQ, I have been through the one on
> PHP.NET with no joy   \C:
>
> PHP is the lastest release running on Mandrake 8.1 (w / plenty of
> horsepower)
>
> Thank you for your time.
> ~Curt~
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] easy quickie..

2002-01-03 Thread Jim Lucas [php]

$GLOBALS['HTTP_REFERER']

Jim
- Original Message -
From: "Kelly Meeks" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 02, 2002 10:15 AM
Subject: [PHP] easy quickie..


Happy New Year,

Does php set a variable that tells you the url of the page that a user has
just come from?  So if I wanted to create my own 'Back' button in a pop up
window, for instance?

Thanks in advance,

Kelly

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Regular Expression

2002-01-03 Thread Jim Lucas [php]

I have seen this question reposted for the past week.  now why don't you
just work with the entire thing.

get the ""

now once you have that, do this

$str = preg_replace("", "", $str)

now your $str var will only have the properties.

Jim
- Original Message -
From: "[-^-!-%-" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 02, 2002 12:45 PM
Subject: [PHP] Regular Expression


>
> Hello everyone!
>
> I'm trying to get the text inside the  tag, using regular
> expression.
>
> $area = eregi('()',$str);
>
> Where $str is the string containing
> 
>
> When I print  $area, the string contains the entire content of $str. I
> get something like:
>
> 
> 
> .
> .
> .
> 
> 
>
>
>
> __John Monfort_
> _+---+_
>  P E P I E  D E S I G N S
>www.pepiedesigns.com
> "The world is waiting, are you ready?"
> -+___+-
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Sessions Problems!

2001-12-31 Thread Jim Lucas [php]

when you say that nothing  changed, does that include permissions on the tmp
session directory, the httpd.conf file or any related configurations?

Jim
- Original Message -
From: "Phillip M.(Mike) Bishop" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 31, 2001 2:58 AM
Subject: [PHP] Sessions Problems!


> I am having problems with my sessions. I authenticate the user against a
> mysql db. The authentication works fine and the session script works fine
> for all my other domains except one. They all reside on the same webserver
> using the same session class. The problem I have is when the user logs in,
> they get to the first page. When they go to another page they have to
> relogin.  The session file is created but it is empty. This script worked
> fine on this domain until Friday. Nothing has changed what could be the
> cause of this.
>
> Thanks in advance for any insight into this problem.
>
> Mike
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Select box won't display in Netscape 4.xx

2001-12-31 Thread Jim Lucas [php]

check and make sure the you have the correct opening and closing form tags.
NS 4.x will "choke" if you don't have an opening and closing tag.  While IE
5, 5.5 and 6 will work fine.

Jim
- Original Message -
From: "Edwin Boersma" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 31, 2001 3:06 AM
Subject: [PHP] Select box won't display in Netscape 4.xx


> Hi,
>
> I'm developing a website for multiple browsers. In Netscape 4.xx (both
> Win98 and Linux versions), the php-scripts display the select boxes in
> my forms only as plain text. I cannot make any selections. In other
> browsers (NS 6 and IE5), it works fine.
>
> Anyone seen this behavior before?
>
> Regards,
> Edwin
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] File upload memory useage.

2001-12-29 Thread Jim Lucas [php]

Well, I just finished a ftp program that originally used php to catch the
uploaded file, but soon realized the it did load it into memory then dump it
into a file.  I finally ended up using perl running with xinetd to capture
the uploaded file and drop it into a file.  then let php play with it from
there.

Jim
- Original Message -
From: "Jim Broughton" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, December 29, 2001 10:30 AM
Subject: [PHP] File upload memory useage.


> I am involved with creating a website (i am the systems guy not the
> website programmer) on an older computer, a p133 with 80meg of
> ram. Since php is by default loaded with apache in the slackware
> installation I have chosen.  I have told the website programmer that he
> will have to use php for file uploads to the site as mod_perl is eats too
> much system ram. I have to have setup that will allow the uploading of
some
> fairly large files > 50mb
> Because this is NOT clear in the php manual on file
> uploading I need to know if php uploads the file to a memory cache first
> then flushes the uploaded data to the chosen uploads directory or whether
it
> writes the file to disk as it is being uploaded?
>  If it is the former I will have to look at another solution.
>
> JIM
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] is_uploaded_file

2001-12-28 Thread Jim Lucas [php]

take a look at this little function.. :)  you might like it

http://www.php.net/manual/en/function.function-exists.php

- Original Message -
From: "Andrey Hristov" <[EMAIL PROTECTED]>
To: "Paul Roberts" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, December 28, 2001 7:35 AM
Subject: Re: [PHP] is_uploaded_file


> I had 4.0.0 for a year or more and used that stuff quite well.
> And the docs says :
> "For earlier versions of PHP, you'll need to do something like
>   the following.
>
> Note: This will not work in versions of PHP 4
> after 4.0.2. It depends on internal functionality of PHP which
> changed after that version."
>
>
> If one of your boxes is 4.0.2 and the other 4.0.3 use the output of
phpinfo() with some kind of hack to determine wich one of the
> function to use, or just write a wrapper which decides pipe to which
function to make.
>
>
> Regards,
> Andrey Hristov
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Exec as user

2001-12-27 Thread Jim Lucas [php]

I don't believe that the system variables are available to php.  I work on
*nix mostly, but I have a windows machine at home running php and I can't
access any of my system var's.
- Original Message -
From: "charlesk " <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 27, 2001 11:33 AM
Subject: [PHP] Exec as user


> I have been looking through the docs and found no help on either finding
which user the EXEC'ed commands run as, or how to specify which user they
should run as.  I tried exec, system, and passthru running a batch file that
would write %USERNAME% to a file.  And all three functions wrote nothing.
They would however write "hello world".  Has anybody else run into this.
>
> I tried exec("test.bat");
> test.bat:
> echo %USERNAME% > test.txt
>
> when run from a command line it resulting in "Charles"
> when run from a webpage it resulted in "ECHO is on."
> if I added a line "echo off" above the echo username it resulted in "ECHO
is off." again only from the webpage.
>
> In essense I need to update a DNS server through a web page.  It works if
the script is local but not if it has to update a different server.
>
> Charles Killmer
> Windows 2000 Server, IIS 5.0, PHP 4.1.0
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Translating email to (real) plain text...

2001-12-27 Thread Jim Lucas [php]

and this
http://www.php.net/manual/en/function.imap-fetchstructure.php

- Original Message -
From: "David Bouw" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, December 27, 2001 11:44 AM
Subject: [PHP] Translating email to (real) plain text...


> Hi there,
>
> I would like to ask some suggestions on my following problem:
>
> I am making a small tool which allows you to store incomming mail in a
database table.
> This mail is then scanned on keywords etc etc and with the help of some
status bits the
> priority
> is given. Via a webpage interface, people can then answer these emails...
>
> I started out by creating a extra Mailbox to which I route all the
incoming mail. With the
> help of
> a Cron-Job which runs a PHP class made by Manual Lemos to retrieve POP
mail I retrieve the
> mail and
> insert it into a database table (MySQL)
>
> So far so good! Only problem which I have is that some (=most) people
create email with
> clients that
> output email with HTML codes (Internet Explorer for example)..
>
> I am not really interested in any attachment, pictures etc which are sent
with the email,
> only the plain
> email body is important.
> For emails that contain HTML tags, I think that stripping the HTML tags
will do enough for
> me..
>
> I do though have a problem when dealing with emails in which text is
Mime-encoded.
> The Mime_Class from Manual encodes everything for example..
>
> Before I spend a great deal of time making some code which can decode and
strip all the
> diferent email-client formats, isn't there a class out there which can get
me the plain
> text email body out of a raw retrieved email..??
> The Mailling-list archives of this PHP maillinglist at
> http://marc.theaimsgroup.com/?l=php-general for example contains very
nicely stripped
> emails of all the members..
>
> Does anyone khow this is done..?
>
> Thanks in advance for any help..
>
> With kind regards..
>
> David Bouw
>
> PS: To give some examples of problems I see in the retrieved mail I have
quoted some
> pieces:
>
> --

> --
> //A stripslashes will do a lot for me..
>
> --=_NextPart_001_0071_01C18105.33ABC800
> Content-Type: text/plain;
> charset="iso-8859-1"
> Content-Transfer-Encoding: quoted-printable
>
> This is a mail send to myself
>
> --=_NextPart_001_0071_01C18105.33ABC800
> Content-Type: text/html;
> charset="iso-8859-1"
> Content-Transfer-Encoding: quoted-printable
>
> 
> 
>  http-equiv=3DContent-Type>
> 
> 
>
> --

> --
> //I can probably us mime_decode, but I think that this will take quite
some hours to
> code..
>
> This is a MIME encoded message.
> Created by html_mime_mail.class.
> See http://www.heyes-computing.net/scripts/ for a copy.
>
> --=_7c76c35e24d83834b9c31a94ad6407ca
> Content-Type:
multipart/alternative;boundary="=_c15b829df5ff4f43680605bb761b564f
> "
>
>
> --=_c15b829df5ff4f43680605bb761b564f
> Content-Type: text/plain
> Content-Transfer-Encoding: base64
>
>
PFBSRT5CZXN0ZSBQYXRyaWMgVmVyaG9ldmVuLAoKV2lqIHdpbGxlbiB1IGdyYWFnIGRlIHN0YXR1
^M
> cyB2YW4gdXcgYmVzdGVsbGluZyBkb29yZ2V2ZW4uClV
> --

> --
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Translating email to (real) plain text...

2001-12-27 Thread Jim Lucas [php]

I was just reading the other day the php has imap function that give you the
ability to get only the body of the message.  have your cron job get that
and then strip HTML tags on that.  Don't see why that wouldn't work.

http://www.php.net/manual/en/function.imap-body.php

Jim
- Original Message -
From: "David Bouw" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, December 27, 2001 11:44 AM
Subject: [PHP] Translating email to (real) plain text...


> Hi there,
>
> I would like to ask some suggestions on my following problem:
>
> I am making a small tool which allows you to store incomming mail in a
database table.
> This mail is then scanned on keywords etc etc and with the help of some
status bits the
> priority
> is given. Via a webpage interface, people can then answer these emails...
>
> I started out by creating a extra Mailbox to which I route all the
incoming mail. With the
> help of
> a Cron-Job which runs a PHP class made by Manual Lemos to retrieve POP
mail I retrieve the
> mail and
> insert it into a database table (MySQL)
>
> So far so good! Only problem which I have is that some (=most) people
create email with
> clients that
> output email with HTML codes (Internet Explorer for example)..
>
> I am not really interested in any attachment, pictures etc which are sent
with the email,
> only the plain
> email body is important.
> For emails that contain HTML tags, I think that stripping the HTML tags
will do enough for
> me..
>
> I do though have a problem when dealing with emails in which text is
Mime-encoded.
> The Mime_Class from Manual encodes everything for example..
>
> Before I spend a great deal of time making some code which can decode and
strip all the
> diferent email-client formats, isn't there a class out there which can get
me the plain
> text email body out of a raw retrieved email..??
> The Mailling-list archives of this PHP maillinglist at
> http://marc.theaimsgroup.com/?l=php-general for example contains very
nicely stripped
> emails of all the members..
>
> Does anyone khow this is done..?
>
> Thanks in advance for any help..
>
> With kind regards..
>
> David Bouw
>
> PS: To give some examples of problems I see in the retrieved mail I have
quoted some
> pieces:
>
> --

> --
> //A stripslashes will do a lot for me..
>
> --=_NextPart_001_0071_01C18105.33ABC800
> Content-Type: text/plain;
> charset="iso-8859-1"
> Content-Transfer-Encoding: quoted-printable
>
> This is a mail send to myself
>
> --=_NextPart_001_0071_01C18105.33ABC800
> Content-Type: text/html;
> charset="iso-8859-1"
> Content-Transfer-Encoding: quoted-printable
>
> 
> 
>  http-equiv=3DContent-Type>
> 
> 
>
> --

> --
> //I can probably us mime_decode, but I think that this will take quite
some hours to
> code..
>
> This is a MIME encoded message.
> Created by html_mime_mail.class.
> See http://www.heyes-computing.net/scripts/ for a copy.
>
> --=_7c76c35e24d83834b9c31a94ad6407ca
> Content-Type:
multipart/alternative;boundary="=_c15b829df5ff4f43680605bb761b564f
> "
>
>
> --=_c15b829df5ff4f43680605bb761b564f
> Content-Type: text/plain
> Content-Transfer-Encoding: base64
>
>
PFBSRT5CZXN0ZSBQYXRyaWMgVmVyaG9ldmVuLAoKV2lqIHdpbGxlbiB1IGdyYWFnIGRlIHN0YXR1
^M
> cyB2YW4gdXcgYmVzdGVsbGluZyBkb29yZ2V2ZW4uClV
> --

> --
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Warning: Cannot send session cookie

2001-12-26 Thread Jim Lucas [php]

take the closing php tag from the end of the first line plus the openning
tag from the begining of the second line.  that is sending a line feed to
the browser.
Jim
- Original Message -
From: "David Jackson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, December 26, 2001 5:54 PM
Subject: [PHP] Warning: Cannot send session cookie


> Greetings --
> PHP + MySQL + sessions?
>
> I'm trying use the script( and html page) to below to set session
> variables, but
> keep getting the follow errors:
> NOTE: I seen several posting re: using $HTTP_SESSION_VAR is another case
> where
> that would apply?
>
> Thanks in advance,
> David Jackson
>
>
>  Browser Error Messages -
> Warning: Cannot send session cookie - headers already sent by (output
> started at
> /home/sites/site13/web/connect.php:13) in
> /home/sites/site13/web/frontdesk/sales/login.php on line 15
>
> Warning: Cannot send session cache limiter - headers already sent (output
> started at
> /home/sites/site13/web/connect.php:13) in
> /home/sites/site13/web/frontdesk/sales/login.php on line 15.
>
>
> --- login.php -
>
>
> 
>  $result = mysql_query("SELECT uid,uname,uperms FROM guestusers
> WHERE uname = '$uname'
>AND upass = PASSWORD('$upass')");
>
> if (mysql_num_rows($result)!=1) {
> echo "Dis ain't good !!\n";
>
> mysql_free_result ($result);
> mysql_close($link);
>
> } else {
> // start session
> session_start();
> session_register("Uid");
> session_register("Uname");
> session_register("Uperms");
>
> // parse out query output and resign to session vars
> list($uid,$uname,$uperms) = mysql_fetch_row($result);
> $Uid = $uid;
> $Uname = $uname;
> $Uperms = $uperms;
>
> // redirect to main menu page
> mysql_free_result ($result);
> mysql_close($link);
>
>
>
> - login.html 
> 
> 
> Generic Time Tracker
> 
> Sales Entry Login screen:
> 
> 
> 
> Username:
> 
> 
> 
> Password
> 
> 
> 
>  value="Enter">
> 
> 
> 
> 
> 
>
> --
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] mysql_escape_string

2001-12-26 Thread Jim Lucas [php]

where is the escaping happening first off?

- Original Message - 
From: "phantom" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, December 26, 2001 2:02 PM
Subject: [PHP] mysql_escape_string


> How do I remove the slashes from mysql_escape_string when I pull the 
> string back out of the DB and want to display it?
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] faxing in PHP

2001-12-24 Thread Jim Lucas [php]

hylafax
I am working on a project right now to set this up on a linux box.  Should
work great.

Jim
- Original Message -
From: "LDL Enterprise" <[EMAIL PROTECTED]>
To: "*PHP-General mail list" <[EMAIL PROTECTED]>
Sent: Monday, December 24, 2001 12:15 PM
Subject: [PHP] faxing in PHP


> Hi,
>
> Is there a way to send to a fax machine like you would a email address
> in PHP.
>
>
> Thanks for any help you can give. :-)
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Changing "From" Info in eMail!

2001-12-24 Thread Jim Lucas [php]

what does the $from var look like?
- Original Message - 
From: "Thomas Edison Jr." <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 24, 2001 10:35 AM
Subject: [PHP] Changing "From" Info in eMail!


> Hi,
> 
> I'm using the mail() function to send email. However,
> when the reciever recieves the email, my Servers name
> comes up in the "From" in his MailBox and also inside
> the email, even after defining the "From: " in the
> mail function. How do i change this From info??
> 
> This is what i'm using :
> mail($to, $subject, $message, "From: $from");
> 
> Thanks!
> T. Edison jr.
> 
> 
> =
> Rahul S. Johari (Director)
> **
> Abraxas Technologies Inc.
> Homepage : http://www.abraxastech.com
> Email : [EMAIL PROTECTED]
> Tel : 91-4546512/4522124
> ***
> 
> __
> Do You Yahoo!?
> Send your FREE holiday greetings online!
> http://greetings.yahoo.com
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Reading semi formatted text file

2001-12-24 Thread Jim Lucas [php]

$delimiter = "\t";

$file = "path/to/file/name.ext";
if($file = fopen($file, "r"))
{
$file_array = file($file);
foreach($file_array AS $str)
{
$new_array[] = explode($delimiter, $file_array);
}
}

now when you are done you will have an indexed array called new_array that
contains your rows broken up into key=>value pairs.

Jim
- Original Message -
From: "Chris Steitz" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 24, 2001 9:12 AM
Subject: [PHP] Reading semi formatted text file


201  PNCPS FINANCIAL ACCT   10027 3   8.00- 8.50  MWFGSB 400

I have a text file with rows similar to that above. I need to read the data
in the rows into an array. fscanf likes to split the line into elements by
spaces and I get

201,PNCPS,FINANCIAL,ACCT etc...

and I need results like

201,PNCPS FINANCIAL ACCT,10027 etc...

data[1]=201
data[2]=PNCPS FINANCIAL ACCT
data[3]=10027
data[4]=3
data[5]=8.00
data[6]=8.50
data[7]=MWF
data[8]=GSB 400

Can anybody provide any help on how to do this?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]