Re: [PHP] Running script produces no output

2003-08-06 Thread Jacob Vennervald Madsen
Does the script work when you run it by hand?

Try to insert an echo TESTER in the top the shell script to make sure
something is sent to stdout. And then check in your php script that you
receive the message.

Best regards,
Jacob Vennervald

On Wed, 2003-08-06 at 08:38, Chris Blake wrote:
 Greetings learned PHP(eople);
 
 I have a small script sitting in my web directory which I have called
 upon as follows :
 
 ?php
 shell_exec('./info.sh');
 ?
 
 The script is not being run, yet I can do things like
 
 ?php
 $info=shell_exec('ls -l');
 echo 'pre$info/pre';
 ?
 
 ..which produce output to the browser...
 
 I have tried 'chown apache:apache info.sh' but this doesn`t change
 anything
 I have also tried using './info.sh' with no result
 
 Any pointers much appreciated as to why this won`t work. The permissions
 are as follows for the script file :
 
 -rwxrwxrwx1 root root 2456 Aug  5 16:35 info.sh
 
 Regards
 
 -- 
 Chris Blake
 Office : (011) 782-0840
 Cell : 083 985 0379
 
 Join the army, see the world, meet interesting, exciting people, and
 kill them.
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
-- 
Venlig hilsen / Best regards,
Jacob Vennervald
System Developer
Proventum Solutions ApS
Tuborg Boulevard 12
2900 Hellerup
Denmark
Phone:  +45 36 94 41 66
Mobile: +45 61 68 58 51



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



Re: [PHP] Displaying MySQL data inside of a table

2003-07-28 Thread Jacob Vennervald Madsen
Hi

Next time you can find a lot of information about this on www.php.net.
Check out this example:

?php

$conn = mysql_connect(localhost, mysql_user, mysql_password);

if (!$conn) {
echo Unable to connect to DB:  . mysql_error();
exit;
}

if (!mysql_select_db(mydbname)) {
echo Unable to select mydbname:  . mysql_error();
exit;
}

$sql = SELECT id as userid, fullname, userstatus 
FROM   sometable
WHERE  userstatus = 1;

$result = mysql_query($sql);

if (!$result) {
echo Could not successfully run query ($sql) from DB:  .
mysql_error();
exit;
}

if (mysql_num_rows($result) == 0) {
echo No rows found, nothing to print so am exiting;
exit;
}

// While a row of data exists, put that row in $row as an
associative array
// Note: If you're expecting just one row, no need to use a loop
// Note: If you put extract($row); inside the following loop, you'll
//   then create $userid, $fullname, and $userstatus
while ($row = mysql_fetch_assoc($result)) {
echo $row[userid];
echo $row[fullname];
echo $row[userstatus];
}

mysql_free_result($result);

?

Best regards,
Jacob Vennervald

On Mon, 2003-07-28 at 16:08, SP Computing wrote:
 Hi all,
 
 I have this code so far:
 
 ?
 
 mysql_connect(localhost, USER, PASS);
 mysql_select_db(DB);
 
 $result = mysql_query(SELECT * FROM tbl);
 
 ?
 
 Inside one of my tables, I have one field called IP which contains just over
 a thousand IP addresses. I would like these IP addresses to be displayed
 inside of a table like this:
 
 table border=1 cellpadding=5
 tr
 tdIP Address #1/td
 tdIP Address #2/td
 tdIP Address #3/td
 And so on...
 /tr
 /table
 
 How do I go about acheiving this?
 
 TIA,
 
 SP Computing
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
-- 
Venlig hilsen / Best regards,
Jacob Vennervald
System Developer
Proventum Solutions ApS
Tuborg Boulevard 12
2900 Hellerup
Denmark
Phone:  +45 36 94 41 66
Mobile: +45 61 68 58 51



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



Re: [PHP] a stupid question

2003-07-24 Thread Jacob Vennervald Madsen
Download it and then check it. But if you need to check a lot of files
that's probably to slow.

Jacob Vennervald

On Thu, 2003-07-24 at 06:03, Joe wrote:
 how to check the filetype of remote file
 because is_dir(), is_file() can't work on remote file
 thx a lot
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
-- 
Venlig hilsen / Best regards,
Jacob Vennervald
System Developer
Proventum Solutions ApS
Tuborg Boulevard 12
2900 Hellerup
Denmark
Phone:  +45 36 94 41 66
Mobile: +45 61 68 58 51



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



Re: [PHP] Array cookie

2003-07-22 Thread Jacob Vennervald Madsen
You could serialize your an array and save it in the cookie, but I would
also recommend using a session and then save the serialized array in
this instead.

Jacob Vennervald

On Tue, 2003-07-22 at 09:36, Curt Zirzow wrote:
 * Thus wrote Shantanu Oak ([EMAIL PROTECTED]):
  Hi, 
  I have written a feed reader for my personal use. The
  php code given below does work. But it works only with
  a single feed. How can I save multiple cookies
  (array?) and display a few more RSS feeds. The example
  page can be found at...
  http://shantanuoak.com/test1.php 
 
 I would not store the urls in a cookie, but use sessions. Cookies have
 limits on how long your data can be and how many you can have.
 
 If you insist on using cookies you have to set up cookie variables like
 
 FeedCookie1
 FeedCookie2
 ...
 
 I'm not sure if you can use the array method (like in a form) to access
 them.  Being that you have to set up variables like that it also make
 the program that much more complicated.
 
 HTH,
 
 
 
 Curt
 -- 
 I used to think I was indecisive, but now I'm not so sure.
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
-- 
Venlig hilsen / Best regards,
Jacob Vennervald
System Developer
Proventum Solutions ApS
Tuborg Boulevard 12
2900 Hellerup
Denmark
Phone:  +45 36 94 41 66
Mobile: +45 61 68 58 51



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



Re: [PHP] CLI php: how to use different php.ini file

2003-07-22 Thread Jacob Vennervald Madsen
php -c php.ini-file

Jacob Vennervald

On Tue, 2003-07-22 at 12:52, Jean-Christian IMbeault wrote:
 I am running some cronjob scripts that are written in PHP. However 
 things are not working as expected because my php.ini file auto-prepends 
 a file. This auto-prepending is meant for my PHP web pages and I don't 
 want it loaded when I run PHP from the command line.
 
 Is there a way from me to either use a different php.ini file for my CLI 
   PHP calls or to tell PHP *not* to auto-prepend the file?
 
 Thanks,
 
 Jean-Christian Imbeault
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
-- 
Venlig hilsen / Best regards,
Jacob Vennervald
System Developer
Proventum Solutions ApS
Tuborg Boulevard 12
2900 Hellerup
Denmark
Phone:  +45 36 94 41 66
Mobile: +45 61 68 58 51



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



Re: [PHP] Passing Serialized Array via Hidden field

2003-07-21 Thread Jacob Vennervald Madsen
Just tried it out and you should use htmlspecialchars() instead of
urlencode(). When you put it in a hidden field the browser is
responsable for urlencoding the data.

Jacob

On Mon, 2003-07-21 at 09:24, Andrei Verovski wrote:
 Hi,
 
 I am need to pass serialized assotiative array via form hidden field 
 (not GET or POST). In order to do it, I did the following: 
 urlencode(serialize($my_array)). However, after retrieving data from 
 hidden field and unserialize I've got junk.
 
 Someone can explain me what I did wrong?
 
 Also, do I need to do addslashes/stripslashes with serialized (or 
 encoded ?) data?
 
 Thanks in advance for any suggestion.
 
 
 *
 *   Best Regards   ---   Andrei Verovski
 *
 *   Personal Home Page
 *   http://snow.prohosting.com/guru4mac
 *   Mac, Linux, DTP, Development, IT WEB Site
 *
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
-- 
Venlig hilsen / Best regards,
Jacob Vennervald
System Developer
Proventum Solutions ApS
Tuborg Boulevard 12
2900 Hellerup
Denmark
Phone:  +45 36 94 41 66
Mobile: +45 61 68 58 51



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



[PHP] PHP code beautifier?

2003-07-17 Thread Jacob Vennervald Madsen
Hi List

Does anybody know any good PHP code beautifiers/formaters?
Preferably one which is configurable so I can specify the exact format I 
want.

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


Re: [PHP] Re: PHP code beautifier?

2003-07-17 Thread Jacob Vennervald Madsen
Thanks a lot.

Jacob Vennervald

On Thu, 2003-07-17 at 15:29, Joseph Szobody wrote:
 Jacob,
 
 http://www.tote-taste.de/X-Project/beautify/
 
 http://www.semdesigns.com/Products/Formatters/PHPFormatter.html
 
 http://www.trita.com/features/php-beautifier.jsp
 
 http://www.bierkandt.org/beautify/
 
 http://www.trita.com/
 
 http://www.beautifier.org/
 
 This should get you started. I think PHPEdit has a code beautifier feature too.
 
 Btw, I found all of these on the first two pages of a simple Google search. Might be 
 worth trying in the future. :-)
 
 Joseph
 
 Jacob Vennervald Madsen [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]
  Hi List
  
  Does anybody know any good PHP code beautifiers/formaters?
  Preferably one which is configurable so I can specify the exact format I 
  want.
  
  Cheers,
  Jacob Vennervald
  
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
-- 
Venlig hilsen / Best regards,
Jacob Vennervald
System Developer
Proventum Solutions ApS
Toldbodgade 51C
1253 Copenhagen K
Denmark
Phone:  +45 33 45 43 61
Mobile: +45 61 68 58 51


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



Re: [PHP] Re: PHP code beautifier?

2003-07-17 Thread Jacob Vennervald Madsen
Actually I did search Google first and I did get the same results you
got. But what I was looking for was actually not a list of different
beautifiers but comments from developers having experience with a
specific beautier that they find does the job well.

Jacob Vennervald

On Thu, 2003-07-17 at 15:40, John Manko wrote:
 I really think that this depends on the topic.  I know that if I'm 
 looking for an editor (esp for a language just starting in), I can 
 search google all day, but end up with a list full of fud.  In 
 situations like this, I would prefer to go straight to the source and 
 ask the people who have put most editors for that languange to the test, 
 and sometimes that means I need to post to a mailing list.  Now, I''m 
 not saying that you don't have a point (All too often people ask without 
 even trying to find the answer themselves. I sometimes find myself doing 
 this, and it's a shame becuase there is so much information a person 
 misses out on that he/she would not normally be exposed to.), but you 
 have to ask yourself A beginner, or a veteran?  Othertimes, I just 
 want to be sure I didn't miss something that would be ideal.  I don't 
 know...just my .02.
 
 Joseph Szobody wrote:
 
 Btw, I found all of these on the first two pages of a simple Google search. Might 
 be worth trying in the future. :-)
 
   
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
-- 
Venlig hilsen / Best regards,
Jacob Vennervald
System Developer
Proventum Solutions ApS
Toldbodgade 51C
1253 Copenhagen K
Denmark
Phone:  +45 33 45 43 61
Mobile: +45 61 68 58 51


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