[PHP] CSV download

2004-02-18 Thread Roberts, Mark (Tulsa)
I have an application that I need to add a function to that will download a complete 
MySql Table in comma delineated format from a web site to a local hard drive.  What is 
the best way to do this?
 
Is there a function in PHP that will do this? in MySql? or do I just need to do 
something with fopen().
 
Anything to help me get started would be appreciated.

Mark Roberts 
Sr. Systems Analyst 


 


RE: [PHP] CSV download

2004-02-18 Thread Roberts, Mark (Tulsa)
Is this through the fopen() and other file handling functions?

Mark Roberts 
Sr. Systems Analyst 
Corporate Compliance  Governance Applications 
The Williams Information Technologies 
Office 918.573.1706 
Pager 918.672.5359 
Fax 918.573.0892 
Email: [EMAIL PROTECTED] 
Email Text to pager: [EMAIL PROTECTED] 



-Original Message-
From: Robby Russell [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 18, 2004 12:42 PM
To: Roberts, Mark (Tulsa); [EMAIL PROTECTED]
Subject: Re: [PHP] CSV download


Roberts, Mark (Tulsa) typed this on 02/18/2004 10:33 AM:
 I have an application that I need to add a function to that will
 download a complete MySql Table in comma delineated format from a web
 site to a local hard drive.  What is the best way to do this?
 
 Is there a function in PHP that will do this? in MySql? or do I just
 need to do something with fopen().
 

All you need to do is open a temporary file, write to it on the server, 
then send to the client browser for them to save.

-Robby


-- 
#---
# Robby Russell,  |  Sr. Administrator / Lead Programmer
# Command Prompt, Inc.   |  http://www.commandprompt.com
# [EMAIL PROTECTED] | Telephone: (503) 667.4564
#---

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



RE: [PHP] AOL Email client

2003-08-14 Thread Roberts, Mark (Tulsa)
Ok, it seems to be AOL v8.

I am going to set down tonight and try all these options that I have seen here and see 
if they fix the problem. Thanks for all your help.

Mark Roberts 
Sr. Systems Analyst 




-Original Message-
From: Jennifer Goodie [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 07, 2003 8:49 PM
To: Mark Roberts; [EMAIL PROTECTED]
Subject: RE: [PHP] AOL Email client


 Here is what my header look like:

   $headers .= MIME-Version: 1.0\r\n;
   $headers .= Content-type:  text/plain;
 charset=us-ascii\r\n;
   $headers .= From: .$name. .$email.\r\n;
   $headers .= To: .$myname. .$toAddress.\r\n;
   $headers .= Reply-To: .$name. .$email.\r\n;
   $headers .= X-Priority: 1\r\n;
   $headers .= X-MSMail-Priority: High\r\n;
   $headers .= X-Mailer: Just My Server;


It appears to work fine in AOL 6.0 when I send from unix box using PHP 4.2.3
and sendmail, what version of AOL are you having problems with, what server
platform and PHP version are you using to send?  If you are using the php
mail function you must be passing To as the first parameter since it is not
optional, so why are putting it in your headers as well?  If I remember
correctly, RFC2822 states there should only be 1 to header.


-- 
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] file downloading

2003-06-19 Thread Roberts, Mark (Tulsa)
I need to provide a way for users to download data files from a web site.
 
I know that I could have then right click and save-as, however, I need to record this 
action in a database. If they just right click, I don't have any way to trigger the 
script to record the transaction.
 
Does some one have a good way to do this, or at least give me some ideas? Thanks.

Mark Roberts 
Sr. Systems Analyst 


 


[PHP] A simple request from a simple person

2003-06-12 Thread Roberts, Mark (Tulsa)
Obviously relatively new to php
 
I would like to know how to do a simple redirect from a php page.
 
For example in ASP I do response.redirect(thispage.com)
 
Want to do the same thing in php.
 
I have tried to go through the documentation, but can't seem to get focused on the 
proper and simplest way to do it.
 
A little help would be appreciated. Thanks.

Mark Roberts 
Sr. Systems Analyst 


 


RE: [PHP] Connecting to a remote server

2003-03-28 Thread Roberts, Mark \(Tulsa\)
They are not on the same server...that is the problem.
They used to be on the same server, but I have had to move the application to a 
physically different server with a different DNS than the DB Server.

So, on the surface, it would seem that I should just replace 'localhost' with the dns 
name of the DB Server i.e. (http://www.xyz.com). However, this did not work. Is there 
something else that I should be doing, either in the connect string or in php 
configuration?


Mark Roberts
Sr. Systems Analyst




-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED]
Sent: Friday, March 28, 2003 12:24 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Connecting to a remote server


On Friday 28 March 2003 05:00, Roberts, Mark \(Tulsa\) wrote:
 I am needing to move one of my apps to a remote secure server that I have.
 As I have never done this before what are the general things that I must do
 to make this happen.

 I changed my connect statement from localhost to the name of the server 
  http://www.remoteservername.com http://www.remoteservername.com; and
 received an error that I could not connect, try again later.

Are you talking about the database connection? If so, then there is no need 
for the 'http://'. And if both the webserver and the DB server are on the 
same machine you can continue to use 'localhost'.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Things are not as simple as they seems at first.
- Edward Thorp
*/


-- 
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] Connecting to a remote server

2003-03-27 Thread Roberts, Mark \(Tulsa\)
I am needing to move one of my apps to a remote secure server that I have. As I have 
never done this before what are the general things that I must do to make this happen.
 
I changed my connect statement from localhost to the name of the server   
http://www.remoteservername.com http://www.remoteservername.com; and received an 
error that I could not connect, try again later.
 
Is there something else that I must do from an mysql or php standpoint to allow this 
to happen?
 
Thanks

Mark Roberts 
Sr. Systems Analyst 




[PHP] Re-directing

2002-07-24 Thread Roberts, Mark

Is there a way to redirect to a different script in PHP? I call it
redirecting, but can't find it in the documentation using that track.

I have a script...that if a certain criteria is met, I want to load a
different script. Haven't been able to figure that out yet. I have gotten
about it by conditionally executing a location.href in javascript. It works,
but would like to know how to do it in PHP.

~Thanks.

Mark Roberts
Sr. Systems Analyst
LanApps/Web Development
The Williams Information Services Corporation
918-573-1706
[EMAIL PROTECTED]





[PHP] Else/For loop

2002-06-12 Thread Roberts, Mark

Being relatively new to php, I discovered the following after about 2 hours
of debugging last night and was wondering why???

I had the following code:

if ( $num_results = 0 )
{
echo no records found;
}
else
{
for ($i=0; $i  $num_results; $i++)
{
display record set
}
}

As a result, the for loop never executed, no matter how many records were
returned in the record set. I placed echo statements though out to determine
why the for loop was not being executed. I put an echo statement just before
the for to make sure the else condition was being met.

Finally, I just copy/pasted (literally) the for loop to just before the 'if'
statement. Much to my surprise...the for loop now works perfectly. (Except,
of course, if there are no records returned).

The duduction...for loops will not work inside else statements. The
question...why?

I think I can work around this with some different coding, but why should I
have to? I have done this same thing in java, perl and other languages...

Mark Roberts
Sr. Systems Analyst
LanApps/Web Development
The Williams Information Services Corporation
918-573-1706
[EMAIL PROTECTED]





RE: [PHP] Else/For loop

2002-06-12 Thread Roberts, Mark

Thanks to everyone who replied. Of course it should be '=='. I was too
focused on why the for was not working and overlooked the obvious.

Mark Roberts
Sr. Systems Analyst
LanApps/Web Development
The Williams Information Services Corporation
918-573-1706
[EMAIL PROTECTED]



-Original Message-
From: Christoph Starkmann [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 8:27 AM
To: Roberts, Mark; '[EMAIL PROTECTED]'
Subject: RE: [PHP] Else/For loop


Hi Mark!

 Being relatively new to php, I discovered the following after 
 about 2 hours
 of debugging last night and was wondering why???
 
 I had the following code:
 
 if ( $num_results = 0 )
 {
   echo no records found;
 }
 else
 {
   for ($i=0; $i  $num_results; $i++)
   {
   display record set
   }
 }
 
 As a result, the for loop never executed, no matter how many 
 records were
 returned in the record set. I placed echo statements though 
 out to determine
 why the for loop was not being executed. I put an echo 
 statement just before
 the for to make sure the else condition was being met.
 
 Finally, I just copy/pasted (literally) the for loop to just 
 before the 'if'
 statement. Much to my surprise...the for loop now works 
 perfectly. (Except,
 of course, if there are no records returned).
 
 The duduction...for loops will not work inside else statements. The
 question...why?

I guess this would be the end of all PHP-programming ;)
Of course you can place any correct block of code inside any other
correct block of code.
But, i your case $num_results IS zero. Just place an echo statement 
inside the if block ;)

Very frequent error ;)

if ($num_results = 0) indeed is an asignment, no comparison.
Better use == if you want to compare thingies...

 I think I can work around this with some different coding, 
 but why should I
 have to? I have done this same thing in java, perl and other 
 languages...

Yes, also with == ;)
 
Cheers,

Kiko

-- 
It's not a bug, it's a feature.
christoph starkmann
mailto:[EMAIL PROTECTED]
http://www.gruppe-69.com/
ICQ: 100601600
-- 

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




[PHP] Checking url validation

2002-03-29 Thread Roberts, Mark

I am using the following to verify a url:

if (!$fp = fopen(http://www.anyurl.com;, r))
{
echo not valid;
}
else
{
echo this is a valid url;
}

I always get a not valid message. What am I doing wrong? Is there a better
way to do this?

Mark Roberts
Sr. Systems Analyst
LanApps/Web Development
The Williams Information Services Corporation
918-573-1706
[EMAIL PROTECTED]