[PHP] Reading Text file by line

2003-02-24 Thread Anthony
I need to read a text file by line, if I open the file and use fgets() then
it doesn't pick up the EOL corretly.  So I was planning on reading the whole
file in with fread() and then breaking it up by EOL characters.  My question
is, how do I do it?  What character do I search for in the string?  Anyone
have a simple example on how to do this?  Thanks.



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



[PHP] OT? Dynamic Page Setup in IE please help

2003-03-14 Thread Anthony
I'm gonna post this in some Microsoft list too, but I'm hopping someone here
might be able to help me out.  I have a few situations where users will need
to print from my app.  The browser they are using will be IE.  What I'd like
to be able to do is through some type of scripting remove the header and
footer on the page setup in IE.  I can do this manually, and get the result
that I want, but I need to be able to do it dynamically, without user
intervention, and have the settings change only occur for the page that is
being printed.  I've tried using other methods, like html2pdf, and it works,
but I can't bring over the proper formatting to the PDF file.  What I
specifically want to remove is the"&w&bPage &p of &P" clause that is in the
header and the "&u&b&d" in the footer of file->page setup in IE.  this is
what causes the page title and  page number to print on the top of printed
web pages, and the URL to print in the footer.

Thanks for any help you could give, or if you could point me to a better
place to discuss this I'd appreciate it.  Thanks :)

- Anthony



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



[PHP] Quick ? ... how come this doesn't work?

2003-07-02 Thread Anthony
I'm trying to get the 1st and last day of the current week.  I ty to do
this:
$startofweek = date("Y-m-d",mktime (0,0,0,date("m")
,date("d")-date("w"),date("Y")));
$endofweek = date("Y-m-d",mktime (0,0,0,date("m")
,date("d",strtotime($startofweek))+6,date("Y")));
echo $startofweek." --- ".$endofweek;

$startofweek is correct, but if you run it for a week that has it's
beginning date in an other month (like this week), the $endofweek  is in the
wrong month.  What gives?  If I change -date("w") to -1 or anything else
that stays within the current month, it works.  What do you think?  Is there
a better way to do this?

- Anthony



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



[PHP] Re: php my sql question

2003-07-03 Thread Anthony
When you upload the page to the webserver and then access it, do you just
see the source?  If so then you probably don;t have PHP support as part of
your hosting package.  Call your web host and find out.  Also, if you're
really new to PHP, I'll through this out too, you did put 
arround your script right?  Once you're sure PHP is running, then check out
the online manual for MySQL functions -->
http://us2.php.net/manual/en/ref.mysql.php  You don't need PHP on your local
machine, just on the webserver.  It may be a good idea though to install a
webserver (like Apache) and PHP on your local machine, that way you can test
your scripts without uploading them to the webserver.

- Anthony


"Jerome A. Jackson/Ac/Vcu" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I have a web site that has my sql installed.  The web server is 1st host
> web and they do not provide much support other than referral to my sql
> and php web site.  I know how to set up a database from a text file then
> upload to an sql database.  Now I want to write code to make it open and
> access it.  This is where I am stuck.  The web site uses an apache
> server.  Must I install php on my local machine?  When I save a web page
> with a php extension, it defaults to an html page and it will not work
> when I upload.
>
> --
> Jerome A. Jackson
> Information Services Coordinator
> Advancement Services
> Virginia Commonwealth University
> Post Office Box 842026
> Richmond, Virginia 23284-2026
> Phone: 804-828-2043  Fax: 804-828-0884
>
>



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



[PHP] Re: Calculating Largest Member of Array

2003-07-03 Thread Anthony
why not just change your array structure a little so that the date is the
key, and the elements are the values.  so it would look like this.
Array
 (
 [Jan-99] => Array
 (
 [0] => 6399.36
 [1] => 6132.71
 [2] => 2242.20
 [3] => 53.27
 [4] => 87.34
 )

 [Feb-99] => Array
 (
 [0] => 5754.72
 [1] => 3964.93
 [2] => 6145.98
 [3] => 693.32
 [4] => 23.80
 )
 )
That would make it much easier. I think.

- Anthony


"John Wulff" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Sorry for the multiple post!! Apparently when pasting I hit some magic
send
> key.I'd like to calculate the largest member of this array without taking
> into
> account the first value which is obvisouly not numeric.
>
> So far this is how I'm doing it, but sometimes I get returned a month for
> the max.
>
> $high = end(array_reduce($cdata,
>   create_function('$a, $b',
>   'return array(max(array_reduce($a, "max"),
>   array_reduce($b, "max")));')));
>
> Array
> (
> [0] => Array
> (
> [0] => Jan-99
> [1] => 6399.36
> [2] => 6132.71
> [3] => 2242.20
> [4] => 53.27
> [5] => 87.34
> )
>
> [1] => Array
> (
> [0] => Feb-99
> [1] => 5754.72
> [2] => 3964.93
> [3] => 6145.98
> [4] => 693.32
> [5] => 23.80
> )
> )
>
>
>



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



[PHP] Re: dynamic form display??

2003-07-03 Thread Anthony
PHP is not what you're looking for here.  You'll want to use something like
JavaScript.  I'm assuming that you want to do this on the browser side so
that you'll upload all the files at once.  If that is the case, PHP won't
know anything about it since it's a server side language.  I've seen things
like this done in JavaScript before and seen really cool ones that are IE,
vbs only.  Look in that dirrection.

- Anthony


"Micah Montoy" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On the form that I am creating I allow the user to browse for a file.  I
> would like it that once the user selects the file, that it displays only
the
> file information in a  on the same page.  The idea is that the
> user can keep browsing and selecting files and the file information
> (location and name) is transferred further down the page in the textarea.
> Once the user is done, they click on a submit button which then loads all
> the files from either the textarea into the database.  I've seen something
> like this done with both ASP and ColdFusion but not PHP.
>
> Basically its like this:
> 1. Browse for a file
> 2. find file and select the file and click OK
> 3. The file information is moved from the browse file text box to the
> textarea
> 4. The user then searches for another file like above and the new file is
> added underneath the file already in the textarea.  The process repeats
> until the user is done.
> 5. The user then clicks the Submit button which loads the files in the
> textarea into the database
>
> Any snippets of code or known likeness would be greatly appreciated.  One
> other thing.  I'm fairly new to PHP so, please comment the code if you
> would.
>
> thanks a bunch
>
>



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



[PHP] Re: PHP + Linux: Configuration?

2003-07-03 Thread Anthony
Not 100% sure, but isn't $HTTP_POST_VARS depricated?... to lazy to look in
the manual right now.  You should use $_POST instead.  I have no idea if
that's causing your problem though :-P

- Anthony


"Luiz Morte" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hello list,

I have a problem using php in linux. I´m using the code bellow:

html code:

 
 


php code
",count($linhas));
?>

If I repeat the line bellow 100 times and put this in a textarea, the php
code returns that there are 154 lines.
teste.com.br::Teste
variaveis::teste::teste::dfasfafasdfafasdfasfas::11::11::ativo::teste.do.tes
te

I´ve made this test using the versions:
php-4.2.2-17
php-4.3.2-3

Using FreeBSD, I don´t have the error with the same code. (php-4.3.1)

Any ideia?
Thanks in advance,
Luiz.



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



Re: [PHP] Get Rid of this Crook

2003-07-03 Thread Anthony
pathetic isn't it  :-/

- Anthony


"Doug Essinger-Hileman" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On 3 Jul 2003 at 9:06, Adam Voigt wrote:
>
> > Well spamming doesn't get them any money. I believe
> > I read they use this info to transfer money from your bank
> > account, after convincing you to scan your passport for
> > them, or something like that.
>
> Actually, the scam is fairly sophisticated. They ask for money
> upfront in order to begin the process of getting access to the loot
> that is stored whereever. Usually, they ask for one or two more
> payments, since it is costing them more than they thought. They then
> inform you that the money you sent them has been used to bribe
> officials, including those in the government. If you don't send them
> even more money, they will report you to the authorities on suspicion
> of bribery and have you arrested.
>
> At this point, the scam becomes simple blackmail. Most interesting to
> me is that this scam is so widespread (a sign that it is successful)
> that the FBI has stationed some agents in Nigeria solely for the
> purpose of dealing with this scam. Apparently, there are some folk so
> greedy that gullibility wins the day.
>
> Doug
>



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



[PHP] Re: web based mail client

2003-07-03 Thread Anthony
In addition to using an elready developed web mail client.  If you plan to
have a large number of users, you might want to go with some type of
completely managed packaged software.  I was reading about Novell NetMail.
Check it out, even runs on Linux now too -->
http://www.novell.com/products/netmail/  Don't know how customiseable it is
or if you could use PHP to extend it, but its worth a look.

- Anthony


"Pete Morganic" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> There's loads of email clients here
>
>
http://www.hotscripts.com/PHP/Scripts_and_Programs/Email_Systems/Web-based_E
mail/index.html
>
> Greg Brant wrote:
> > hi, im the lead developer for a small online magazine / community
> >
> > we want to set up an e-mail service where our users can create their own
> > mail account similar to hotmail etc etc.
> >
> > i plan on using the imap_ functions and i was just wondering about the
> > potential security issues related to theses functions.
> >
> > any advice or tips would be appreciated.
> >
> > many thanks
> >
> > Greg Brant
> >
> >
>



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



[PHP] Re: Please Help !

2003-07-08 Thread Anthony
look up two functions in the online manual.  strtotime() and date()
strtotime will give you a unix timestamp for just about any date possable,
date will format it the way you need.  to get it into a mySQL date field,
basicaly, you do this:

date("y-m-d", strtotime($_POST['date']))

where $_POST['date'] is whatever variable you used.

- Anthony


"Sean O'Reilly" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> I know this is really basic but i have a form for users to enter the
> date of an event that i would like to store in a mysql database how do i
> get the users input into the database in the right format.
>
>
>



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



[PHP] Please dirrect me -- headers ????

2003-07-14 Thread Anthony
This isn't necessarily PHP specific, but I'm looking for more information on
HTTP headers.  I'd like to know what headers I should send and why.  I want
my code to send out w3c compliant HTML.  I'm confused on exactly what
headers do, and the difference between HTTP headers and information
contained within the  tag.  Multiple google searches have gotten me
only more confused.  Someone please send me in the right direction :)

on an a possible similar note, I have a domain name www.mydom1.com  and when
the user goes to it, I want it so say www.mydom.com in the browser address
bar.  Can I do this by sending certain headers? (I have both domains
pointing to the same server) ... should/could I do something like this
through PHP or is there something I can set in Apache to do the same thing?

Simply confused,
- Anthony



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



[PHP] Re: Strange Problem

2003-07-14 Thread Anthony
You'll get this in IIS if you request a page that should be parsed by the PHP CGI that 
does not exist.  IIS trys to load the script into the CGI but gets no results since 
there was no page to load.  I think it's an IIS bug i.e.   you go to  
www.domain.com/page1.php
but there is no page1.php file.  So you'd expect to get a 404 error.  but IIS gives 
you the CGI error instead.  Kinda sucks, I just use Apache now anyway, so I never 
spent the time to figure out why.

- Anthony
  "Haseeb" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]


Hi all, 
this is a very strange problem. i don't know where i am doing something that 
is causing this. the problem is that i am working on a web portal  entirely in  php. i 
have a few hidden pages. that do the queries to the DB. now when i redirect to any 
page for query i get this error
CGI Error
The specified CGI application misbehaved by not returning a complete set of 
HTTP headers. The headers it did return are:

strangely  when i hit F5 or refresh the page i get redirected to the desired 
page. i have checked for any whitespaces. there are none. i have checked and double 
checked this. i am using win2k,IIS, php 4.3.0

again i have checked all the files for any space left that could be causing 
problem but i found none.

i hope i make my self clear.
Haseeb
   
   
   
  
IncrediMail - Email has finally evolved - Click Here

Re: [PHP] Please dirrect me -- headers ????

2003-07-14 Thread Anthony
Thanks for the links, I'm going through them now
as far as the location thing.  I don't acutaly want to send the user to a
different site, I just want to change what apears in the user's address bar.
in my example, both www.mydom1.com and www.mydom.com point to the same site
and weberver.  It's simply that one is the old address, and I want users to
see teh new address, even if they type in the old one.

- Anthony

"Ryan Gibson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> Headers have nothing to do with the  tag, the headers are sent
before
> the html page, ie they are not part of the html document, but something
sent
> by the web server before the page is sent to the user
>
>
> Try:
>
> http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
>
> And
>
> http://www.cs.tut.fi/~jkorpela/http.html
>
> As for question 2, if you want to redirect the user to the other website
use
> the location header to redirect them to the other site (otherwise you'll
> have to redirect them to the other site, then use frames to open the
content
> on the original site)
>
>
> On 14/7/03 5:16 pm, "Anthony" <[EMAIL PROTECTED]> wrote:
>
> > This isn't necessarily PHP specific, but I'm looking for more
information on
> > HTTP headers.  I'd like to know what headers I should send and why.  I
want
> > my code to send out w3c compliant HTML.  I'm confused on exactly what
> > headers do, and the difference between HTTP headers and information
> > contained within the  tag.  Multiple google searches have gotten
me
> > only more confused.  Someone please send me in the right direction :)
> >
> > on an a possible similar note, I have a domain name www.mydom1.com  and
when
> > the user goes to it, I want it so say www.mydom.com in the browser
address
> > bar.  Can I do this by sending certain headers? (I have both domains
> > pointing to the same server) ... should/could I do something like this
> > through PHP or is there something I can set in Apache to do the same
thing?
> >
> > Simply confused,
> > - Anthony
> >
> >
>
> Ryan Gibson
> ---
> [EMAIL PROTECTED]
>



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



Re: [PHP] Please dirrect me -- headers ????

2003-07-14 Thread Anthony
yes, I can edit the httpd.conf file.  I'm looking in the Apache 2.0 docs and
can't find the server directive.  Also, to my knowledge and according to the
docs, "alias mydom.com" is invalid.  "Alias URL-path
file-path|directory-path" is how the docs explain it.  Am I missing
something.  If I can do this through Apache. it would probably be much
simpler.

- Anthony   Apache 2.0.45  by the way :)

"Taylor York" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Cant you edit the httpd.conf?
> I know there might be plenty of reasons why not to...but im just checking.
> =)
>
> Server mydom1.com
> Alias mydom.com
>
>
> "Anthony" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Thanks for the links, I'm going through them now
> > as far as the location thing.  I don't acutaly want to send the user to
a
> > different site, I just want to change what apears in the user's address
> bar.
> > in my example, both www.mydom1.com and www.mydom.com point to the same
> site
> > and weberver.  It's simply that one is the old address, and I want users
> to
> > see teh new address, even if they type in the old one.
> >
> > - Anthony
> >
> > "Ryan Gibson" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > > Hi,
> > >
> > > Headers have nothing to do with the  tag, the headers are sent
> > before
> > > the html page, ie they are not part of the html document, but
something
> > sent
> > > by the web server before the page is sent to the user
> > >
> > >
> > > Try:
> > >
> > > http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
> > >
> > > And
> > >
> > > http://www.cs.tut.fi/~jkorpela/http.html
> > >
> > > As for question 2, if you want to redirect the user to the other
website
> > use
> > > the location header to redirect them to the other site (otherwise
you'll
> > > have to redirect them to the other site, then use frames to open the
> > content
> > > on the original site)
> > >
> > >
> > > On 14/7/03 5:16 pm, "Anthony" <[EMAIL PROTECTED]> wrote:
> > >
> > > > This isn't necessarily PHP specific, but I'm looking for more
> > information on
> > > > HTTP headers.  I'd like to know what headers I should send and why.
I
> > want
> > > > my code to send out w3c compliant HTML.  I'm confused on exactly
what
> > > > headers do, and the difference between HTTP headers and information
> > > > contained within the  tag.  Multiple google searches have
gotten
> > me
> > > > only more confused.  Someone please send me in the right direction
:)
> > > >
> > > > on an a possible similar note, I have a domain name www.mydom1.com
> and
> > when
> > > > the user goes to it, I want it so say www.mydom.com in the browser
> > address
> > > > bar.  Can I do this by sending certain headers? (I have both domains
> > > > pointing to the same server) ... should/could I do something like
this
> > > > through PHP or is there something I can set in Apache to do the same
> > thing?
> > > >
> > > > Simply confused,
> > > > - Anthony
> > > >
> > > >
> > >
> > > Ryan Gibson
> > > ---
> > > [EMAIL PROTECTED]
> > >
> >
> >
>
>



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



[PHP] Re: Recovering from a time out

2003-07-18 Thread Anthony
change PHP's timeout value in php.ini :

max_execution_time = 30 ; Maximum execution time of each script, in
seconds
max_input_time = 60 ; Maximum amount of time each script may spend parsing
request data

don't know if you can have php do something like load a different script or
a basic HTML page on timeout.  That would be pretty cool though, anyone
know?

- Anthony

"Gerard Samuel" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Is it possible to *gracefully* recover from php timing out?
> For example, uploading a large file, and php times out, so display "Oops
> Timed out"
> This also assumes that we have no means of changing php's time out value??
>
> Thanks for your comments..
>



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



[PHP] Best PHP CMS

2003-08-05 Thread Anthony
I'm just looking for some opinions.  I've been going though sourceforge
looking at different CMS systems.  There are a lot of really good CMS
projects out there.  I'm looking for some opinions on the best ones out
there.  I'm obviously looking at something PHP based and using mySQL
backend.  Some of the features that I'd like are an easy template
implementation, blog features, media gallery and something that's easy to
build custom modules to add features.  So far I'm looking at about 6 CMS
systems, I like certain things in each of them. so what's your opinion.

- Anthony



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



[PHP] Re: Repopulating forms

2003-08-10 Thread Anthony
Opp... forgot this use htmlspecialchars( ) to fix it.  It will convert
your " to " for you.  So you code should look like this:
";
echo '';
?>


 
 



and it will work :)

- Anthony

Gerard L Petersen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi
>
> My code looks like this.
>
>  $test = "gerard's name is \"gerard\"";
> echo $test."";
> echo '';
> ?>
>
> 
>  
>  
>
> 
>
>
> When i run it the bit after the quotes are truncated. Where it truncates
> depends on what type of quote i am using.
>
> Any ideas?
>
> Thanks
>
> Gerard
>
>



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



[PHP] Re: Repopulating forms

2003-08-14 Thread Anthony
becasue your $test string contains double quotes.  This is casuing you to
end the value element in the input tag.

- Anthony

"Gerard L Petersen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi
>
> My code looks like this.
>
>  $test = "gerard's name is \"gerard\"";
> echo $test."";
> echo '';
> ?>
>
> 
>  
>  
>
> 
>
>
> When i run it the bit after the quotes are truncated. Where it truncates
> depends on what type of quote i am using.
>
> Any ideas?
>
> Thanks
>
> Gerard
>
>



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



[PHP] PDF Thumbnail with PHP?

2003-08-14 Thread Anthony
Does anyone know if there is a way to generate a thumbnail of the 1st page
of a PDF document using PHP.  I have an application that archives PDF files,
beeing able to generate small preview images of the documents would be
really cool :)

- Anthony



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



Re: [PHP] PDF Thumbnail with PHP?

2003-08-14 Thread Anthony
Unfortunatly, that's not what I'm trying to do.  That function will add an
image to a PDF file as a thumbnail.  What I want to do, is read a PDF file,
and generate a thumbnail in the form of a gif or jpg and have it display in
the browser.  Thanks for the thought though.

- Anthony


"Jay Blanchard" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
[snip]
Does anyone know if there is a way to generate a thumbnail of the 1st
page
of a PDF document using PHP.  I have an application that archives PDF
files,
beeing able to generate small preview images of the documents would be
really cool :)
[/snip]

This may be just what you are looking for
http://us3.php.net/manual/en/function.pdf-add-thumbnail.php

Have a pleasant and creative day!



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



[PHP] Need help with HTML2Pdf

2003-03-21 Thread Anthony
I need a lot of help trying to get HTML 2pdf to work.  If anyone here has
done it before, please drop me a line and help me out.  I have some
questions about capability and I simply can't seem to get it working.
Thanks.

- Anthony



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



[PHP] Re: Session Data

2003-03-21 Thread Anthony
Are you using something like $_SERVER['HTTP_HOST'] or $_SERVER['PHP_SELF']
to get the base URL for the app when doing the redirect? If you have the
whole URL typed in and switch from something like www.mydomain.com to
mydomain.com, the browser may think it's a different site and loose the
cookie with the session ID.
HTH :)
- Anthony

"Tony Bibbs" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I'm wrapping up an MVC implementation for PHP.  Everything is working
> splendidly except that redirects seem to be loosing session data. Here is
> the basic logic
>
> 1) on a form, user enters data hits submit
> 2) data validates OK, data is saved and $_SESSION['MVC_message'] is set to
> 'Save was successful'
> 3) After setting session data in step 2 above, a redirect is issued:
> header('Location: ' . $url);
> 4) The URL represented by $url within same app doesn't have any data in
> $_SESSION and I'm positive a session_destroy() isn't being called
> explicitly.
>
> The ideas here is to show a page with context information for the user.
>
> Any ideas why this isn't working?
>
> --
> Tony Bibbs  "I guess you have to remember that those who don't
> [EMAIL PROTECTED]  hunt or fish often see those of us who do as
> harmlessly strange and sort of amusing. When you
> think about it, that might be a fair assessment."
> --Unknown
>
>



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



[PHP] Quick Sessions ?

2003-04-04 Thread Anthony
I have an issue.  For some reason I can't pass session data to pages within
different folders.  What I have is a page in like
mydomain.com/something/somepage.php  This page creates session information
and holds it correctly.  The app collects user data and then eventualy sends
a location header to ../index.html <- in this file there is php that check
to see if the session data is there and. no longer there!!!  So what
gives?  Can I not pass session info from pages in folders?  I'm not changing
the domain, so I shouldn't loose the cookie I'm lost   Please help
me out :)

- Anthony



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



Re: [PHP] Quick Sessions ?

2003-04-04 Thread Anthony
yes, it parses PHP in html files.  The php code works.  I just loose the
session data when going from files in different folders.

- Anthony


"Mark Douglas" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Let's ask the dumb questions first:
>
> Is your webserver parsing .html files for PHP?
>
> -Original Message-
> From: Anthony [mailto:[EMAIL PROTECTED]
> Sent: Friday, April 04, 2003 3:03 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Quick Sessions ?
>
>
> I have an issue.  For some reason I can't pass session data to pages
within
> different folders.  What I have is a page in like
> mydomain.com/something/somepage.php  This page creates session information
> and holds it correctly.  The app collects user data and then eventualy
sends
> a location header to ../index.html <- in this file there is php that check
> to see if the session data is there and. no longer there!!!  So what
> gives?  Can I not pass session info from pages in folders?  I'm not
changing
> the domain, so I shouldn't loose the cookie I'm lost   Please help
> me out :)
>
> - Anthony
>
>
>
> --
> 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] Quick Sessions ?

2003-04-04 Thread Anthony
Thanks for the response.  I think I might just not totaly understand this
switch. This is right out of my php.ini file:

; The path for which the cookie is valid.
session.cookie_path = /

I tried deleting the / and got no change in behavior. It seems to me that
what I need is something like
session.cookie_path = /, ../
but that doesn't work.  Any other ideas?

- Anthony

"Jennifer Goodie" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Your cookie path is "" not "/" so your cookie is only readble by the
> directory it was set in.  Check your session.cookie_path
>
> http://www.php.net/manual/en/ref.session.php
>
> > -Original Message-
> > From: Anthony [mailto:[EMAIL PROTECTED]
> > Sent: Friday, April 04, 2003 12:03 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] Quick Sessions ?
> >
> >
> > I have an issue.  For some reason I can't pass session data to
> > pages within
> > different folders.  What I have is a page in like
> > mydomain.com/something/somepage.php  This page creates session
information
> > and holds it correctly.  The app collects user data and then
> > eventualy sends
> > a location header to ../index.html <- in this file there is php that
check
> > to see if the session data is there and. no longer there!!!  So what
> > gives?  Can I not pass session info from pages in folders?  I'm
> > not changing
> > the domain, so I shouldn't loose the cookie I'm lost   Please
help
> > me out :)
> >
> > - Anthony
> >
> >
> >
> > --
> > 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] Quick Sessions ?

2003-04-04 Thread Anthony
nope, same host I actually call the file by sending this :
header("Location: ../index.htm");
and I loose the session.

- Anthony

"Ernest E Vogelsinger" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> At 22:18 04.04.2003, Anthony said:
> [snip]
> >yes, it parses PHP in html files.  The php code works.  I just loose the
> >session data when going from files in different folders.
> [snip]
>
> Different folders, or different hostnames?
>
> PHP's ability to automatically add the SID to href's, as well as cookies,
> are limited to the same hostname.
>
> Example:
>
> www.myhost.com => /html/myhost/www/
> www.myotherhost.com => /html/myhost/www/
>
> These two couldn't share the same session, even if they reference the same
> physical directory.
>
>
> --
>>O Ernest E. Vogelsinger
>(\)ICQ #13394035
> ^ http://www.vogelsinger.at/
>
>



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



[PHP] easy conversion to a date?

2003-05-30 Thread Anthony
I have a form where the user enters a date into a text input field.  I need
to convert this text to a date and put it in a field in a mySQL database.
Is there an easy way to do this?  Do I have to tear the string appart and
create a date out of the parts?  Someone must have a fiunction that will do
this work already right?

Thanks for your help
- Anthony



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



Re: [PHP] easy conversion to a date?

2003-05-30 Thread Anthony
exactly what I'm looking for.  Thanks!

- Anthony

"Jordan S. Jones" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Anthony,
>
> I believe that what you are looking for is the following:
> http://www.php.net/strtotime
>
> Jordan
>
> Anthony wrote:
>
> >I have a form where the user enters a date into a text input field.  I
need
> >to convert this text to a date and put it in a field in a mySQL database.
> >Is there an easy way to do this?  Do I have to tear the string appart and
> >create a date out of the parts?  Someone must have a fiunction that will
do
> >this work already right?
> >
> >Thanks for your help
> >- Anthony
> >
> >
> >
> >
> >
>



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



[PHP] Error reporting at runtime

2003-06-25 Thread Anthony
I have error reporting turned off in my php.ini file on my production
server.  I have an app I'm writing that I need to run on the same server (no
one can see it though).  Anyway.  I want to turn on error reporting during
runtime for this particular app while I'm debugging it.  so I put
error_reporting (E_ERROR | E_WARNING | E_PARSE | E_NOTICE); in the script,
but I don;t see any warnings.  I also tried error_reporting(2047); or
error_reporting(8);  still nothing.  To sest it, I tried to echo some random
variable that doesn't exist in the very next line, but no warning about it.
So what gives?  What am I doing wrong?  Basicaly I want the same effect as
if I had error_reporting  =  E_ALL set in php.ini.

- Anthony



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



Re: [PHP] Error reporting at runtime

2003-06-25 Thread Anthony
Thanks.  That did the trick.  According to a post from Mike Ford, it was
ini_set( 'display_errors', 1 ); that was messing me up.  I have
display_error turrned off in php.ini too, so even though my reporting was
on, nothing was sent to the browser.  Thanks for the help guys :)

- Anthony


"Robert Cummings" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> This is hardly perfect since it shows all errors, but it works for me:
>
> ini_set( 'display_errors',   1 );
> ini_set( 'log_errors',   1 );
> ini_set( 'error_reporting', -1 );
>
>
> Anthony wrote:
> >
> > I have error reporting turned off in my php.ini file on my production
> > server.  I have an app I'm writing that I need to run on the same server
(no
> > one can see it though).  Anyway.  I want to turn on error reporting
during
> > runtime for this particular app while I'm debugging it.  so I put
> > error_reporting (E_ERROR | E_WARNING | E_PARSE | E_NOTICE); in the
script,
> > but I don;t see any warnings.  I also tried error_reporting(2047); or
> > error_reporting(8);  still nothing.  To sest it, I tried to echo some
random
> > variable that doesn't exist in the very next line, but no warning about
it.
> > So what gives?  What am I doing wrong?  Basicaly I want the same effect
as
> > if I had error_reporting  =  E_ALL set in php.ini.
> >
> > - Anthony
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> .-.
> | Worlds of Carnage - http://www.wocmud.org   |
> :-:
> | Come visit a world of myth and legend where |
> | fantastical creatures come to life and the  |
> | stuff of nightmares grasp for your soul.|
> `-'



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



Re: [PHP] Javascript and forms in PHP

2003-06-25 Thread Anthony
is all off you javascript making it to the browser?  check the source.  You
probably forgot to escape a quote somplace.  PHP really has noting to do
with javascript.

- Anthony

"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I understand perfectly well what PHP does.  That is why I am confused that
> if HTML including javascript within 

Re: [PHP] php.ini

2003-06-25 Thread Anthony

"Cpt John W. Holmes" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> - Original Message -
> From: "Jay Blanchard" <[EMAIL PROTECTED]>
> > [snip]
> > > I am running a red hat 9 linux box with Apache 1.3.27 with
> > > PHP 4 what is
> > >
> > > the default location for the php.ini file
> > [/snip]
> >
> > Create a page with just the following...
> >
> >  > phpinfo();
> > ?>
> >
> > place the page in your web root and access it through a browser. On
> > there you will find the path to your php.ini. The path is different for
> > differing distros and OS's and if it is CLI, CGI, or not.
>
> Also, as an FYI addition to this, if your PHP installation is not finding
a
> php.ini and using the defaults, you'll fine a _path_ to where PHP is
> expecting to find php.ini listed on the phpinfo() page. If a path to an
> actual php.ini file is listed, then that's the one it's using.
>
> ---John Holmes...
>

This is a good tip.  Having more than one php.ini file can mess you up when
you don't know about it.  Nothing like beating your head against the wall
wondering why things don;t work as they should :P

- Anthony



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



[PHP] Re: quotes

2003-06-25 Thread Anthony
tough to tell... but it looks like you have the " and ' mixed up before the
> in the end  :-P

- Anthony

"Lso ." <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> ok i see why i didnt work but i dont know why.
>
> can anyone tell me why this works:
>
>
>
> but this doesn't:
>
> echo "";
>
> Lucas Owens
> www.lucasowens.com
> www.technoiraudio.com
>
> _
> Add photos to your e-mail with MSN 8. Get 2 months FREE*.
> http://join.msn.com/?page=features/featuredemail
>



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



[PHP] Re: Install PHP on windows using PHP installler

2003-06-26 Thread Anthony
what webserver are you using?  If it's IIS, then use the installer... If
it's Apache, teh installer doesn;t work, you have to do it manualy.

- Anthony

"Mark McCulligh" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I am building a Windows 2000/PHP production server. I have only ever used
> LINUX for production and windows for developer machines.
>
> Is it better to install PHP using the PHP installer or using the Zip file
> version?
> Should you install PHP as CGI or ISAPI?
>
> I am looking for the pros and cons, someone told me not to use the PHP
> installer because it is not secure.
>
> Thanks,
> Mark.
>
>



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



[PHP] Where'd my session go??

2003-12-17 Thread Anthony
I've got an issue with an app I wrote.  I store some information about the
user and if they are logged into the app in session variables.  The problem
is that if they leave the app idle for a while ( about an hour) the session
information is lost, so the user is prompted to log back into the
application.  I checked session.cookie_lifetime and it's set to 0.  The
client side is IE 5.5 or 6.  What could be causing the session to be lost?
Thanks for your help :)

- Anthony

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



Re: [PHP] Where'd my session go??

2003-12-19 Thread Anthony
That was it! ... Thanks a lot bro.

- Anthony


"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> It's the garbage collector - session.gc_maxlifetime setting. The setting
> is server wide, unless you use your own session storage functions.
>
> Anthony wrote:
>
> > I've got an issue with an app I wrote.  I store some information about
the
> > user and if they are logged into the app in session variables.  The
problem
> > is that if they leave the app idle for a while ( about an hour) the
session
> > information is lost, so the user is prompted to log back into the
> > application.  I checked session.cookie_lifetime and it's set to 0.  The
> > client side is IE 5.5 or 6.  What could be causing the session to be
lost?
> > Thanks for your help :)
> >
> > - Anthony
> >

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



[PHP] Hi all & Help :D

2002-05-30 Thread Anthony

Hi all, this is my first post on the php news groups, and im sure it wont be
my last so I will first introduce my self, because im sure there are some
regualar posters ;)

My name is Anthony.. Im 14 years old and live in england, anything else you
want to know ask :)

Im working on a FTP uploader in php, but not for my own site, I want to
offer it was a service to so over people can upload to there sites using my
FTP script... but when you put the destonation (once they have connected) to
/ it trys to upload to a path in my site.. can any one explain why this is
and how to correct it, It would be aprechiated a lot, thanks




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




Re: [PHP] Hi all & Help :D

2002-06-01 Thread Anthony

I have sorted the problem, thanks for all the support


"Adam Voigt" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Try reversing the filelocations in your ftp_put, like
> if you have "remotelocation" and "mylocation", switch
> them to say "mylocation" then "remotelocation". Just
> a thought.
>
> Adam Voigt
> [EMAIL PROTECTED]
>
> On Thu, 2002-05-30 at 22:26, Anthony wrote:
> > Hi all, this is my first post on the php news groups, and im sure it
wont be
> > my last so I will first introduce my self, because im sure there are
some
> > regualar posters ;)
> >
> > My name is Anthony.. Im 14 years old and live in england, anything else
you
> > want to know ask :)
> >
> > Im working on a FTP uploader in php, but not for my own site, I want to
> > offer it was a service to so over people can upload to there sites using
my
> > FTP script... but when you put the destonation (once they have
connected) to
> > / it trys to upload to a path in my site.. can any one explain why this
is
> > and how to correct it, It would be aprechiated a lot, 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] what does -1.#IND mean?

2001-10-31 Thread Anthony

I have an equation that results in a floating point.  The equation has 
no errors and works fine most of the time.  When certain values are 
passed into the equation I get -1.#IND as the result.  I have tried 
using round() to limit the size of the number, this hasn't helped, I'm 
not ever sure if I'm overloading the floating point or what?  Please 
help me out here, I have a huge project that is totally done except for 
this bug and its driving me NUTZ!!!
   Thanks in advance for any help.

- Anthony


-- 
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] Re: Text Editor with Highlighting

2001-11-01 Thread Anthony

For Windows, hands down Homesite is the best

Td - Sales International Holland B.V. wrote:

> Hey there,
> 
> I looked on the site for this but couldn't find anything about it. I'd like a 
> list of your favorite text editors (preferable for Linux/XFree) with 
> highlighting. I'm using beaver now, I tried cooledit but it's not me... too 
> much functions and looks like it came from an old 386 :-). I have kde 2.1.2 
> which has kwrite, but it's kwrite does not yet support PHP, kde 2.2.1 does 
> but i don't wanna download the entire kde package. Besides i think it's still 
> in development I tried in on my laptop at home but it just makes things bold 
> instead of all kinds of different colors. also beaver colors for in plain 
> html and has some problems with correctly indentifying /* */ comments if you 
> use more of em. i'm also interested in windows though and i think more people 
> are interested so maybe somebody of the site might also want to keep track of 
> the list so it can be put online
> 
> regards
> 


-- 
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] Error with Netscape 6.2

2001-11-14 Thread Anthony

I get a CGI error whenever I view my php app under Netscape 6.  The 
error is:
CGI Error
The specified CGI application misbehaved by not returning a complete set 
of HTTP headers. The headers it did return are:

My question is, what are the headers that I need to send, where can I 
find more info on this?  The app works perfectly under IE, but not Netscape.

- Anthony


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

2001-12-11 Thread Anthony

I need some help with sessions.  I read the sections in the manual and 
searched for tutorials, but I still can't get a straight forward example 
of how sessions work.  I need to pass variables to a page that will load 
in a new browser window.  I used session_register, but when I look in 
the $HTTP_SESSION_VARS, it doesn't exist.  I tried using start_session 
and still no luck.  Once I get the session vars registered, how do I 
access them.  I am able to pass the session id as a var, I'm going it 
like page.php?sid=$.  Is there a better way, do I need to do 
this at all?  I'm confused as hell and can't find a working example 
anywhere. Help!

- Anthony


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

2001-12-11 Thread Anthony

thanks for the starter.  I have session.use_trans_sid = 1 in my php.ini, 
I also have session_start() at the beginning of both pages.  Now 
$HTTP_SESSION_VARS is there, but its a blank array. 
print_r($HTTP_SESSION_VARS); yields->  Array ( )
the code I have at one page is
$z=;
session_start();
session_register('$z');
I also tried without the quotes, still a blank array.  What am I doing 
wrong?  How do I make sure I'm starting the correct session in the new 
page?  I can get the session ID, but what do I do with it?



Steffan Packer wrote:

> You need to have
>  
> session_start();
> 
> at the top of each page that needs to use the session vars, also check that
> session.use_trans_sid is set to 1 in your ini file
> hope this helps!
> 
> -Original Message-
> From: Anthony [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, December 11, 2001 3:54 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] sessions
> 
> 
> I need some help with sessions.  I read the sections in the manual and 
> searched for tutorials, but I still can't get a straight forward example 
> of how sessions work.  I need to pass variables to a page that will load 
> in a new browser window.  I used session_register, but when I look in 
> the $HTTP_SESSION_VARS, it doesn't exist.  I tried using start_session 
> and still no luck.  Once I get the session vars registered, how do I 
> access them.  I am able to pass the session id as a var, I'm going it 
> like page.php?sid=$.  Is there a better way, do I need to do 
> this at all?  I'm confused as hell and can't find a working example 
> anywhere. Help!
> 
> - Anthony
> 
> 
> 


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

2001-12-11 Thread Anthony

Thank you very much, I got it to work.  What I didn't understand was 
that when registering the session var I was not registering the var's 
value, only the pointer.  This makes all kinds of sence now.  Thanks!

- Anthony

Steffan Packer wrote:

> You need to have
>  
> session_start();
> 
> at the top of each page that needs to use the session vars, also check that
> session.use_trans_sid is set to 1 in your ini file
> hope this helps!
> 
> -Original Message-
> From: Anthony [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, December 11, 2001 3:54 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] sessions
> 
> 
> I need some help with sessions.  I read the sections in the manual and 
> searched for tutorials, but I still can't get a straight forward example 
> of how sessions work.  I need to pass variables to a page that will load 
> in a new browser window.  I used session_register, but when I look in 
> the $HTTP_SESSION_VARS, it doesn't exist.  I tried using start_session 
> and still no luck.  Once I get the session vars registered, how do I 
> access them.  I am able to pass the session id as a var, I'm going it 
> like page.php?sid=$.  Is there a better way, do I need to do 
> this at all?  I'm confused as hell and can't find a working example 
> anywhere. Help!
> 
> - Anthony
> 
> 
> 


-- 
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] Running Programs.....

2001-09-25 Thread Anthony



Im trying to use PHP to execute a program, called J-Express, and its run 
through the command shell through ./J-Express.
What do I use in PHP so that this program will be automatically opened 
through my website. 
I have tried a whole variety of things, but cant seem to find anything that 
actually opens a program that the user can use.

Thanks

Anthony

-- 
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] Re: Calendar math .... how to count in week days....?

2004-05-14 Thread Anthony
The PEAR functions didn't seem to do what I was looking for.  I built this
function based on an idea given to me by  Daryl Meese.

After much trial and error, it actualy does what I need.  My function is
bassed on hours but you can easily change that.  It will add or subtract
days.
- Anthony

/* buisinessDays
 * Calculates a new date bassed on buisiness hours
 * vars: hours to adjust by, timestamp
 * returns: adjusted timestamp
 */
 function businessDays($hours,$date) {
  // this function assumes $date is a business day

  $dayHours=7.5; // set how many hours are in a day

  // set the days we need to adjust by.  there is a one day buffer
  $days=(abs($hours/$dayHours))+1;

  // weeks
  $adjust=604800 * floor($days / 5);

  // how many days are left over
  $remain=round($days % 5);

  // check for negative
  if ($hours<0) {
   // check to see if we will land on a weekend, and make appropriate
adjustment
   if (date("w",$date)<=$remain) {
$remain +=2;
   }
   // make the time adjustment, 8640 microseconds in a day, times the
remaining adjustment
   $date -=($adjust +(86400 * $remain));
  }
  else {
   // check to see if we will land on a weekend, and make appropriate
adjustment
   if ((6-date("w",$date))<=$remain) {
$remain+=2;
   }
   // make the time adjustment, 8640 microseconds in a day, times the
remaining adjustment
   $date +=($adjust +(86400 * $remain));
  }
  return $date;
 }

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



[PHP] Calendar math .... how to count in week days....?

2004-05-06 Thread Anthony
I've run into a bit of a problem, that I know has been dealt with before,
but I don't know how to deal with it.  Very simple, I have an application
that needs to do calendar math and do it specifically on business days.  I
need to be able to add and subtract a number of days to only Monday though
Friday.  Seems simple enough, but I can't figure out how to do it.  The only
think I've come up with so far is to build a function that counts every day
and checks to see if it's a weekend or not.  This wouldn't be all that hard
to do, but I'm wondering if there is a better way to do it?  Anyone have a
really efficient function to do this, I need to figure out a LOT of dates in
this app.

- Anthony

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



[PHP] Re: odbc functions - not binary safe?

2004-01-27 Thread Anthony
If you're connecting to the mySQL database through ODBC (why not just
connect directly to mySQL server?) ... then you probably have to escape with
a single quote.  For most ODBC drivers you escape ' with '' (two single
quotes) . took me a while to figure that one out, but works for me. :)

- Anthony

"C C" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> I'm trying to insert binary data into a MS SQL Server
> database. Text files are added fine, but binary files
> with null bytes are not. The field I'm adding the
> binary data to is image type. I get an error about
> unclosed quotation marks at the null byte, but I've
> replaced ' with ''.
>
> I tried escaping the null byte with a backslach, but
> it just changes it to the string "\0" when I download
> it.
>
> Anyone have any ideas about this?
>
> __
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free web site building tool. Try it!
> http://webhosting.yahoo.com/ps/sb/

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



[PHP] limit run time of a function?

2004-02-11 Thread Anthony
I have a function in my application that does a large query on my database.
In certain instances the query will take to long to return and will reach
the max execution time set in PHP.ini.  This is ok though, it's already set
to 90 secs and I don't want it any longer than that.  What I would like is
to have a way that I can time a function.  If the function takes to long to
return data, kill it and follow some other path in my app to let the user
know what's going on.  What I'm trying to avoid is the warning from PHP
saying that the script reached max execution time.  The user gets all
confused and then I get help desk calls.  There has got to be another way.
Any ideas?

- Anthony

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



[PHP] eregi_replace() function in a script

2002-12-01 Thread Anthony Ritter
Hi,
The following appliaction for the following html form and php script was
taken from Larry Ullman's book on PHP on page 130 - 131.

What it does is this:

1. the user is presented with a form with a few textboxes and a textarea
box.

2. the user fills in the boxes with a URL and a descripttion of the URL and
submits it.

3. the PHP takes the string which has three groupings and parses it uses the
eregi_replace() function.

4. The end result is that the URL input from the user becomes a active link.


The script works fine but I have a question with the following line:

$Pattern="(http://)([^[:space:]]+) ([[:alnum:]\.,-?/&=])"; // The variable
$Pattern is declared with three groupings.

My question:
If the user inadvertantly inputs a *space* _after_ the http:// grouping and
_before_ the www. grouping my understanding is that would not be valid from
the $Pattern match due to:

([^[:space:]]+)
..

Correct?

I tried the script by putting a space before the URL and the PHP still
processes the data with no error.

Please advise.
Thank you.
Tony Ritter








//this is the html form






First Name
Last Name 
URL 
Description





..
 //this is the script called 1201.php which receives the data from the form.



Using Regular Expressions


\n");
  }

$Pattern = "(http://)?([^[:space:]]+)([[:alnum:]\.,-_?/&=])";
$Replace = "http://\\2\\3\"; target=\"_new\">\\2\\3";
$Array["URL"] = eregi_replace($Pattern, $Replace, $Array["URL"]);

print ("Your submission--$Array[URL]--has been received!\n");

?>



--





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




Re: [PHP] eregi_replace() function in a script

2002-12-01 Thread Anthony Ritter
John W. Holmes:

> Yes, that's correct. That piece of the pattern matches anything that's
> not a space, one or more times.
>
> > I tried the script by putting a space before the URL and the PHP still
> > processes the data with no error.
>
> A space before everything is fine, as the pattern will match the
> remainder of the string. If you put a ^ at the very beginning of the
> pattern, that'll mean the beginning of the string must be followed by
> (http), so then a space will cause the patter match to fail.
...
Thanks for the reply John.

I still don't understand the explanation.

For instance, let's say I put _absolutely nothing_ in the URL textbox and
then hit submit - the PHP still processes _without_ an error.

It says:
"Your submission -- -- has been received!"

I would've thought the eregi_replace() function would've validated an entry
with no characters.

If you get a chance would you please try it out.

Thanks again for your time.
TR




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




Re: [PHP] eregi_replace() function in a script

2002-12-01 Thread Anthony Ritter
> Well, whether it causes an error not depends on your code. That's just
> the pattern you showed. It may not match anything, so nothing gets
> replaced with eregi_replace() and hence no "active link" is created, but
> it may not necessarily cause an error.
>
> Can you show me some of the code in context, with the pattern you showed
> earlier and how eregi_replace is being used? Thanks.
>
> ---John Holmes...
..

Sure.

BTW, here's a screenshot of the form and the result at:
www.gonefishingguideservice.com/php.htm

For a test, I put in a few spaces and then "s"  and then more spaces and
then "o" and then more spaces and then "s" and then I hit submit and the
script processed without an error.

So, I don't see where the eregi_replace() pattern matching is coming into
play.

Thank you.
TR
...
Here is Larry Ullman's PHP script on page 130 -131:

//this is the html form






First Name
Last Name 
URL 
Description





..
 //this is the script called 1201.php which receives the data from the form.



Using Regular Expressions


\n");
  }

$Pattern = "(http://)?([^[:space:]]+)([[:alnum:]\.,-_?/&=])";
$Replace = "http://\\2\\3\"; target=\"_new\">\\2\\3";
$Array["URL"] = eregi_replace($Pattern, $Replace, $Array["URL"]);

print ("Your submission--$Array[URL]--has been received!\n");

?>







---
[This E-mail scanned for viruses by gonefishingguideservice.com]


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




Re: [PHP] eregi_replace() function in a script

2002-12-01 Thread Anthony Ritter
Holmes:
>That's just the pattern you showed. It may not match anything, so nothing
gets
> replaced with eregi_replace() and hence no "active link" is created, but
> it may not necessarily cause an error.
.

Right.

The pattern does not match anything in the input string of
$Array[URL]

so the  never appears on output.

Thank you.
TR





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




[PHP] mail function() with MS

2002-12-06 Thread Anthony Ritter
Hi,
I'm using MS Win 98 and my ISP has PHP installed on a MS server.

I'd like to display a HTML form box on my site for users to type in a
message utilizing the PHP mail() function.

I've tested this using Apache on my drive with a html form and a php script
to receive the data and it works fine - but when the site goes live it will
be hosted with an ISP with a MS server - not Apache.

Is it possible to utilize the PHP mail function under these conditions?

I was led to believe that I could change the configurations in my php.ini
file from:

SMTP: localhost

to

SMTP: mail.yourisp.com

Greatly appreciate your advice.

Thanking all in advance.
Tony Ritter





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




Re: [PHP] mail function() with MS

2002-12-06 Thread Anthony Ritter
- Original Message -
From: "DL Neil" <[EMAIL PROTECTED]>
To: "Anthony Ritter" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Friday, December 06, 2002 8:47 AM
Subject: Re: [PHP] mail function() with MS


> Hi Anthony...{snipped]
.


Thank you DL.

Qusetion: 1:

What would happen if I changed the php.ini settings to:

SMTP=mail.yourisp.com

sendmail_from=MyAddress@MyDomain

as opposed to:

>SMTP=smtp.ISPs.domain
..

> When you use PHP provided by a service, you will need to establish what
they
> have set up as SMTP server, and if it is not acceptable to you (for
whatever
> reason that might be) work out how to override it.
..

I'm not sure why I would not think it is not "acceptable". Please advise.

Also...let's say I'm developing another site with a mail form box using
Win98 and Apache

Do I then have to reconfigure the php.ini files back to localhost from:

SMTP=mail.yourisp.com

Thank you.
TR


> I use a script/class from PHPguru.org, and I can't say for sure that it
even
> looks at the PHP.INI settings because I set them directly/again within the
> mail function's code. Highly recommended!





---
[This E-mail scanned for viruses by gonefishingguideservice.com]


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




[PHP] mail() problems...

2002-12-06 Thread Anthony Ritter
I'm using MS Win98 and Apache and getting the following after submitting the
mail form:
..
Warning: Failed to Connect in c:\program files\apache
group\apache\htdocs\send_simpleform.php on line 14


The html and php scripts follow along with my php.ini settings.

Any help would be appreciated.

Thank you.
Tony Ritter

The following e-mail has been sent:
Your Name:
Linda

Your E-Mail Address:
[EMAIL PROTECTED]

Message:
Test
.


//this is the html form



Simple Feedback Form






Your Name:


Your E-Mail Address:


Message:








..
//this is the php script
http://localhost/simple_form.html";);
 exit;
}
$msg = "E-MAIL SENT FROM WWW SITE\n";
$msg .= "Sender's Name:$sender_name\n";
$msg .= "Sender's E-Mail:  $sender_email\n";
$msg .= "Message:  $message\n\n";
$to = "[EMAIL PROTECTED]";
$subject = "Web Site Feedback";
$mailheaders = "From: My Web Site <> \n";
$mailheaders .= "Reply-To: $sender_email\n\n";
mail($to, $subject, $msg, $mailheaders);
?>


Simple Feedback Form Sent


The following e-mail has been sent:
Your Name:

Your E-Mail Address:

Message:




My php.ini settings are:

[mail function]
SMTP   = localhost   ;for win32 only
sendmail_from = [EMAIL PROTECTED] ;for win32 only
;sendmail_path =  ;for unix only,
may supply arguments as well (default is sendmail -t)





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




Re: [PHP] mail() problems...

2002-12-06 Thread Anthony Ritter
DL,
I'm not sure I understand.

I had this working a few months ago by changing the php.ini settings to:

SMTP   = localhost   ;for win32 only
sendmail_from = [EMAIL PROTECTED] ;for win32 only

and I was able to run that script on my box and get an e-mail returned to
me.

Now, I getting a "failed to connect".

Please advise.

I'm using MS OE5.

Thank you.
TR
..


- Original Message -
From: "DL Neil" <[EMAIL PROTECTED]>
To: "Anthony Ritter" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Friday, December 06, 2002 10:37 AM
Subject: Re: [PHP] mail() problems...


> Anthony,
>
> Do you have an SMTP server on your Win98 localhost?
> Recommend you change the PHP.INI SMTP= to say the same as your email
> package's server definitions.
>
> =dn
>
>
>
> > I'm using MS Win98 and Apache and getting the following after submitting
> the
> > mail form:
> > ..
> > Warning: Failed to Connect in c:\program files\apache
> > group\apache\htdocs\send_simpleform.php on line 14
> > 
> >
> > The html and php scripts follow along with my php.ini settings.
> >
> > Any help would be appreciated.
> >
> > Thank you.
> > Tony Ritter
> >
> > The following e-mail has been sent:
> > Your Name:
> > Linda
> >
> > Your E-Mail Address:
> > [EMAIL PROTECTED]
> >
> > Message:
> > Test
> > .
> >
> >
> > //this is the html form
> >
> > 
> > 
> > Simple Feedback Form
> > 
> > 
> >
> > 
> >
> >
> > Your Name:
> > 
> >
> > Your E-Mail Address:
> > 
> >
> > Message:
> > 
> >
> > 
> >
> > 
> >
> > 
> > 
> > ..
> > //this is the php script
> >  > if (($sender_name == "") && ($sender_email == "") && ($message == "")) {
> >  header("Location: http://localhost/simple_form.html";);
> >  exit;
> > }
> > $msg = "E-MAIL SENT FROM WWW SITE\n";
> > $msg .= "Sender's Name:$sender_name\n";
> > $msg .= "Sender's E-Mail:  $sender_email\n";
> > $msg .= "Message:  $message\n\n";
> > $to = "[EMAIL PROTECTED]";
> > $subject = "Web Site Feedback";
> > $mailheaders = "From: My Web Site <> \n";
> > $mailheaders .= "Reply-To: $sender_email\n\n";
> > mail($to, $subject, $msg, $mailheaders);
> > ?>
> > 
> > 
> > Simple Feedback Form Sent
> > 
> > 
> > The following e-mail has been sent:
> > Your Name:
> > 
> > Your E-Mail Address:
> > 
> > Message:
> > 
> > 
> > 
> > 
> > My php.ini settings are:
> >
> > [mail function]
> > SMTP   = localhost   ;for win32 only
> > sendmail_from = [EMAIL PROTECTED] ;for win32 only
> > ;sendmail_path =  ;for unix only,
> > may supply arguments as well (default is sendmail -t)
> >
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
> ---
> [This E-mail scanned for viruses by gonefishingguideservice.com]
>
>

---
[This E-mail scanned for viruses by gonefishingguideservice.com]


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




Re: [PHP] mail() problems...

2002-12-06 Thread Anthony Ritter
Gentlemen,
Thank you for your assistance.

The PHP mail scripts were taken from Julie Meloni's book on PHP called "Fast
and East" on pp. 116-117. (PrimaTech).

In fact, she writes:

"If you're using PHP4 on Windows, look for the following lines in your
php.ini file:

[mail function]
SMTP =; for Win32 only
sendmail_from = ;for Win32 only

You'll need to modify the last two lines so that the mail function works
properly.

1. For the SMTP entry, use 'localhost" or the name of the outgoing
mailserver you use in your e-mail client.

2. For the sendmail_from entry, enter your e-mail address.

For example in my php.ini file on Windows contains this:

[mail function]
SMTP =localhost
sendmail_from = [EMAIL PROTECTED]

END QUOTE

So that's what I did -using localhost - and I get:

"failed to connect".

I'm at a loss.
Please help.
Thanks.
TR





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




Re: [PHP] mail() problems...

2002-12-06 Thread Anthony Ritter
DL,
Sorry to be a pain... but using either:

the address of my outgoing mail server

or

localhost

still gives me:

Warning: Failed to Connect in c:\program files\apache
group\apache\htdocs\send_simpleform.php on line 14

Thanks again for your time.
TR




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




Re: [PHP] mail() problems...

2002-12-06 Thread Anthony Ritter
To all who assisted me today.

I finally managed to get the mail () funtion to work.

Thank you and happy holidays to you all...
TR





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




Re: [PHP] mail() problems...

2002-12-07 Thread Anthony Ritter
Jason Wong wrote:
> Would you mind disclosing what you did to make it work? Those searching
the
> archives in generations to come would appreciate what the conclusion was.
.

Sure.

1. I put it the _correct _name of my ISP's mailserver.

No more errros.

However...that sent out the mail but I didn't receive it back.

Then...

2. I received a nice e-mail from Ms. Meloni explaining that I forget to
replace the string in the variable:

$to

with _my_ e-mail address - not _hers_.

She was getting my test e-mails.

Oh brother...
Happy holidays and thank you for your help.
TR





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




[PHP] Undefined Variable

2002-12-14 Thread Anthony Ritter
Using MS Win 98 / Apache Server:

I'm trying to test a form box using the php mail() function.

All is well when I fill in the text boxes and hit submit.

I receive the e-mail.

The form action in the html page is:

http://localhost/getform.php";  METHOD="POST">

_Now_

when I copy both of those files which are:

1. The html file for the form box

- I have now changed the form action to read:

http://www.narrowsburg.org/getform.php";  METHOD="POST">

and

2. the .php file for the script

and publish them to my site which is hosted on my ISP's MS Server, and then
input data in the form boxes and hit submit:

I now get the following:
..
NOTICE: Undefined Variable: name in
d:\inetpub\www.narrowsburg.org\getform.php  in line 7


Then, when I check my e-mail I get a message with no input data from the
variables like the name, e-mail, address, etc.

Thanking all in advance who might help me out.
Tony Ritter








--





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




Re: [PHP] Undefined Variable

2002-12-14 Thread Anthony Ritter
>"Marco Tabini <[EMAIL PROTECTED]> wrote in message:
> Best guess, your local server has register_globals on and your ISP
> doesn't. However, without seeing your code it's going to be difficult to
> tell for sure! :-)
>
>
> Marco


Thanks for the reply Marco.

The following is the code.  Any advice would be greatly appreciated.
Happy holidays...
Tony


//this is the the html page


http://www.narrowsburg.org/getform.php"; METHOD="POST">

Your Name:
Business Name:
Contact Person:
Telephone Number:
e-mail address:
Mailing Address:
Town:State:  Zip Code:
Category:
Description of your business: 






//this is the .php file called "getform.php"

http://localhost/n_proserv_x.html";);
 exit;
}
$msg = "This e-mail was sent from:\n";
$msg .= "Sender's Name:$thename\n";
$msg .= $thename ."'s business name is:$bizname\n";
$msg .= "The contact person is:$contactname\n";
$msg .= $thename. "'s phone number is:$phone\n";
$msg .= $thename. "'s e-mail address is: $email\n";
$msg .= $thename. "'s mailing address is: $mailing\n";
$msg .= "Town: $town\n";
$msg .= "State: $state\n";
$msg .= "Zip Code: $zip\n";
$msg .= $thename."'s category is: $cat\n";
$msg .= "and the message is:  $description\n\n";
$to = "[EMAIL PROTECTED]";
$subject = "Narrowsburg Chamber of Commerce";
$mailheaders = "From: $thename\n";
$mailheaders .= "Reply to:$email\n\n";
mail($to, $subject, $msg, $mailheaders);
?>
.



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




Re: [PHP] Undefined Variable

2002-12-14 Thread Anthony Ritter
Marco Tabini <[EMAIL PROTECTED]> wrote in message:
> Hey Anthony--
>
> It's definitely a register_globals problem. Your ISP has turned it off
> because it's generally considered a significant security risk.
>
> The best way to solve it is to use the superglobal $_POST to access your
> post data. In your PHP script, change all the variables that you take
> from the form into their $_POST[''] equivalent (see below for a rough
> example--I put the assignments at the beginning because I wanted to
> touch your code as little as possible). Also, keep in mind that you're
> not performing any checks on the data--I'm sure you want to do it once
> you've sorted the current problem out, but the way it is now you're
> leaving yourself exposed to a number of possible attacks.
>
> $thename = $_POST['thename'];
(snipped)
.

Yep.

That did it.  Thanks again Marco.

Two more questions:

1. Can you give me some examples about:

"leaving yourself exposed to a number of possible attacks."

and

2. Where can I pick up the PHP magazine in your post sig.

best...
TR






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




Re: [PHP] Mail Server Setup

2002-12-24 Thread Anthony Abby
Trilochan said:
> Hi
>
> I want to provide the mailing facility to my clients in my deomain . For
> that , what are the basic requirements , and how can I do that .
>
> Any suggestion is highly appreciated.
>

It's pretty simple.  Check out http://www.postfix.org.  Postfix is
extremely stable, fast, and easy to configure.  Read all the documentation
available on the site, and if you want, purchase Blum's Postfix book
through Amazon.com or BN.com.

Regards,
Anthony



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




[PHP] Load Data Infile

2002-12-29 Thread Anthony Ritter
Off topic but I hope somebody can help.

Using MS Win98 / mySQL.

I'm trying to use LOAD DATA INFILE and coming up empty.

My text file is named:

test.txt
..

and is stored in C:\TextFiles

on the command line I type:
..
mysql>  LOAD DATA INFILE "C:\TextFiles\test.txt" INTO TABLE tony;

...
I get:

ERROR 1105 File c:\TextFile\ est.txt not found (Errcode:2)

\\please note that the "t" in test is not there.

Any help would be greatly appreciated.
Happy holidays,
Tony Ritter



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




Re: [PHP] Load Data Infile

2002-12-29 Thread Anthony Ritter
"Marco Tabini" <[EMAIL PROTECTED]> wrote in message:

> I'm not sure how MySQL works under Windows, but you should either use
> double backslashes (\\) instead of single backslashes or use forward
> slashes (/) instead. MySQL is trying to escape your string.
>
> Cheers,
> Marco


Thanks Marco.

C:\\TextFiles\\test.txt

works now

Happy new year to you and yours...
TR




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




[PHP] Repeats of values

2002-12-31 Thread Anthony Ritter
I'm running the following sql query which outputs a repeat value for each
field in the html cell box.

Like this:
..
3.3 3.3 78 78 2002-06-11 2002-06-11
...

which is not what I would like.

I was trying to get:
.
3.3 78 2002-06-11


I thought that by dropping off the $key in the $key - $value pair
to:

while(list (,$value) = each ($line))

would accomplish that.

The SQL query is:

SELECT level, pm, date FROM daytime WHERE pm >=75


The php script is:

= 75";
$result = mysql_query ($query)
or die ("Query failed");

 // printing HTML result


print ("Dates where water exceeded 75
degrees at Callicoon, New York - 2002");
 print("");
print "\n";

 while($line = mysql_fetch_array($result)){
  print "\t\n";
  while(list (,$value) = each ($line)) {
   print "$value\n";
  }
  print "\t\n";
 }
 print "\n";

mysql_close($link);
?>
..

Any help would be greatly appreciated.
Happy New Year!

Tony Ritter






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




[PHP] PHP vs. ASP

2003-01-04 Thread Anthony Rodriguez
Hi!
How does PHP differs from ASP?

Are there any advantages in using PHP over ASP? Or the other way around?

Thanks!



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




[PHP] counter problem

2003-01-04 Thread Anthony Ritter
The following script is found in Matt Zandstra's book on PHP (Sams) on page
160.

He's explaining forms with PHP and has hard coded a value - 42.

He also is explaining a hidden fleld where the user can submit the number
and each time the user hits submit in the formbox, the counter will register
the total number of guesses.

However, after running this script and submitting the number, I get:

Guess number:  0 \\\"\\

submit again and...

Guess number: 0 \\"", etc...

instead of:

Guess number: 1
Guess numver : 2
etc...

Thanking all in advance.
Tony Ritter
..


$numtoguess)
$message="Your guess was too high.";
else
$message="That is the correct number.";
$guess=(int)$guess;
?>





Guess number: 

Type your guess here:

">









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




Re: [PHP] counter problem

2003-01-04 Thread Anthony Ritter
Michael J. Pawlowsky wrote in message:

> This also works with the ternary operator...
.

No dice Michael.

I treid both your scripts.

The formbox comes up.
I enter a number.
I hit submit.
The box clears out the entered number without any message whether the number
was too high or too low or correct.

Nothing with the counter as well...

Please advise.

TR




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




Re: [PHP] counter problem

2003-01-05 Thread Anthony Ritter
Hi Mike,
I tried the first script you posted on the NG.

This is what happens when I copy and paste your script:

The formbox appears.
I insert a number.
I click submit.
The number reverts back to 0.

The URL script that you sent me works fine.

I'm using MS Win 98/ Apache / PHP 4

Please advise if you get a chance if you know why I can't get this script to
work.
Thank you.
Tony Ritter


---
[This E-mail scanned for viruses by gonefishingguideservice.com]


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




[PHP] form box question

2003-01-13 Thread Anthony Ritter
Hi,
I'm testing the following form on:

MS Win98 / IE 5.5 / PHP 4.0 / Apache and it works fine.

However...when I publish the

.php file

and the

data.txt file

on the ISP's MS IIS server, I get undeclared variables and indexes when the
form page loads.

The script follows.

Any help would be greatly appreciated.
Thank you.
Tony Ritter
.

// form.php




body {background-color:beige;
body
{
scrollbar-base-color: #FCF6DC;
scrollbar-face-color: #E3DBB5;
scrollbar-track-color: #FCF6DC;
scrollbar-arrow-color: #000;
scrollbar-highlight-color: #fff;
scrollbar-3dlight-color: #7B6D29;
scrollbar-shadow-color: #7B6D29;
scrollbar-darkshadow-color: #E3DBB5;
}
border:5px solid black;
}
textarea {border:1pt solid red;
  background-color:white;
  color:black;

  }

textarea p{font-size:12px;

  }

table {border:1pt solid black;
   width:700px;
   font-size:10px;
   background-color:#E3DBB5;
   color:#7B6D29;
   }


input {border:1pt solid solid red;
   background-color:white;
   color:black;}

.submit {
   background-color:#80;
   color:white;}

p {font-family:arial;
   font-size:12px;
  }

hr { color:#80;

}

A:link:{text-decoration:none; color:#7B6D29;}
A:visited:{text-decoration:none; color:#7B6D29;}
A:hover:{text-decoration:underline; color:green}




");

 print("Some of the messages have been:\n");

 $Data=file($TheFile);
  for($n=0; $n");

print("");
print("$getline[0]\n");
print("");
print("");
print("$getline[1]\n");
print("");
print("");
print("mailto:$getline[2]>$getline[2]\n");
print("");
print("");
print("");

  } //end for loop
 fclose($Open);

   } //end if
else
 {
  print("Unable to read data.txt");
 }
} //end function

function createform()
{

print("\n");
print("So...How did you like EagleFest 2003?:  \n");
print("Your name: \n");
print("Your e-mail: \n");
print("\n");
print("\n");
print("\n");

}

function handleform()
{
 global $comments;
 global $yourname;
 global $youremail;
 $comments=stripslashes($comments);
 $yourname=stripslashes($yourname);
 $youremail=stripslashes($youremail);
 $callfunction=WriteToFile($comments,$yourname,$youremail);
  if($callfunction)
   {

print(" ");
print(" ");
print(" ");
print(" ");
print(" ");
print("Thank you
for your comments about EagleFest 2003.");

   }//end if
  else
  {
   print("Your submission was not processed.");
  } //end else
}

if($beensubmitted)
 {
  handleform();
 }
else
{
createform();
ReadTheFile();
}
?>


...





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




Re: [PHP] form box question

2003-01-13 Thread Anthony Ritter
Thanks.

Any ideas after looking at the code why I'm having difficulty publishing the
file to a MS IIS server with undeclared indexes and variables if it works on
Apache server?

TR



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




[PHP] permission denied

2003-01-13 Thread Anthony Ritter
Using MS Win98 / php 4:

Any ideas on how I can change my permssion settings on a file called
data.txt so it can be read to and written to or do I have to take that up
with my ISP.

I get the following after I submit a form:

Warning: fopen("data.txt", "a+") - Permission denied in
d:\inetpub\www.blahblah.org\formtest.php on line 80
Your submission was not processed.

Thank you for your time and help.
TR







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




[PHP] Re: permission denied

2003-01-14 Thread Anthony Ritter
Lars,
I use Win98 and Apache to test the .php script.

My ISP has IIS.
TR



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




[PHP] Disable pic copy/save?

2003-01-23 Thread Anthony Rodriguez
Hi!

A client wants to test market two versions of an advertising but wants to 
disable the users' ability to copy/save the ads (right click, copy/save).

How can this be done in PHP?

Thanks!

Anthony F. Rodriguez
([EMAIL PROTECTED])




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



[PHP] php question - query string

2003-01-30 Thread Anthony Ritter
The following script is from Kevin Yank's book on page 59-60.  (Sitepoint)

I'd like to get some clarification about the line: (almost next to last line
in the script)

...
echo("Add a Joke!");



He has a link called "Add a Joke!".

When the user clicks on the link, the same page loads - with the form this
time - and the query string passes the value -1 - to the variable $addjoke.

Am I on the right track?

If so, why does 1 - as opposed to 2 or something else - have to be the
name/value pair if the user is adding another joke?

Thank you.
TR
..



 The Internet Joke Database 





Type your joke here:




Unable to connect to the " .
"database server at this time." );
  exit();
}

// Select the jokes database
if (! @mysql_select_db("jokes") ) {
  echo( "Unable to locate the joke " .
"database at this time." );
  exit();
}

// If a joke has been submitted,
// add it to the database.
if ($submitjoke == "SUBMIT") {
  $sql = "INSERT INTO Jokes SET
  JokeText='$joketext',
  JokeDate=CURDATE()";
  if (@mysql_query($sql)) {
echo("Your joke has been added.");
  } else {
echo("Error adding submitted joke: " .
 mysql_error() . "");
  }
}

echo(" Here are all the jokes in our database: ");

// Request the text of all the jokes
$result = @mysql_query("SELECT JokeText FROM Jokes");
if (!$result) {
  echo("Error performing query: " . mysql_error() . "");
  exit();
}

// Display the text of each joke in a paragraph
while ( $row = mysql_fetch_array($result) ) {
  echo("" . $row["JokeText"] . "");
}

// When clicked, this link will load this page
// with the joke submission form displayed.
echo("Add a Joke!");

  endif;

?>



--





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




[PHP] php/mysql connection

2003-02-02 Thread Anthony Ritter
Newbie question and OT.  Sorry.

I am able to conncet to a mysql server with the following call to
mysql_connect().
$connect=@mysql_connect("","","");

There are no parameters in the function call.

Why can I connect if there are no parameters?

However, if I give mysqladmin the password of:
goodpassword

and call:

$connect=@mysql_connect("localhost","root","goodpassword");

I connect.

But if I call:
$connect=@mysql_connect("localhost","root","badpassword");

I cannot connect.

Or from the command line...

>From the command line:
C:\Windows\cd c:\mysql\bin  \\enter

C:\mysql\bin> mysqld-shareware --standalone  \\enter

C:\mysql\bin> mysql \\enter  note: no password have been entered.

\\ I get the: Welcome to the MySql monitor...
...
Or...

C:\Windows\cd c:\mysql\bin  \\enter

C:\mysql\bin> mysqld-shareware --standalone  \\enter

C:\mysql\bin> mysql -u root - p \\ enter

Enter password  goodpassword \\ I get the: Welcome to the MySql monitor...



C:\Windows\cd c:\mysql\bin  \\enter

C:\mysql\bin> mysqld-shareware --standalone  \\enter

C:\mysql\bin> mysql -u root - p \\ enter
Enter password  badpassword \\ I do _not_  get the: Welcome to the MySql
monitor...


Why is this when I thought it needs a password to connect to the MySql
monitor?
Thanks,
TR






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




[PHP] mysql/php query - wrox

2003-02-02 Thread Anthony Ritter
Working on:
Win 98 / mysql 3.23.55 / php 4

I installed mysql 3.23.55 and wanted to check the user table in the mysql
db.

The query was:
SELECT User FROM user WHERE host='localhost';

The output was:

xx
user |
xx
||
||
root  |
xx

2 rows in set

.

In the Wrox book on PHP (page 396) by running that query it is:

x--x
user  |
x--x
root   |
x-x

1 row in set


I'm not sure why I'm getting two rows.
Many thanks for your assistance.
TR




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




Re: [PHP] php/mysql connection

2003-02-03 Thread Anthony Ritter

John W. Holmes wrote in message :
> Because a default install of MySQL includes an anonymous user, one with
> no username or password. There is also a root user with no password.
> Read the MySQL manual on Installation and the GRANT command on how to
> fix this.
>
> ---John W. Holmes...
...

John,
I was under the impression that the mysql database had as default user when
installed:
..
anonymous
root


And that the _anonymous_ user could only create a database that began with
the word - test.

Using the following commands:

...
C:\WINDOWS\cd c:\mysql\bin
C:\mysql-shareware --standalone
C:\mysql\bin>mysqladmin CREATE houses

Database houses created

C:\mysql\bin>mysql
Welcome to the mysql monitor...

mysql>USE houses
Database changed


And the database "houses" was created _without_ the word "test".
Why is this?

Thanking you,
Tony Ritter




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




Re: [PHP] mysql/php query - wrox

2003-02-03 Thread Anthony Ritter
Chris Shiflett" wrote in message:
> Your query returns two rows because you have two rows in
> the database that match the condition:
>
> host='localhost'
>
> --
> Chris
..

Chris,
I was under the impression that the mysql database had as default user when
installed:
..
anonymous
root


And that the _anonymous_ user could only create a database that began with
the word - test.

Using the following commands:

...
C:\WINDOWS\cd c:\mysql\bin
C:\mysql-shareware --standalone
C:\mysql\bin>mysqladmin CREATE houses

Database houses created

C:\mysql\bin>mysql
Welcome to the mysql monitor...

mysql>USE houses
Database changed


As it is, I'm reading Meloni's tutorial on mysql/PHP so the question might
also apply to others in this PHP ng.

Anyway, the database "houses" was created _without_ the word "test" as the
anonymous user.
Why is this?

Thanking you,
Tony Ritter





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




[PHP] undefined function - crypt()

2003-02-12 Thread Anthony Ritter
Using MS Win98 / PHP /Apache

I'm getting a undefined function error - crypt()

The following scripts were taken from Larry Ullman's book on PHP on page
60-61.

Any advice would be helpful.
Thank you.

Tony Ritter
..

//ullmanform.html


HTML Form



First Name Last Name 
E-mail Address 
Comments 





// ullmanpassword2.php



Form Results/Using Strings


\n");
print ("Your E-mail address is $Email.\n");
print ("This is what you had to say:\n $Comments\n");
$CryptName = crypt($Name);
print ("This is the crypt() version of your name: $CryptName\n");
?>


..


Fatal error: Call to undefined function: crypt()
in c:\program files\apache group\apache\htdocs\ullmanpassword2.php





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




[PHP] Re: undefined function - crypt()

2003-02-12 Thread Anthony Ritter

Greg wrote in message:
> I believe you need to have mcrypt installed.
> -Greg

.

Not sure what mcrypt is.

Please advise.

In Ullman's textbook, it says that decrypt() and encrypt(0 fuctions will not
work if PHP is not installed as a module.

However, in his example in the book, it was with crypt().

It does seem to work by calling the md5() function.

TR




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




[PHP] geek fishing stuff

2003-02-14 Thread Anthony Ritter
My guiding season begins in April.

Anybody out there know where I can purchase a nice mysql dolphin t-shirt?

Thank you.
TR



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




Re: [PHP] geek fishing stuff

2003-02-14 Thread Anthony Ritter
Jason Wong wrote in message:

> Try the mysql website or the mysql list?
.

Yep. I went to the mysql site and they didn't have any promo material like
t-shirts, visors, etc.

My news server doesn't have any mysql newsgroups.   SQL - yes - but not
mysql.

There was a shop online that had geek stuff...I forget the name.

And that dolphin _is_ a nice looking logo.

If you know it - please post.
Thanks.
TR





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




[PHP] syntax question

2003-02-19 Thread Anthony Ritter
Greetings...
The following is the _third_ part of a script found in Julie Meloni's book
"PHP Essentials" on page 118.

The script dynmically generates a form box of field names, field types and
field sizes for a mysql table depending on what the user chooses.

My question is about syntax or logic in the following snippet:

The variables:
$field_name
$field_type
$field_length

are carried over from the previous script.

.

$sql = "CREATE TABLE $table_name (";

   for ($i = 0; $i < count($field_name); $i++) {

  $sql .= "$field_name[$i] $field_type[$i]";

  if ($field_length[$i] != "") {
   $sql .= " ($field_length[$i]),";
  } else {
   $sql .= ",";
  }
 }

 $sql = substr($sql, 0, -1);

 $sql .= ")";

...

My question is about the snippet:

.
  if ($field_length[$i] != "") {
   $sql .= " ($field_length[$i]),";
  } else {
   $sql .= ",";
  }
..

In that it would say that if the field_length variable is not empty then add
the (number) and comma to the sql statement

If it is empty, then just add a comma.

The question:

Is the reasoning that a comma *must* be added since this is _within_ a loop?

As in:
CREATE TABLE chairs (
id INT(5),
item VARCHAR(50),
desc TEXT ,
price FLOAT , // common should be deleted but there is no way of knowing
this within the loop.
  // that's why after the loop closes there is a
substr() function to delete the comma.
);


And that after the loop ends, the comma is then deleted using the substr()
function to complete the sql statement.

TIA,
Tony Ritter
..

The complete script:





Create a Database Table: Step 3

p {font-family:arial;
font-size: .75em;}

input {border: 1px solid black;}

th {font-family:arial;
font-size: .75em;
color:red;}

h2 {font-family:arial;
font-size: 1em;}






Adding  Table

Couldn't create table!";
 } else {
  echo "$table_name [table] has been created!";
 }



?>









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




Re: [PHP] syntax question

2003-02-19 Thread Anthony Ritter
This is what I was getting at.

The following is correct mysql syntax in which a comma must be added after
each field - except for the last field - in this case price:

i.e.,
.

CREATE TABLE chairs(
id int(5),
item varchar(50),
desc text,
price float
);
.

However, within the loop in her script it says to add the comma after _each_
field since there is no way of knowing when the loop will end.

Thus, why is she directing the script - after the loop has ended - to lop
off the last comma by using the

substr() function call as in:

if ($field_length[$i] != "")
 {
 $sql .= "($field_length[$i]) , ";
}
else
{
 $sql .= ", ";
}

loop is finished.

and then...

$sql=substr($sql,0,-1); //which basically says to take the existing sql
statement string from the beginning  to the next to last character and
return it to the variable $sql thus taking off the comma.

Am I on the right track?

Thank you.
Tony Ritter
...


Ernest E Vogelsinger" <[EMAIL PROTECTED]

> No. The reason for the comma is that SQL dictates that column names in a
> create table statement are separated by a comma.
>
> This is valid SQL:
> create table chairs(
> id int(5),
> item varchar(50),
> desc text,
> price float
> );
>
> This is invalid and generates an SQL error when passed to the server:
> create table chairs(
> id int(5)
> item varchar(50)
> desc text
> price float
> );




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




Re: [PHP] syntax question

2003-02-19 Thread Anthony Ritter
Many thanks Jason.
TR





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




[PHP] Downloading files

2003-02-23 Thread Anthony Rodriguez
Hi!

In PHP, is there a way to allow the user to download a file (e.g.: 
sample.txt) to their computer? And, then, automatically return to the 
PHP-generated Web page.

How can the file be stored in C:\sample.txt, for example?

Thanks!

Tony





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


[PHP] Downloading files - Plz hlp

2003-02-23 Thread Anthony Rodriguez
Hi!

In PHP, is there a way to allow the user to download a demo file (e.g.: 
sample.exe) to their computer? And, then, automatically return to the Web site?

Thanks!

Tony





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


[PHP] resizing .jpg file in php

2003-02-26 Thread Anthony Ritter
I'd like to use (with permission) .jpg files from a webcam from another URL.

Once that URL is opened and read via PHP as a file into my site is it
possible to resize that image?   It measures 640 x 480 pixels and I would
like to reduce the image size by 25%.

Thank you.
Tony Ritter




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



[PHP] newbie: installing gd in php4

2003-02-26 Thread Anthony Ritter
Using MS Win 98 / PHP 4 and Apache.

I tried running the following script but got an undefined call to:

ImageCreate()

The following copy is located in my php.ini file...one of which is:

..
;extension=php_gd.dll
..

I tried uncommenting this line to no avail.

What is the best way to install php_gd.dll so that I can make use of the
image library.
Many thanks.

Tony Ritter



;;
; Dynamic Extensions ;
;;
; if you wish to have an extension loaded automaticly, use the
; following syntax:  extension=modulename.extension
; for example, on windows,
; extension=msql.dll
; or under UNIX,
; extension=msql.so
; Note that it should be the name of the module only, no directory
information
; needs to go here.  Specify the location of the extension with the
extension_dir directive above.


;Windows Extensions
;extension=php_mysql.dll
;extension=php_nsmail.dll
;extension=php_calendar.dll
;extension=php_dbase.dll
;extension=php_filepro.dll
;extension=php_gd.dll
;extension=php_dbm.dll
;extension=php_mssql.dll
;extension=php_zlib.dll
;extension=php_filepro.dll
;extension=php_imap4r2.dll
;extension=php_ldap.dll
;extension=php_crypt.dll
;extension=php_msql2.dll
;extension=php_odbc.dll

--





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



[PHP] Re: resizing .jpg file in php

2003-02-26 Thread Anthony Ritter



--


Steve Magruder  wrote in message :
> To reduce its display size in an img tag, specify 640 * .75 for the width
> (assuming 640 is for width) and 480 * .75 for the height.  If you actually
> want to reduce the size of the image, then look at PHP's image-related
> functions (and the GD library).
>
> Steve
..

Thanks Steve.

Using MS Win 98 / PHP 4 and Apache.

I tried running the following script but got an undefined call to:

ImageCreate()

The following copy is located in my php.ini file...one of which is:

..
;extension=php_gd.dll
..

I tried uncommenting this line to no avail.

What is the best way to install php_gd.dll so that I can make use of the
image library.
Many thanks.

Tony Ritter



;;
; Dynamic Extensions ;
;;
; if you wish to have an extension loaded automaticly, use the
; following syntax:  extension=modulename.extension
; for example, on windows,
; extension=msql.dll
; or under UNIX,
; extension=msql.so
; Note that it should be the name of the module only, no directory
information
; needs to go here.  Specify the location of the extension with the
extension_dir directive above.


;Windows Extensions
;extension=php_mysql.dll
;extension=php_nsmail.dll
;extension=php_calendar.dll
;extension=php_dbase.dll
;extension=php_filepro.dll
;extension=php_gd.dll
;extension=php_dbm.dll
;extension=php_mssql.dll
;extension=php_zlib.dll
;extension=php_filepro.dll
;extension=php_imap4r2.dll
;extension=php_ldap.dll
;extension=php_crypt.dll
;extension=php_msql2.dll
;extension=php_odbc.dll

>
>



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



Re: [PHP] newbie: installing gd in php4

2003-02-26 Thread Anthony Ritter
In my php.ini file, this is what it looks like:

...
extension_dir = C:\php4\extensions\; directory in which the loadable
extensions (modules) reside

extension=php_gd.dll


Many thanks,
TR





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



[PHP] imagecreate()

2003-02-26 Thread Anthony Ritter
On MS Win 98 / Apache / PHP 4

If somebody out there using Win can check my php.ini file and advise me what
I'm doing wrong.

I have uncommented:
..
extension=php_gd.dll
..
and have included:
..
extension_dir = C:\php4\extensions

I run the php script:




I receive:

X-Powered-By: PHP/4.0.0 Content-type:image/png
Fatal error: Call to undefined function: imagecreate() in c:\program
files\apache group\apache\htdocs\image.php on line 3

Thank you.
TR
...

// this is in my php.ini file:

;
; Paths and Directories ;
;
include_path =   ; UNIX: "/path1:/path2"  Windows:
"\path1;\path2"
doc_root  = ; the root of the php pages, used only if nonempty
user_dir  = ; the directory under which php opens the script using
/~username, used only if nonempty
;upload_tmp_dir = ; temporary directory for HTTP uploaded
files (will use system default if not specified)
upload_max_filesize = 2097152   ; 2 Meg default limit on file uploads
extension_dir = C:\php4\extensions; directory in which the loadable
extensions (modules) reside


;;
; Dynamic Extensions ;
;;
; if you wish to have an extension loaded automaticly, use the
; following syntax:  extension=modulename.extension
; for example, on windows,
; extension=msql.dll
; or under UNIX,
; extension=msql.so
; Note that it should be the name of the module only, no directory
information
; needs to go here.  Specify the location of the extension with the
extension_dir directive above.


;Windows Extensions
;extension=php_mysql.dll
;extension=php_nsmail.dll
;extension=php_calendar.dll
;extension=php_dbase.dll
;extension=php_filepro.dll
extension=php_gd.dll
;extension=php_dbm.dll
;extension=php_mssql.dll
;extension=php_zlib.dll
;extension=php_filepro.dll
;extension=php_imap4r2.dll
;extension=php_ldap.dll
;extension=php_crypt.dll
;extension=php_msql2.dll
;extension=php_odbc.dll


//this is the php script:


...

//this is what I get:

X-Powered-By: PHP/4.0.0 Content-type:image/png
Fatal error: Call to undefined function: imagecreate() in c:\program
files\apache group\apache\htdocs\image.php on line 3




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



Re: [PHP] imagecreate()

2003-02-26 Thread Anthony Ritter
Yes Adam.
Any ideas?

TR



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



Re: [PHP] imagecreate()

2003-02-26 Thread Anthony Ritter
Fine Chris.

Maybe you'd be kind enough to explain how I can get that function to work.

I've uncommented the line in the php.ini file.

In "Mastering PHP" (Sybex) on page 559 - Chapter 18, the authors of the
textbook - Allen and Hornberger - say when using Win to:
...
"uncomment it; that's it.  Restart your webserver. That's all it takes."
...

Please advise on the steps if you get a chance.

Tony Ritter







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



Re: [PHP] imagecreate()

2003-02-26 Thread Anthony Ritter
Chris,
The function I'm trying to get...it's:

imagecreate()

I am using MS Win 98 / PHP 4 and Apache.

I tried running the following script but got an undefined call to
imagecreate()


The following copy is located in my php.ini file...one of which is:

..
;extension=php_gd.dll
..

I tried uncommenting this line to no avail.

What is the best way to install php_gd.dll so that I can make use of the
image library.

Many...many thanks.

Tony Ritter

---
[This E-mail scanned for viruses by gonefishingguideservice.com]


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



[PHP] =at wit's end with GD Libraries=

2003-02-27 Thread Anthony Ritter
I want to thank those who tried to help with my questions about using the GD
libraries.

I still have not gotten them to function using PHP.

I've put two screenhots of the phpinfo() page at:

www.gonefishingguideservice.com/php_page.htm

If you care to take a look at those images, you'll see that I've got php and
Apache working with MS Win 98.  It also says that directories are enabled.

I've searced for the following files that I believe I need for GD Libraries
and PHP in Explorer and found:

php_gd.dll  -> C:\PHP\extensions

php.ini -> C:\WINDOWS

php4ts.dll -> C:\WINDOWS\System

msvcrt.dll -> C:\WINDOWS\System

When I load the phpinfo() page, it comes up like you see in the screenshots.

However, when I _take out_ the semi-colon as in the line:
...
extension=php_gd.dll  //semi-colon taken out
..

the page - or any page with a file extension.php will _not_load at all using
Apache.

However, when I _reinsert_ the semi-colon in the php.ini file, the .php page
then loads.

Any advice on how I can get the GD libaries to work will be greatly
appreciated.

At wit's end...

Thank you.
Tony Ritter




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



  1   2   3   4   >