php-general Digest 25 May 2010 13:56:07 -0000 Issue 6763

2010-05-25 Thread php-general-digest-help

php-general Digest 25 May 2010 13:56:07 - Issue 6763

Topics (messages 305494 through 305503):

Re: editing a file
305494 by: Rene Veerman
305495 by: Andres Gonzalez
305496 by: Ryan Sun
305497 by: shiplu

Re: Remove blank lines from a file
305498 by: tedd

Re: Dynamic Menus in a PHP Form Issue
305499 by: tedd
305500 by: Arno Kuhl

COM/DCOM
305501 by: Mayer, Jonathan

Re: exec in different directory where PHP is Installed
305502 by: loki

determining time difference between two timestamp fields.
305503 by: Bruce Gilbert

Administrivia:

To subscribe to the digest, e-mail:
php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
php-gene...@lists.php.net


--
---BeginMessage---
On Mon, May 24, 2010 at 11:16 PM, Andres Gonzalez
and...@packetstorm.com wrote:
 I have a large C source file that is generated by a separate
 source-generating program. When the generated src file is compiled, it
 produces tons of warnings. I want to edit the generated src file and delete
 the offending lines.

 What is the easiest way using a PHP script to read in a file, search for a
 particular signature, and delete a couple of lines? Seems like this would be
 very easy in PHP.

file_get_contents() to get the file into a $string.

preg_match_all(,,$matches) to get to what you need,

str_replace() to replace $matches with your chosen replacements

and there you are :)

file_put_contents() to save the results..


 Thanks,

 -Andres

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





-- 
-
Greetings from Rene7705,

My free open source webcomponents:
  http://code.google.com/u/rene7705/
  http://mediabeez.ws/downloads (and demos)

http://www.facebook.com/rene7705
-
---End Message---
---BeginMessage---

thank you Rene, that is the start I needed.

-Andres


Rene Veerman wrote:

On Mon, May 24, 2010 at 11:16 PM, Andres Gonzalez
and...@packetstorm.com wrote:
  

I have a large C source file that is generated by a separate
source-generating program. When the generated src file is compiled, it
produces tons of warnings. I want to edit the generated src file and delete
the offending lines.

What is the easiest way using a PHP script to read in a file, search for a
particular signature, and delete a couple of lines? Seems like this would be
very easy in PHP.



file_get_contents() to get the file into a $string.

preg_match_all(,,$matches) to get to what you need,

str_replace() to replace $matches with your chosen replacements

and there you are :)

file_put_contents() to save the results..

  

Thanks,

-Andres

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







  
---End Message---
---BeginMessage---
yea, file_get_contents and file_put_contents are the easiest, but play
with caution when dealing with large files, 'cause it loads the whole
file into memory, fopen() fread() fwrite() can be used for large
files.

On Mon, May 24, 2010 at 5:56 PM, Rene Veerman rene7...@gmail.com wrote:
 On Mon, May 24, 2010 at 11:16 PM, Andres Gonzalez
 and...@packetstorm.com wrote:
 I have a large C source file that is generated by a separate
 source-generating program. When the generated src file is compiled, it
 produces tons of warnings. I want to edit the generated src file and delete
 the offending lines.

 What is the easiest way using a PHP script to read in a file, search for a
 particular signature, and delete a couple of lines? Seems like this would be
 very easy in PHP.

 file_get_contents() to get the file into a $string.

 preg_match_all(,,$matches) to get to what you need,

 str_replace() to replace $matches with your chosen replacements

 and there you are :)

 file_put_contents() to save the results..


 Thanks,

 -Andres

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





 --
 -
 Greetings from Rene7705,

 My free open source webcomponents:
  http://code.google.com/u/rene7705/
  http://mediabeez.ws/downloads (and demos)

 http://www.facebook.com/rene7705
 -

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


---End Message---
---BeginMessage---
You can use shell commands.
Like sed, replace etc ..


Shiplu Mokadd.im
My talks, http://talk.cmyweb.net
Follow me, http://twitter.com/shiplu
SUST Programmers, http://groups.google.com/group/p2psust
Innovation distinguishes bet ... ... (ask Steve Jobs the rest)
---End Message---
---BeginMessage---

At 2:39 PM -0400 5/24/10, Robert Cummings wrote:
-snip- It 

RE: [PHP] Dynamic Menus in a PHP Form Issue

2010-05-25 Thread Arno Kuhl
-Original Message-
From: Alice Wei [mailto:aj...@alumni.iu.edu] 
Sent: 24 May 2010 04:47 PM
To: php-general@lists.php.net
Subject: [PHP] Dynamic Menus in a PHP Form Issue

Hi,I have a snippet as in the following:   ul
liSelect the type of your starting point of interest:br/
div id=start_menuform action= name=form1 method=post
spaninput type=radio value=Apartment name=start
onclick=alert(document.form1.start)/ Apartment /span
/form/div/li/ulIf I tried to put this at the top of a
file where I save as PHP with other PHP execution statements, looks like the
form does not do anything, and yet when I save the page as in HTML with out
the other PHP execution, it works. I am trying to create a page where I have
dynamic drop down menu lists so users can egenerate dynamic content based on
their preference. Is it possible that I can save the entire file as a PHP
and still keep the functionality, including generating dynamic menus,
writing the proper entries to the database and printing out the proper
output?

Thanks for your help. 

Alice 
_

The reason it works in html is because it is executed in the browser. If
you want this html to get to the browser you must either echo it to the
output buffer that is sent to the browser, or end your php section with ?
so that these lines are interpreted as part of the output that is sent to
the browser.

If your php script is running without error then I presume you're already
doing this. If that's the case then maybe it's not being put into the output
buffer the way you're expecting (e.g. maybe the quotes don't match). You can
look at the source code in the browser and compare it against the working
html code to see where the difference is.

Cheers
Arno



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



[PHP] COM/DCOM

2010-05-25 Thread Mayer, Jonathan
Hello,

 

I'm trying to write a few scripts to help automate some Windows
administration tasks. One of these is to add people to groups on
different networked machines.

 

I've written something like the following:

 

?php

$computer = TestComputer;

$groupName = TestGroup;

$server_config = array('Server' = TestComputer' , 'Username' =
'TestUser' , 'Password' = 'TestPass');

// list all current group members

$domainObject = new
COM(WinNT://.$computer./.$groupName.,group,$server_config) or
die(Cannot create COM object);

foreach ($domainObject-Members as $var)

{

  echo $var-Name.br;

}

// add person to group

$usertoadd = APerson;

$domainUser = new
COM(WinNT://DOMAIN/.$usertoadd.,user,$server_config) or die(Cannot
create COM object );

$domainObject-Add($domainUser-ADsPath);

 

?

 

TestUser is a local administrative account on TestComputer.

 

If I run apache using the standard local system account, the code lists
the members of the group but refuses to add APerson. If I run apache
with a domain administrator account it works fine, but I don't want to
do this - I want to be able to pass the username and password of an
account on the target machine that has permissions set up for this
purpose.

 

I've tried making changes using dcomcnfg on the target machine, but no
luck so far. 

 

Does anyone have any experience in using COM functions and can spot
anything I'm doing wrong or a misunderstanding in how it works?

 

Thanks,

Jon

 

-

This e-mail does not reflect the views or opinions of Travellers Tales
(UK) Ltd or any other related TT Games group company.

 



Re: [PHP] exec in different directory where PHP is Installed

2010-05-25 Thread loki

I have a begin of explanation

When PHP is run as CGI it's work but with this header message :

'\\xxx.xxx.xxx.xxx\scriptdir'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported.  Defaulting to Windows directory.
Status: 200 OK
X-Powered-By: PHP/5.2.8
Content-type: text/html

@exec function work well


Now when PHP is run as a FAST-CGI then it's not work at
ALL (ie: just the @exec function not work, the other work ok!)


is it a normal behavior ?

thanks you by advance
stephane



On 5/24/2010 11:42 PM, Bob McConnell wrote:

From: loki


On 5/24/2010 11:31 PM, Bob McConnell wrote:

From: loki


PHP is installed in c:\program files\php
the PHP script are in network drive \\xxx.xxx.xxx.xxx\scriptdir\
in the PHP script, we try to launch the command @exec(...) with a
executable located in c:\program files\ourexecutable\

it's not work :(

but if we move the PHP script from \\xxx.xxx.xxx.xxx\scriptdir\
to c:\scriptdir\ then it's work !!

everything work good EXCEPT the @EXEC command ...


Is 'C:\Program Files\PHP' in your PATH? You may need to add that
manually.


no ? but why i would need to add C:\Program Files\PHP in my path ?
why it's explain that it's work when the php script are located in any



directory under c: and not under \\xxx.xxx.xxx.xxx\scriptdir\ ??


What is the exact error message you get when it doesn't work?

Bob McConnell



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



[PHP] determining time difference between two timestamp fields.

2010-05-25 Thread Bruce Gilbert
Here is the situation. I have a form which sets a timestamp when a
user logs in using UPDATE in SQL. The field is called
'login_timestamp' and is in a table called 'Candidates'. I have
another timestamp which is set when a user submits the form data into
the DB and it is called 'submit_timestamp' . What I want to do is
determine the amount of time the user takes to complete the form by
subtracting the 'login_timestamp' time form the 'submit_timestamp'
time. I am using SQL to extract the data here.

$sql = SELECT Responses.name,Answers,submit_timestamp,login_timestamp
   FROM Responses LEFT JOIN Candidates USING (user_id);

and then to display the timestamp in readable form.

echo trthCompletion Time:/th/trtrtd . date('F j, Y
g:i:sa', strtotime($row[login_timestamp])) . /td/tr;

so I need to know how to subtract from two timestamp fields, two
different tables and come up with the difference in minutes.


thanks.

-- 
::Bruce::

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



Re: [PHP] determining time difference between two timestamp fields.

2010-05-25 Thread Peter Lind
On 25 May 2010 15:55, Bruce Gilbert webgu...@gmail.com wrote:
 Here is the situation. I have a form which sets a timestamp when a
 user logs in using UPDATE in SQL. The field is called
 'login_timestamp' and is in a table called 'Candidates'. I have
 another timestamp which is set when a user submits the form data into
 the DB and it is called 'submit_timestamp' . What I want to do is
 determine the amount of time the user takes to complete the form by
 subtracting the 'login_timestamp' time form the 'submit_timestamp'
 time. I am using SQL to extract the data here.

 $sql = SELECT Responses.name,Answers,submit_timestamp,login_timestamp
           FROM Responses LEFT JOIN Candidates USING (user_id);

 and then to display the timestamp in readable form.

 echo trthCompletion Time:/th/trtrtd . date('F j, Y
 g:i:sa', strtotime($row[login_timestamp])) . /td/tr;

 so I need to know how to subtract from two timestamp fields, two
 different tables and come up with the difference in minutes.


In case you're using MySQL, timediff can do the job:
http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_timediff

Otherwise, just do strtotime(endtime) - strtotime(starttime) / 60.
That's the difference in minutes.

Regards
Peter


-- 
hype
WWW: http://plphp.dk / http://plind.dk
LinkedIn: http://www.linkedin.com/in/plind
BeWelcome/Couchsurfing: Fake51
Twitter: http://twitter.com/kafe15
/hype

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



Re: [PHP] determining time difference between two timestamp fields.

2010-05-25 Thread Bruce Gilbert
Thanks. I know my syntax isn't quite right, but is this close to what
I need to do?

echo trthCompletion Time:/th/trtrtd . date('F j, Y
g:i:sa', strtotime($row[login_timestamp] - [submit_timestamp])/60)
. /td/tr;



On Tue, May 25, 2010 at 10:01 AM, Peter Lind peter.e.l...@gmail.com wrote:
 On 25 May 2010 15:55, Bruce Gilbert webgu...@gmail.com wrote:
 Here is the situation. I have a form which sets a timestamp when a
 user logs in using UPDATE in SQL. The field is called
 'login_timestamp' and is in a table called 'Candidates'. I have
 another timestamp which is set when a user submits the form data into
 the DB and it is called 'submit_timestamp' . What I want to do is
 determine the amount of time the user takes to complete the form by
 subtracting the 'login_timestamp' time form the 'submit_timestamp'
 time. I am using SQL to extract the data here.

 $sql = SELECT Responses.name,Answers,submit_timestamp,login_timestamp
           FROM Responses LEFT JOIN Candidates USING (user_id);

 and then to display the timestamp in readable form.

 echo trthCompletion Time:/th/trtrtd . date('F j, Y
 g:i:sa', strtotime($row[login_timestamp])) . /td/tr;

 so I need to know how to subtract from two timestamp fields, two
 different tables and come up with the difference in minutes.


 In case you're using MySQL, timediff can do the job:
 http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_timediff

 Otherwise, just do strtotime(endtime) - strtotime(starttime) / 60.
 That's the difference in minutes.

 Regards
 Peter


 --
 hype
 WWW: http://plphp.dk / http://plind.dk
 LinkedIn: http://www.linkedin.com/in/plind
 BeWelcome/Couchsurfing: Fake51
 Twitter: http://twitter.com/kafe15
 /hype




-- 
::Bruce::

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



Re: [PHP] determining time difference between two timestamp fields.

2010-05-25 Thread Peter Lind
On 25 May 2010 16:14, Bruce Gilbert webgu...@gmail.com wrote:
 Thanks. I know my syntax isn't quite right, but is this close to what
 I need to do?

 echo trthCompletion Time:/th/trtrtd . date('F j, Y
 g:i:sa', strtotime($row[login_timestamp] - [submit_timestamp])/60)
 . /td/tr;


No. Assuming that your timestamp is of the -mm-dd HH:ii:ss form,
you need to do (strtotime([submit_timestamp]) -
strtotime($row[login_timestamp]))/60.

Regards
Peter


 On Tue, May 25, 2010 at 10:01 AM, Peter Lind peter.e.l...@gmail.com wrote:
 On 25 May 2010 15:55, Bruce Gilbert webgu...@gmail.com wrote:
 Here is the situation. I have a form which sets a timestamp when a
 user logs in using UPDATE in SQL. The field is called
 'login_timestamp' and is in a table called 'Candidates'. I have
 another timestamp which is set when a user submits the form data into
 the DB and it is called 'submit_timestamp' . What I want to do is
 determine the amount of time the user takes to complete the form by
 subtracting the 'login_timestamp' time form the 'submit_timestamp'
 time. I am using SQL to extract the data here.

 $sql = SELECT Responses.name,Answers,submit_timestamp,login_timestamp
           FROM Responses LEFT JOIN Candidates USING (user_id);

 and then to display the timestamp in readable form.

 echo trthCompletion Time:/th/trtrtd . date('F j, Y
 g:i:sa', strtotime($row[login_timestamp])) . /td/tr;

 so I need to know how to subtract from two timestamp fields, two
 different tables and come up with the difference in minutes.


 In case you're using MySQL, timediff can do the job:
 http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_timediff

 Otherwise, just do strtotime(endtime) - strtotime(starttime) / 60.
 That's the difference in minutes.

 Regards
 Peter


 --
 hype
 WWW: http://plphp.dk / http://plind.dk
 LinkedIn: http://www.linkedin.com/in/plind
 BeWelcome/Couchsurfing: Fake51
 Twitter: http://twitter.com/kafe15
 /hype




 --
 ::Bruce::




-- 
hype
WWW: http://plphp.dk / http://plind.dk
LinkedIn: http://www.linkedin.com/in/plind
BeWelcome/Couchsurfing: Fake51
Twitter: http://twitter.com/kafe15
/hype

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



Re: [PHP] determining time difference between two timestamp fields.

2010-05-25 Thread Bruce Gilbert
Here is what I currently have.

echo trthCompletion Time:/th/trtrtd .
(strtotime($row['submit_timestamp']) -
strtotime($row['login_timestamp']))/60 , /td/tr;

this gives me an output of 21235172.75

not sure what format that is in? I was hoping for something like 60
minutes, 30 minutes etc. Don't need the days or seconds. The MySQL
timestamp is in this format.

2010-05-17 11:32:45 - 2010-05-17 12:26:13

On Tue, May 25, 2010 at 11:11 AM, Peter Lind peter.e.l...@gmail.com wrote:
 On 25 May 2010 16:14, Bruce Gilbert webgu...@gmail.com wrote:
 Thanks. I know my syntax isn't quite right, but is this close to what
 I need to do?

 echo trthCompletion Time:/th/trtrtd . date('F j, Y
 g:i:sa', strtotime($row[login_timestamp] - [submit_timestamp])/60)
 . /td/tr;


 No. Assuming that your timestamp is of the -mm-dd HH:ii:ss form,
 you need to do (strtotime([submit_timestamp]) -
 strtotime($row[login_timestamp]))/60.

 Regards
 Peter


 On Tue, May 25, 2010 at 10:01 AM, Peter Lind peter.e.l...@gmail.com wrote:
 On 25 May 2010 15:55, Bruce Gilbert webgu...@gmail.com wrote:
 Here is the situation. I have a form which sets a timestamp when a
 user logs in using UPDATE in SQL. The field is called
 'login_timestamp' and is in a table called 'Candidates'. I have
 another timestamp which is set when a user submits the form data into
 the DB and it is called 'submit_timestamp' . What I want to do is
 determine the amount of time the user takes to complete the form by
 subtracting the 'login_timestamp' time form the 'submit_timestamp'
 time. I am using SQL to extract the data here.

 $sql = SELECT Responses.name,Answers,submit_timestamp,login_timestamp
           FROM Responses LEFT JOIN Candidates USING (user_id);

 and then to display the timestamp in readable form.

 echo trthCompletion Time:/th/trtrtd . date('F j, Y
 g:i:sa', strtotime($row[login_timestamp])) . /td/tr;

 so I need to know how to subtract from two timestamp fields, two
 different tables and come up with the difference in minutes.


 In case you're using MySQL, timediff can do the job:
 http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_timediff

 Otherwise, just do strtotime(endtime) - strtotime(starttime) / 60.
 That's the difference in minutes.

 Regards
 Peter


 --
 hype
 WWW: http://plphp.dk / http://plind.dk
 LinkedIn: http://www.linkedin.com/in/plind
 BeWelcome/Couchsurfing: Fake51
 Twitter: http://twitter.com/kafe15
 /hype




 --
 ::Bruce::




 --
 hype
 WWW: http://plphp.dk / http://plind.dk
 LinkedIn: http://www.linkedin.com/in/plind
 BeWelcome/Couchsurfing: Fake51
 Twitter: http://twitter.com/kafe15
 /hype




-- 
::Bruce::

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



Re: [PHP] determining time difference between two timestamp fields.

2010-05-25 Thread Ashley Sheridan
On Tue, 2010-05-25 at 12:46 -0400, Bruce Gilbert wrote:

 Here is what I currently have.
 
 echo trthCompletion Time:/th/trtrtd .
 (strtotime($row['submit_timestamp']) -
 strtotime($row['login_timestamp']))/60 , /td/tr;
 
 this gives me an output of 21235172.75
 
 not sure what format that is in? I was hoping for something like 60
 minutes, 30 minutes etc. Don't need the days or seconds. The MySQL
 timestamp is in this format.
 
 2010-05-17 11:32:45 - 2010-05-17 12:26:13
 
 On Tue, May 25, 2010 at 11:11 AM, Peter Lind peter.e.l...@gmail.com wrote:
  On 25 May 2010 16:14, Bruce Gilbert webgu...@gmail.com wrote:
  Thanks. I know my syntax isn't quite right, but is this close to what
  I need to do?
 
  echo trthCompletion Time:/th/trtrtd . date('F j, Y
  g:i:sa', strtotime($row[login_timestamp] - [submit_timestamp])/60)
  . /td/tr;
 
 
  No. Assuming that your timestamp is of the -mm-dd HH:ii:ss form,
  you need to do (strtotime([submit_timestamp]) -
  strtotime($row[login_timestamp]))/60.
 
  Regards
  Peter
 
 
  On Tue, May 25, 2010 at 10:01 AM, Peter Lind peter.e.l...@gmail.com 
  wrote:
  On 25 May 2010 15:55, Bruce Gilbert webgu...@gmail.com wrote:
  Here is the situation. I have a form which sets a timestamp when a
  user logs in using UPDATE in SQL. The field is called
  'login_timestamp' and is in a table called 'Candidates'. I have
  another timestamp which is set when a user submits the form data into
  the DB and it is called 'submit_timestamp' . What I want to do is
  determine the amount of time the user takes to complete the form by
  subtracting the 'login_timestamp' time form the 'submit_timestamp'
  time. I am using SQL to extract the data here.
 
  $sql = SELECT Responses.name,Answers,submit_timestamp,login_timestamp
FROM Responses LEFT JOIN Candidates USING (user_id);
 
  and then to display the timestamp in readable form.
 
  echo trthCompletion Time:/th/trtrtd . date('F j, Y
  g:i:sa', strtotime($row[login_timestamp])) . /td/tr;
 
  so I need to know how to subtract from two timestamp fields, two
  different tables and come up with the difference in minutes.
 
 
  In case you're using MySQL, timediff can do the job:
  http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_timediff
 
  Otherwise, just do strtotime(endtime) - strtotime(starttime) / 60.
  That's the difference in minutes.
 
  Regards
  Peter
 
 
  --
  hype
  WWW: http://plphp.dk / http://plind.dk
  LinkedIn: http://www.linkedin.com/in/plind
  BeWelcome/Couchsurfing: Fake51
  Twitter: http://twitter.com/kafe15
  /hype
 
 
 
 
  --
  ::Bruce::
 
 
 
 
  --
  hype
  WWW: http://plphp.dk / http://plind.dk
  LinkedIn: http://www.linkedin.com/in/plind
  BeWelcome/Couchsurfing: Fake51
  Twitter: http://twitter.com/kafe15
  /hype
 
 
 
 
 -- 
 ::Bruce::
 


The value returned from strtotime() is a timestamp, the value you output
from MySQL isn't a timestamp, it's a string-formatted timestamp. If you
need to format a timestamp use the date() function.

Thanks,
Ash
http://www.ashleysheridan.co.uk




RE: [PHP] Dynamic Menus in a PHP Form Issue

2010-05-25 Thread Alice Wei


 From: ak...@telkomsa.net
 To: aj...@alumni.iu.edu; php-general@lists.php.net
 Subject: RE: [PHP] Dynamic Menus in a PHP Form Issue
 Date: Tue, 25 May 2010 08:59:08 +0200
 
 -Original Message-
 From: Alice Wei [mailto:aj...@alumni.iu.edu] 
 Sent: 24 May 2010 04:47 PM
 To: php-general@lists.php.net
 Subject: [PHP] Dynamic Menus in a PHP Form Issue
 
 Hi,I have a snippet as in the following:   ul
 liSelect the type of your starting point of interest:br/
 div id=start_menuform action= name=form1 method=post
 spaninput type=radio value=Apartment name=start
 onclick=alert(document.form1.start)/ Apartment /span
 /form/div/li/ulIf I tried to put this at the top of a
 file where I save as PHP with other PHP execution statements, looks like the
 form does not do anything, and yet when I save the page as in HTML with out
 the other PHP execution, it works. I am trying to create a page where I have
 dynamic drop down menu lists so users can egenerate dynamic content based on
 their preference. Is it possible that I can save the entire file as a PHP
 and still keep the functionality, including generating dynamic menus,
 writing the proper entries to the database and printing out the proper
 output?
 
 Thanks for your help. 
 
 Alice   
 _
 
 The reason it works in html is because it is executed in the browser. If
 you want this html to get to the browser you must either echo it to the
 output buffer that is sent to the browser, or end your php section with ?
 so that these lines are interpreted as part of the output that is sent to
 the browser.
 
 If your php script is running without error then I presume you're already
 doing this. If that's the case then maybe it's not being put into the output
 buffer the way you're expecting (e.g. maybe the quotes don't match). You can
 look at the source code in the browser and compare it against the working
 html code to see where the difference is.
 
 Cheers
 Arno

Thanks, guys. I have set now to 2 different requests, and it is doing great 
now. 

Alice
 
  
_
Hotmail is redefining busy with tools for the New Busy. Get more from your 
inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_2

Re: [PHP] Select Values Didn't Get Passed in From Two Different Forms

2010-05-25 Thread Alice Wei

 Date: Tue, 25 May 2010 13:40:44 -0400
 Subject: Re: [PHP] 
Select Values Didn't Get Passed in From Two Different Forms
 
From: marc.g...@gmail.com
 To: aj...@alumni.iu.edu
 

  I would like to take those values away into my third form, which 
is what you
  see with the hidden. If they are not populated,
 then how come I could see
  the drop down menus?
 

 So you're expecting the values selected in the first two forms to

 populate the values of the hidden fields in the third form?  Why not

 wrap the whole thing in a single form?  Do test_getrss.php and
 
test_getrss2.php perform anything useful or are they just hanging

 around?

No, the fields are populated in the first and second 
form, form1 and form2. What I want to do is to get the selections from 
both forms and pass them on to the third. Does this make sense? For some
 reason, the text input and the semester drop down menu result can be 
passed to process.php, but the results that I try to select from the 
first and second does not. So, the form is not passing the results of 
what I had from the radio button selections.

To illustrate, the 
second looks something like this:

echo select 
name='end_location';
while($nt=mysql_fetch_array($result)){//Array
 or records stored in $nt
echo option 
value=$nt[0]$nt[0]/option;
}
echo /select;

How
 can I pass the values of what I picked in end_location here to 
process.php?

Thanks for your help.

Alice

  
_
The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with 
Hotmail. 
http://www.windowslive.com/campaign/thenewbusy?tile=multicalendarocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5

[PHP] Re: Looking for PHP/Solr developer

2010-05-25 Thread Manuel Lemos
Hello,

on 05/25/2010 04:40 PM Walden Bay said the following:
 We're looking for a developer that has experience with integrating Apache
 Solr with PHP.  We currently have a PHP web system, but we'd like to build
 in Solr to be able to search across all parts of the site.
 
 Does anyone have any ideas where I could go to find a PHP developer with
 Solr experience?  Or is anyone here interested?
 
 Sorry if this is the wrong place to post this, but I'm not sure what the
 appropriate place is.

No, here is fine. Not sure if you will get many candidates, as most
people only come here to get PHP development help, not necessarily to
look for jobs.

You may also want to post to the PHPClasses.org jobs section. So far
over 9,000 PHP developers signed up there explicitly to get PHP job offers.

Once you post a job there, the signed up PHP developers will get an
e-mail telling them about the job, so they can see if it is interesting
for them to apply.

Developers can only apply if their qualifications match your job
requirements, so you will not be flooded of resumes of unqualified people.

http://www.phpclasses.org/jobs/


-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms

2010-05-25 Thread Edwin
Hi Adam,
I am not sure this would help but does echo command end with semi colon ;
?. input type=hidden name=form2
 value=?php echo $end?/ 

Maybe the echo is having some issue? Else, you could try passing the
variables as method = get and view the variables in
Ur address bar

regards,
Edwin.

-Original Message-
From: Adam Richardson [mailto:simples...@gmail.com] 
Sent: Wednesday, May 26, 2010 1:31 AM
To: php-general@lists.php.net
Subject: Re: [PHP] Select Values Didn't Get Passed in From Two Different
Forms

On Tue, May 25, 2010 at 1:17 PM, Alice Wei aj...@alumni.iu.edu wrote:


 Hi,

  It is kind of difficult to explain what I am trying to do here, I will
 provide the form here to give a better idea.

  ul
liSelect the type of your starting point of
 interest:br/
div id=start_menuform
 action=test_getrss.php name=form1 method=post
spaninput type=radio
 value=Apartment name=start

  onclick=check(document.form1.start)/ Apartment /span
spaninput type=radio
 value=Grocery name=start

  onclick=check(document.form1.start)/ Grocery /span
spaninput type=radio
 value=Drugstore name=start

  onclick=check(document.form1.start)/ Drug Store /span
/form/div/li
liSelect the type of your ending point of
 interest:br/
div id=end_menuform
 action=test_getrss2.php name=form2 method=post
spaninput type=radio
 value=Apartment name=end

  onclick=check2(document.form2.end)/ Apartment /span
spaninput type=radio
 value=Grocery name=end

  onclick=check2(document.form2.end)/ Grocery /span
spaninput type=radio
 value=Drugstore name=end

  onclick=check2(document.form2.end)/ Drug Store /span
/form/div/li
   form action=process.php method=post
liStart Time: input type=text size=12
 name=start_time//li
liArrive Time: input type=text size=12
 name=end_time//li
liWhich Semster is this: select name=semester
option value=FallFall/option
option value=SpringSpring/option
option value=SummerSummer/option
/selectbr//li
input type=hidden name=form1 value=?php echo
 $start?/
input type=hidden name=form2
 value=?php echo $end?/
li style=list-style:noneinput type=submit
 value=Submit name=submit/
input type=reset value=Reset
 name=reset//form

/ul

 For some reason, when I pass in the output with process.php, the hidden
 input does not get passed in. Here is the process.php:

 ?php
 //get the q parameter from URL

 $start_time = $_POST['start_time'];
 $end_time = $_POST['end_time'];
 $semester = $_POST['semester'];
 $form1 = $_POST['form1'];
 $form2 = $_POST['form2'];

 echo Start Time  . $start_time . br /;
 echo End Time  . $end_time . br /;
 echo Semester  . $semester . br /;
 echo Start Location  . $form1 . br /;
 echo End Location  . $form2 . br /;

 ?

 I get values for start_time, end_time and semester, but not the last two
 values. What have I done wrong here?

 Thanks for your help.

 Alice


 _
 The New Busy is not the old busy. Search, chat and e-mail from your inbox.


http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:W
L:en-US:WM_HMP:042010_3


Where are you setting the variables $start and $end?

Adam

-- 
Nephtali:  PHP web framework that functions beautifully
http://nephtaliproject.com


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



Re: [PHP] iCal parsing and processing

2010-05-25 Thread Larry Garfield
Hm.  Thanks, but it looks like that's all in Python.  I'm not a parcel tongue 
so that wouldn't be much use to me in a PHP app. :-)  Thanks though.

--Larry Garfield

On Tuesday 25 May 2010 06:43:30 pm Jason Pruim wrote:
 Hi Larry,
 
 Take a look at: http://trac.calendarserver.org/
 
 It's Apple's open source page which includes their iCal web server...
 Maybe something can be pulled from that?  Just something to think
 about and see if it helps :)
 
 Also... Not sure if you've looked at the CalDav protocol but that is
 what it basically runs off of so if you haven't checked it out, you
 might get some better results :)
 
 On May 25, 2010, at 2:10 PM, la...@garfieldtech.com wrote:
  Hi folks.  I am looking for a good iCal processing library (open
  source / GPL compatible).  Unfortunately, everything I've been able
  to find so far is half-assed, incomplete, buggy, or so horribly
  designed that I'd be embarrassed to use it (or several of the
  above).  I was hoping someone could recommend one that actually
  works.  I'd prefer an OO interface as it seems a natural fit, but at
  this point I'll settle for whatever works.
 
  I am not looking for an application with UI and form integration and
  stuff.  I just want a working stand-alone parser.  (If it can be
  ripped out of something more complete, that's fine.)
 
  My needs:
  1) Given raw data (provided by a user form that I can already
  handle), construct iCal VEVENT information including RRULEs and
  EXRULEs.
  2) Given a VCALENDAR / VEVENT object, generate the appropriate iCal
  text string that I can write to a file or return to the browser with
  the appropriate mime header.
  3) Given a VCALENDAR / VEVENT object with RRULEs and EXRULEs in it,
  be able to say give me the start/end dates of the next X
  occurrences from some date or give me all the start/end dates of
  occurrences until date Y.
 
  What I've found so far:
 
  http://www.kigkonsult.se/iCalcreator/ - This is the best I've found
  so far, and it's what I'm using now.  It's missing requirement #3,
  though, as near as I can tell.  Actually if I could add that
  functionality to it without too much trouble I'd probably stick with
  it, but it's non-trivial functionality.  It's also PHP 4 OO, but I
  can deal.
 
  http://phpicalendar.net/ - This claims to do #3, I think, but it's
  integrated into a web app.  The code for it is also horrific, as the
  entire parser is build on include files that rely on global
  variables without using any functions.  The security implications of
  that alone scare me to death to say nothing of side effects and
  stability.
 
  http://code.google.com/p/qcal/ - Documentation is sorely lacking, as
  it is listed as pre-alpha, real alpha to be released in January.
  That post was made in December, and there's still no real
  alpha. :-)  So I can't really tell if it does what I need or not.
 
  A quick search turned up nothing in PEAR, and Zend Framework has
  only a proposal from 2 years ago, not an actual library.
 
  Any others I don't know about?  This seems like an area that cries
  out for a good standard library, but as of yet I haven't found one
  that works.  Help or pointers would be much appreciated.
 
  --Larry Garfield
 

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