Re: [PHP] Force-Saving an Audio File

2009-12-09 Thread c...@hosting4days.com

Thanks Gaurav  Shawn,

I'll check into your suggestions.



Thanks,
c...@hosting4days.com






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



[PHP] Force-Saving an Audio File

2009-12-08 Thread c...@hosting4days.com

Hi folks,

I'm trying to force save .mp3 files so this is a test page (found on  
the net). It works fine when:

$directory = ;  // so the audio is in the same local directory

but fails when I use a REAL web directory -  (the audio file is here  
- http://mysite.com/test1/audio.mp3 )

$directory = http://mysite.com/test1/;;

says - The file $file was not found.

Q: Any ideas how to get it to download from the website?

=



?php

$file = 'audio1.mp3';

$directory = http://mysite.com/test1/;;
//$directory = ;
$path = $directory$file;

if(ini_get('zlib.output_compression'))
ini_set('zlib.output_compression', 'Off');

$file_extension = strtolower(substr(strrchr($path,.),1));

if( $file ==  )
{
echo html
head
titleFile not found./title
/head
body
File not found.
/body
/html;
exit;
} elseif (! file_exists( $path ) )
{
echo html
head
titleThe file $file was not found./title
/head
body
The file $file was not found.br /
- path - $path
/body
/html;exit;
};
switch( $file_extension )
{
case pdf: $ctype=application/pdf; break;
case zip: $ctype=application/zip; break;
case doc: $ctype=application/msword; break;
case xls: $ctype=application/vnd.ms-excel; break;
case ppt: $ctype=application/vnd.ms-powerpoint; break;
case gif: $ctype=image/gif; break;
case png: $ctype=image/png; break;
case jpeg:
case jpg: $ctype=image/jpg; break;
case wav:
case mp3: $ctype=application/iTunes; break;
default: $ctype=application/force-download;
}
header(Pragma: public);
header(Expires: 0);
header(Cache-Control: must-revalidate, post-check=0, pre-check=0);
header(Cache-Control: private,false);
header(Content-Type: $ctype);
header(Content-Disposition: attachment; filename=\.basename 
($path).\; );

header(Content-Transfer-Encoding: binary);
header(Content-Length: .filesize($path));

readfile($path);
exit();

?



Thanks,
c...@hosting4days.com






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



[PHP] Plotting a Line Graph It seems that the google charts work from a url - so 500 points would be way to long for any url - so I guess that option is out.

2009-10-16 Thread c...@hosting4days.com
I have a data file that stores about 500 numbers in a record - meant  
to plot a basic line graph (left to right). The numbers can be  
imported into a record with 500 fields or just stored in a text field  
- which ever is better.


The user might want to pick a few random records and plot them  
together - so the line graph may compare the few records together.


It seems that the google charts work from a url - so 500 points would  
be way to long for any url - so I guess that option is out.


Q: what is the best way to create / display line graphs in with PHP?

Thanks in advance for your help - dave




Thanks,
c...@hosting4days.com






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



Re: [PHP] Plotting a Line Graph

2009-10-16 Thread c...@hosting4days.com

Jim Lucas wrote:



I would recommend http://www.rgraph.net/

It was written and is currently maintained by a member of this list.

Jim Lucas



Hi Jim,

rgraph looks cool... most demos I see show just a few points - do you 
think this could display 500 points? (I'm looking through their docs now...)


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



[PHP] Parse Question Using list()

2009-10-01 Thread c...@hosting4days.com

newbie import csv question

file is like:

stuff1,stuff2,stuff3
stuff1,stuff2,stuff3
stuff1,stuff2,stuff3
stuff1,stuff2,stuff3

etc.


Problem: when I try to parse out the 3 fields and display them using  
list() it just gets just 1st char of each field ...
Q: How do I get it to set $col1 - 2  $col3 to the full contents of  
each for each line (not just 1st char)?



?php

// on a mac but with windows linefeed returns in file

$handle = fopen(file:///path/_impfool/test.csv, r);

while (!feof ($handle))
{

$line = fgets($handle);

list($col1, $col2, $col3) = $line;

echo $line.''.' linebr'; // this shows the whole line ok

echo c1 is $col1 and c2 is $col2 and c3 is $col3.'br'; // this  
shows just 1st char of each field



}

 ?



Thanks,
c...@hosting4days.com






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



Re: [PHP] Parse Question Using list()

2009-10-01 Thread c...@hosting4days.com


On Oct 1, 2009, at 5:02 PM, Ben Dunlap wrote:


You could tackle this in a couple of different ways. Either split your
string into an array first:

$line = fgets($handle);
$columns = explode(,, trim($line));


Thanks Ben - the explode() command worked great!

-

Now a bit of another problem

I'm exporting from another database (mac) to a csv file then a quick  
import to excel 2004 (mac) for some cleaning...


before the excel import, some date fields look like 2009-9-29  
11:21:37  = good for sql import


but excel does an auto reformat to

9/29/2009  11:21:37 AM = not good for sql import


Q: any way to turn this auto reformat off in excel and keep it the  
way I had it? (I saw nothing in pref's)



Thanks,
c...@hosting4days.com






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



[PHP] Mail Command Body Issue - Trying to use 'do while' loop

2009-09-12 Thread c...@hosting4days.com
I'm having a problem with  mail body issue trying to use 'do while'  
loop in the $mail_body var.


this line:
do { echo $row_get1['name'] } while ($row_get1 = mysql_fetch_assoc 
($get1))


will show ok when it's on the page elsewhere (not in the $mail_body  
var) but typed like:


--- ok on web page (not email)
?php do {
echo $row_get1['vt_name']; } while ($row_get1 = mysql_fetch_assoc 
($get1)); ?


Q: i want TEXT LOOP TEXT - AM I MISSING some syntax characters  
like(; or??) somewhere or 


THANKS for your help - dave

- full email code 

?php
$mail_body = test \n\n.test2.do { echo 'test' } while ($row_get1  
= mysql_fetch_assoc($get1)).Thanks

test xxx;  ?

?php
$Name = test; //senders name
$email = t...@test.com; //senders e-mail adress
$recipientname = t...@test.com;
$recipient = t...@test.com; //recipient
$subject = test.
$header = From: . $Name .   . $email . \r\n; //optional  
headerfields

$fullto = $recipientname .   . $recipient . ;
//$fullto = $recipientname .   . $recipient . ., .$recip2;
ini_set('sendmail_from', 't...@test.com');

mail($fullto, $subject, $mail_body, $header); //mail command :)
?



Thanks,
c...@hosting4days.com






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



Re: [PHP] Mail Command Body Issue - Trying to use 'do while' loop

2009-09-12 Thread c...@hosting4days.com


On Sep 12, 2009, at 3:47 PM, c...@hosting4days.com wrote:

I'm having a problem with  mail body issue trying to use 'do while'  
loop in the $mail_body var.


this line:
do { echo $row_get1['name'] } while ($row_get1 = mysql_fetch_assoc 
($get1))


will show ok when it's on the page elsewhere (not in the $mail_body  
var) but typed like:


--- ok on web page (not email)
?php do {
echo $row_get1['vt_name']; } while ($row_get1 = mysql_fetch_assoc 
($get1)); ?


Q: i want TEXT LOOP TEXT - AM I MISSING some syntax characters  
like(; or??) somewhere or 


THANKS for your help - dave



I got it working like this

?php

$loop1 = '';

do {
$loop1 = $loop1.\n.$row_get1['vt_name'].' - ';
} while ($row_get1 = mysql_fetch_assoc($get1));



$mail_body = test \n\n.test2 .$loop1.Thanks
test xxx;  ?


Q: is this the best way?





- full email code 

?php
$mail_body = test \n\n.test2.do { echo 'test' } while  
($row_get1 = mysql_fetch_assoc($get1)).Thanks

test xxx;  ?

?php
$Name = test; //senders name
$email = t...@test.com; //senders e-mail adress
$recipientname = t...@test.com;
$recipient = t...@test.com; //recipient
$subject = test.
$header = From: . $Name .   . $email . \r\n; //optional  
headerfields

$fullto = $recipientname .   . $recipient . ;
//$fullto = $recipientname .   . $recipient . ., .$recip2;
ini_set('sendmail_from', 't...@test.com');

mail($fullto, $subject, $mail_body, $header); //mail command :)
?



Thanks,
c...@hosting4days.com






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





Thanks,
c...@hosting4days.com






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



[PHP] Odd Endless Loop with Explorer 8 (pc)

2009-09-12 Thread c...@hosting4days.com

I have many of these tags on a site...

They work well with all browsers i've tested - except  explorer 8 (pc)

?php echo 'meta http-equiv=refresh content=0;page2.php'; ?

It just goes into an endless loop but stays on the original page -  
never going to page2.php



Q: Any idea how to fix this?




Thanks,
c...@hosting4days.com






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



Re: [PHP] Odd Endless Loop with Explorer 8 (pc)

2009-09-12 Thread c...@hosting4days.com


On Sep 12, 2009, at 7:57 PM, kranthi wrote:


?php echo 'meta http-equiv=refresh content=0;page2.php'; ?

may b u should have
?php echo 'meta http-equiv=refresh content=0;url=page2.php'; ?


Thanks kranthi  HallMarc Websites

url= ... - that did the trick!



Thanks,
c...@hosting4days.com






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



Re: [PHP] newbie - Is there a calendar module for date entry?

2009-07-22 Thread c...@hosting4days.com


On Jul 21, 2009, at 6:17 PM, Jonathan Tapicer wrote:


That is javascript thing, not PHP.

The Yahoo UI has a nice one, here you have an example:
http://developer.yahoo.com/yui/examples/calendar/ 
calcontainer_clean.html,

and here the module reference:
http://developer.yahoo.com/yui/calendar/

Jonathan

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



The Yahoo UI looks great.


On Jul 22, 2009, at 12:50 AM, Ashley Sheridan wrote:

When I do these sorts of things, I tend to use Tigra calendar. They do
two versions, the free and the pro version, but tbh, the free one does
everything you need. It's very easy to set up too.




Hi Ashley - the free one seems to be just the thing. - thanks

Thanks to all - They both look good - I'm checking them out now!

Another newbie question: storing dates and times...

I'm trying to build a simple notepad page where I can attach a date  
and even time field. So this Tigra or yahoo calendar will be great  
date picker helper.


This is for the US, so I'd like the user to see normal us formatting  
like:


date field -  7/1/2009 and separate time field like: 11:30 AM

mysql can use a DATE or TIME or datetime field type. and seems to use  
a different standard like: -MM-DD I want to to be able to do date  
calcs and such - so what is the best way (types) to store these  
fields in mysql and display them on the page with php?


I do know about some of the cool php functions like:

echo date('m-d-y g:i a', strtotime($row_this['myDate']));

so do I? ... store the date and time in separate fields then  
manipulate the display with php functions or???


- just looking for any favorite practices



--
Thanks - RevDave
Cool @ hosting4days . com
[db-lists 09]




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



[PHP] newbie - Is there a calendar module for date entry?

2009-07-21 Thread c...@hosting4days.com

newbie ...

- is there a calendar module for date fields?

- so that a small calendar pops up - then you can click on a date,   
to add to a field - like google or yahoo calendars has...?


BTW: I saw this - but it doesn't seem to be the right thing ( more  
meant for Converter issues) for what I'm looking for...


http://us2.php.net/manual/en/intro.calendar.php


--
Thanks - RevDave
Cool @ hosting4days . com
[db-lists 09]




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



[PHP] mod primary key field - newbie question

2009-07-13 Thread c...@hosting4days.com
newbie question ... I have a MySQL table where I want to update  
(renumber) the primary numeric key field.


- I successfully turned field off as a primary key index and UN auto  
incremented it

- then created new sequential numbers for it
- then turned back on primary key index and re added auto increment in


BUT when I make a new record it does NOT  start where new numbers stop

last is 51
next should be 52

but jumps to 157

Q: is there a way to reset the NEXT SERIAL ID NUMBER somewhere? how  
do I fix this?



--
Thanks - RevDave
Cool @ hosting4days . com
[db-lists 09]





[PHP] Add BCC parameter to mail()

2009-07-05 Thread c...@hosting4days.com

Hi folks - Newbie question...

Q: Is there a way to add BCC and/or CC parameters to this simple email  
function?


If there is a better way to do this - please let me know

Thanks in advance


?php
$Name = test; //senders name
$email = t...@test.com; //senders e-mail adress
$recipientname = test;
$recipient = j...@test.com; //recipient
$mail_body = test;
$subject = test;
$header = From: . $Name .   . $email . \r\n; //optional  
headerfields


$fullto = $recipientname .   . $recipient . ;

ini_set('sendmail_from', 't...@test.com');

mail($fullto, $subject, $mail_body, $header); //mail command :)
?


Thanks,
c...@hosting4days.com