Fwd: [PHP] Error Handling

2005-09-09 Thread Pablo M. Rivas
Hello Chuck
On 9/9/05, Chuck Brockman [EMAIL PROTECTED] wrote:
 What is a good way to capture errors that occur.  I've tried the
 following code in development, but it still spits out an error (Parse
 error: syntax error, unexpected '}', expecting ',' or ';' in
 X:\\\.php on line 7)

 ?
 // error handling test

 try{
  $test = 1;
  echo $test1
 }

Ooppsss
You're missing a ;

yoy might:
echo $test1;
}

Good luck
--
Pablo M. Rivas. http://www.pmrivas.com http://www.r3soft.com.ar
---

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



Re: [PHP] upload image file to my server

2005-03-31 Thread Pablo M. Rivas
Hello Tomas:
take a look at:
 http://www.php.net/manual/en/features.file-upload.php

and for an example, take a look at.
http://www.tek-tips.com/faqs.cfm?fid=5699

Good Luck.


On Thu, 31 Mar 2005 17:48:37 -0800, Tomás Rodriguez Orta
[EMAIL PROTECTED] wrote:
 Hello, hard people.
 
 I want to do this, I like to upload image file,
 What can I do?.
 
 somebody help me.?
 
 best regards TOMAS
 
 -
 Este correo fue escaneado en busca de virus con el MDaemon Antivirus 2.27
 en el dominio de correo angerona.cult.cu  y no se encontro ninguna 
 coincidencia.
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


-- 
Pablo M. Rivas. http://www.pmrivas.com http://www.r3soft.com.ar
---

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



Re: [PHP] a better way for the array

2005-02-18 Thread Pablo M. Rivas
Hello Merlin:
take a look to http://www.php.net/manual/en/language.types.array.php

$para[5]=array('txt' = 'Europe'.$continent['name'],
'link' = '/'.$continent[name].'.htm',
'title' = 'Europe - Continent overview');
$para[]=array('txt' = 'America'.$continent['name'],
'link' = '/'.$continent[name].'.htm',
'title' = 'America- Continent overview');
$para[] will be 6,7,8,9... and so on


On Fri, 18 Feb 2005 13:52:29 +0100, Merlin [EMAIL PROTECTED] wrote:
 Marek Kilimajer wrote:
  Merlin wrote:
 
  Hi there,
 
  I am wondering if there is a nicer way to save the data into an array
  than I do.
 
  I do have a 2 dimensional array $para.
 
  Currently I go like this:
 
  $para[1][txt] = 'Europe'.$continent[name];
  $para[1][link] = '/'.$continent[name].'.htm';
  $para[1][title] = 'Europe - Continent overview';
  $para[2][txt] = $country;
  $para[2][link] = '/'.$continent[name].'.htm';
  $para[2][title] = $country;
 
  That becomes really difficult if you have more of them, and you want
  to reorganize the ordering. Then you have to rename all numbers.
 
  Is there a nicer way to do that?
 
  Thank you for any hint,
 
  Merlin
 
 
  $para = array();
 
  $para[] = array('txt' = 'Europe'.$continent['name'],
  'link' = '/'.$continent[name].'.htm',
  'title' = 'Europe - Continent overview');
 
  $para[] = array('txt' = $country,
  'link' = '/'.$continent[name].'.htm',
  'title' = $country);
 
 Thanx that is much better.
 
 However I have to start the array with 1 instead of 0
 and I cant remember and find the proper syntax. It was something like: 
 array(=1
 
 What was that again?
 
 Thanx, Merlin
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


-- 
Pablo M. Rivas. http://www.pmrivas.com http://www.r3soft.com.ar
---

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



Re: [PHP] help me

2005-02-18 Thread Pablo M. Rivas
http://www.php.net/date


On Fri, 18 Feb 2005 12:07:14 +0530, K Karthik [EMAIL PROTECTED] wrote:
 i am so surprised for the immediate reply.thank you so much.
 i'll be thank ful again if you could help me finding the current date
 and time using php.
 thanks,
 karthik
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


-- 
Pablo M. Rivas. http://www.pmrivas.com http://www.r3soft.com.ar
---

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



Re: [PHP] php upload script problems

2004-09-25 Thread Pablo M. Rivas
Hello:
 When you want to know where is your error, set: error_reporting(E_ALL);
http://www.php.net/manual/en/function.error-reporting.php

the error is here:

case upload:

echohtmlheadtitleFile Upload/title/headbodyform method=POST
action=$PHP_SELF?action=doupload enctype=multipart/form-data
ID=Form1pFile to upload:brinput type=file name=file size=30
ID=File1;

you might change :
   ID=Form1
and ID=File1

for :

  ID=\Form1\
and ID=\File1\

echohtmlheadtitleFile Upload/title/headbodyform method=POST
action=$PHP_SELF?action=doupload enctype=multipart/form-data
ID=\Form1\pFile to upload:brinput type=file name=file size=30
ID=\File1\;

Good Luck!

On Fri, 24 Sep 2004 16:01:48 -0700, AMC [EMAIL PROTECTED] wrote:
 Hi,
 
 I have the following php page. The page just opens up blank and I assume I
 made an error I cannot see. I'm new to php and any help would  be greatly
 appreciated:
 
 ?php
 
 $extlimit = yes; //Do you want to limit the extensions of files uploaded
 
 $limitedext = array(.pdf); //Extensions you want files uploaded limited
 to.
 
 $sizelimit = no; //Do you want a size limit, yes or no?
 
 $sizebytes = 20; //size limit in bytes
 
 $dl = http://www.corrige2.bluehill.com/pdfs;; //url where files are
 uploaded
 
 $absolute_path = http://www.corrige2.bluehill.com/pdfs;; //Absolute path to
 where files are uploaded
 
 $websiteurl = http://www.corrige2.bluehill.com;; //Url to you website
 
 $websitename = Corrigent;
 
 switch($action) {
 
 default:
 
 echo htmlheadtitleUpload Or Download/title/headbodya
 href=$PHP_SELF?action=uploadUpload File/a a
 href=$PHP_SELF?action=downloadDownload File/a;
 
 echo a href=$websiteurlReturn to $websitename/abrbrPowered by PHP
 Uploader Downloader/a/body/html;
 
 break;
 
 case download:
 
 echo htmlheadtitleFile Download/title/headbodya
 href=$PHP_SELF?action=uploadUpload File/a a href=$websiteurlReturn to
 $websitename/a;
 
 $list = table width=700 border=1 bordercolor=#00
 style=\border-collapse: collapse\;
 
 $list .= trtd width=700centerbClick To
 Download/b/center/td/tr;
 
 $dir = opendir($absolute_path);
 
 while($file = readdir($dir)) {
 
 if (($file != ..) and ($file != .)) {
 
 $list .= trtd width=700a
 href='$dl/$file'$file/a/center/td/tr;
 
 }
 
 }
 
 $list .= /table;
 
 echo $list;
 
 echobrbrPowered by PHP Uploader Downloader/a/body/html;
 
 break;
 
 case upload:
 
 echohtmlheadtitleFile Upload/title/headbodyform method=POST
 action=$PHP_SELF?action=doupload enctype=multipart/form-data
 ID=Form1pFile to upload:brinput type=file name=file size=30
 ID=File1;
 
 echopbutton name=submit type=submit
 ID=Button1Upload/button/formbrbrPowered by PHP Uploader
 Downloader/a/body/html;
 
 break;
 
 //File Upload
 
 case doupload:
 
 $dir = dir;
 
 if ($file != ) {
 
 if (file_exists($absolute_path/$file_name)) {
 
 die(File already exists);
 
 }
 
 $ext = strrchr($file_name,'.');
 
 if (($extlimit == yes)  (!in_array($ext,$limitedext))) {
 
 die(The file you are uploading doesn't have the correct extension.);
 
 }
 
 @copy($file, $absolute_path/$file_name) or die(The file you are trying to
 upload couldn't be copied to the server);
 
 } else {
 
 die(Must select file to upload);
 
 }
 
 echo htmlheadtitleFile Uploaded/title/headbody;
 
 echo $file_name. was uploaded;
 
 echo bra href=$PHP_SELF?action=uploadUpload Another File/aa
 href=$PHP_SELF?action=download Download File/aa href=$websiteurl Return
 to $websitename/abrbrPowered by a href=http://www.zachwhite.com/PHP
 Uploader Downloader/a/body/html;
 
 break;
 
 }
 
 ?
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 



-- 
Pablo M. Rivas. http://pmrivas.ipupdater.com http://www.r3soft.com.ar
---

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



Re: [PHP] problem with header(Location:home.php)

2004-09-09 Thread Pablo M. Rivas
look the line 3 of connection.php
Good luck


On Wed, 8 Sep 2004 16:43:54 -0700, CBharadwaj
[EMAIL PROTECTED] wrote:
 Hello,
 
 In conection.php I have written.
SESSION_ START();
 
 on successful login I am registering a session variable.
SESSION_REGISTER(userId);
 
 on login failure  I am redirecting to home page.
 Header(Location: home.php);
 
 the following error occuring in above line.
 Warning: Cannot modify header information - headers already sent by
 (output started at E:\PHPMySql scripts\bugtrack\connection.php:3)
 in E:\PHPMySql scripts\bugtrack\index.php on line 117
 
 the connection file I have included in every page.
 why this error is occuring?
 
 Bharadwaj
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 



-- 
Pablo M. Rivas. http://pmrivas.ipupdater.com
---

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



Re: [PHP] PHP5 - How Do I Let Users Download Music Files?

2004-09-06 Thread Pablo M. Rivas
Take a look at:
http://netjuke.sourceforge.net/

I'm using in my local network, and works fine!!!


On Mon, 06 Sep 2004 12:10:13 +0300, Burhan Khalid [EMAIL PROTECTED] wrote:
 
 
 On Sun, 2004-09-05 at 05:41, [EMAIL PROTECTED] wrote:
 
  I want to build a music site, all copyrights intact, and I want users to be
  able to download mp3 or realplayer files using a one-click link. When they
  click on a link they will simply be given a typical download window to save
  that music file. How do I go about doing that and how should my file
  structure work? What should the link include? Is it possible to just say,
  for example, http://somesite.com/music/something.mp3? Also, if I wanted them
  to listen to streamed music does PHP have any specialized functions I could
  use to achieve that? I just need some direction. Any help would be
  appreciated. Thank you.
 
 For the downloading part, Google php force download. If you just give
 the users a link (like in your example) there is nothing that's stopping
 them from simply requesting the URL. I would suggest you store the files
 outside your webroot and then have PHP access them (this way, Apache
 can't see them).
 
 Listening to streaming music really doesn't have much to do with PHP.
 You would need a streaming server (like Windows Media Services, or the
 open source Darwin Streaming Server (from Apple)).  Other options
 include shoutcast, real media, etc.
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 



-- 
Pablo M. Rivas. http://pmrivas.ipupdater.com
---

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



Re: [PHP] Good news for each develper

2004-09-04 Thread Pablo M. Rivas
HE with 1 mail we understand...

;=)



On Sat, 4 Sep 2004 12:36:11 GMT, Manoj Kumar [EMAIL PROTECTED] wrote:
 hi dear developers,
 
   We developed a module in (php_home/ext/) with name daffodildb , This 
 module will provide connectivity to DaffodilDB (A Pure Java RDBMS) . But I don't 
 know , what is procedure to include a new module in php source(php cvs ) , so it 
 will available free to developers with php source. Can anybody suggest me.
 
 Reagards,
 Manoj Kr. Sheoran
 Software Engg.
 SCO-42 ,3rd Floor
 OJC, Civil Lines
 Gurgoan (HARYANA)
 INDIA
 mailto: [EMAIL PROTECTED]
 www.daffodildb.com
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 



-- 
Pablo M. Rivas. http://pmrivas.ipupdater.com
---

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



Re: [PHP] using 'while' without stopping the script from processing, Please help!

2004-09-04 Thread Pablo M. Rivas
On Fri, 3 Sep 2004 21:48:56 +0100, Mark Clarkstone [EMAIL PROTECTED] wrote:
 Hi, I'm making an MSN bot in PHP  the only way to receive data is to
 loop over each socket, the only problem is that while its looping its
 stopping the rest of the script from being run at the same time.
 Is there anyway I can Process each socket without stopping the script,

Mark: for unix/linux: http://www.php.net/manual/en/ref.pcntl.php
and in this page you'll find examples, and a tip for PHP-CLI onWin32 




-- 
Pablo M. Rivas. http://pmrivas.ipupdater.com
---

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



Re: [PHP] importing DBF data into mysql

2004-09-02 Thread Pablo M. Rivas
Let's try this:
?php
$db=dbase_open ( path/to/file.dbf,0 );
$nr = dbase_numrecords($db);
echo File opened with $nr recordsbr\n;
$temp = dbase_get_record($db,$i);
print_r($temp);
?

this simple program should show you the fields of the record 1 of the file.
if it works, let us know

Pablo.

On Thu, 02 Sep 2004 08:40:51 -0400, PHP Junkie [EMAIL PROTECTED] wrote:
 Ave,
 
 This is undoubtedly exactly what I was looking for. What I don't understand
 is why its' not converting my DBF file. It gives a Could not read File
 error. It reads the dbf file that came with the script. I'm still trying to
 figure it out but it won't work...
 
 Thanks though.
 
 
 
 
 On 9/1/04 6:52 PM, Thornton [EMAIL PROTECTED] wrote:
 
  This is probably what your looking for
 
  http://www.coolnet.cz/miro/dbf2mysql/dbf2mysql.tar.bz2
 
  It should handle your needs
 
  On Wed, 2004-09-01 at 14:08, PHP Junkie wrote:
  Ave,
 
  Is there a PHP script that is able to import or convert DBF data into mySQL
  tables?
 
  I need to get my DBF data into mySQL and PHPMyAdmin couldn't handle it.
  Another problem I have is I'm running a MAC OS X... There is a very simple
  and efficient DBF2MYSQL program for windows but not for MAC.
 
  I did see somewhere a PHP script that could do it, but I don't know where.
 
  Thanks.
  --
  - Thornton [EMAIL PROTECTED] -
  - Cierra Grouphttp://www.cierragroup.com -
  --
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


-- 
Pablo M. Rivas. http://pmrivas.ipupdater.com
---

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



Re: [PHP] ftp functions not working

2004-09-02 Thread Pablo M. Rivas
mhhh.. try this:
#!/usr/local/bin/php
?
phpinfo();
?

and look on the console if you see ftp enabled...
¿do you have only ONE PHP INSTALL IN YOUR BOX?.. or two?


On Thu, 02 Sep 2004 09:43:27 -0500, Cory D. Wiles [EMAIL PROTECTED] wrote:
 I am writing some backup scripts that will ftp my *.gz files to my ftp
 server. Unfortunately I didn't originally install php with ftp support
 (oversight on my part). I reconfigured/installed PHP with --enable-ftp
 and restarted everything, but the functions still don't work.
 
 #!/usr/local/bin/php
 ?
 if (function_exists('ftp_connect')):
   print cool\n;
 else:
   print damn\n;
 endif;
 ?
 output when ran: 'Damn'
 
 During the make I didn't see any errors.  When I ran phpinfo()
 [http://www.randomthoughtprocess.com/info.php] it shows that I have FTP
 support. Is there something that I am missing?
 --
 Cory Wiles
 Systems Engineer
 ePerformax - Memphis, TN
 901.751.4902
 http://www.eperformax.com
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


-- 
Pablo M. Rivas. http://pmrivas.ipupdater.com
---

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