[PHP] File Manager

2009-02-04 Thread Sn!per
What would you guys recommend as a good and free opensource file  
management system?


TIA.




--
Sign Up for free Email at http://ureg.home.net.my/


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



[PHP] Testing a URL with regex

2009-01-07 Thread Sn!per

Let's say I have these URLs

http://example.com/index.php?q=gallery
http://example.com/index.php?q=galleryg2_itemId=81
http://example.com/index.php?q=galleryg2_itemId=100

I want to have a line of code that will extract just the  
http://example.com/index.php?q=gallery; part of the URL.


I am never good with regex, please help. TIA.

--
roger




--
Sign Up for free Email at http://ureg.home.net.my/


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



Re: [PHP] Testing a URL with regex

2009-01-07 Thread Sn!per

Then Ashley Sheridan a...@ashleysheridan.co.uk said:


Why do you need a regex here? All the URL's have the same foremost
component, which is exactly 38 characters in length. Do you perchance
need a regualr expression to parse other URL's?

If you just need to extract everything before the first ampersand, then
strpos and substr would be the best to use.


Ash
www.ashleysheridan.co.uk


Ashley and all, thank you for your assistance.

--
roger




--
Sign Up for free Email at http://ureg.home.net.my/


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



[PHP] base64 encode question

2008-04-03 Thread Sn!per
Hi all, I have a short script that I want to store the last login time  
and the host IP number (harcoded for the moment). Those two variables  
are stored in $last_login, which is an array.


[EMAIL PROTECTED] test]# cat lt.php
?
$last_login = array('time' = time(), 'host' = 192.168.10.100);
$serialize_last_login = serialize($last_login);
print $serialize_last_login\n;

$encoded_serialize_last_login = base64_encode($serialize_last_login);
print encoded value is: $encoded_serialize_last_login\n\n;

?
[EMAIL PROTECTED] test]#

When I ran the script, I can see that $serialize_last_login have  
different value for 'time'. But why does $encoded_serialize_last_login  
always show the same value? Below is the output after running the  
script for 3 times:


[EMAIL PROTECTED] test]# php lt.php
a:2:{s:4:time;i:1207208982;s:4:host;s:14:192.168.10.100;}
encoded value is:  
YToyOntzOjQ6InRpbWUiO2k6MTIwNzIwODk4MjtzOjQ6Imhvc3QiO3M6MTQ6IjE5Mi4xNjguMTAuMTAwIjt9


[EMAIL PROTECTED] test]# php lt.php
a:2:{s:4:time;i:1207208984;s:4:host;s:14:192.168.10.100;}
encoded value is:  
YToyOntzOjQ6InRpbWUiO2k6MTIwNzIwODk4NDtzOjQ6Imhvc3QiO3M6MTQ6IjE5Mi4xNjguMTAuMTAwIjt9


[EMAIL PROTECTED] test]# php lt.php
a:2:{s:4:time;i:1207208985;s:4:host;s:14:192.168.10.100;}
encoded value is:  
YToyOntzOjQ6InRpbWUiO2k6MTIwNzIwODk4NTtzOjQ6Imhvc3QiO3M6MTQ6IjE5Mi4xNjguMTAuMTAwIjt9


Please help

--
Roger




--
Sign Up for free Email at http://ureg.home.net.my/


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



Re: [PHP] PHP Ajax progress bar

2008-03-12 Thread Sn!per
Quoting Shelley [EMAIL PROTECTED]:

 I don't think it works.
 
 I tried.
 The screen always said 0%, 0 of 0 byte until the file is uploaded.
 Is that what you mean progress bar?
 
 --
 Regards,
 Shelley (http://phparch.cn)

It work fine. And that's what we meant by progress bar.

--
Roger


---
Sign Up for free Email at http://ureg.home.net.my/
---

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



[PHP] Enabling LDAP on Plesk 8

2007-05-21 Thread Sn!per
Am currently running Plesk 8.0.1 . A php script with phpinfo() will give:
...
...
'--with-kerberos' '--with-ldap=shared' '--with-mysql=shared,
...
...

But am not able to locate the LDAP section that normally looks like:

LDAP Supportenabled
RCS Version $Id: ldap.c,v 1.130.2.11 2005/01/19 00:28:49 bigtoy Exp $
Total Links 0/unlimited
API Version 2004
Vendor Name OpenLDAP
Vendor Version  20025

As such, when running a script that uses any LDAP functions, I will get error 
msgs like:
Fatal error: Call to undefined function: ldap_connect() ...

Any idea how I can go about solving this issue? Please advise. TIA

--
roger



---
Sign Up for free Email at http://ureg.home.net.my/
---

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



Re: [PHP] Best way to store data.

2003-12-18 Thread Sn!per
Quoting Justin French [EMAIL PROTECTED]:

 Theory 3:
 For more complex transformations (I have a library which performs heaps 
 of transformations for paragraphs, headings, line breaks, ol and ul 
 lists, and heaps more), ...


and where can we find that library ?

--



---
Sign Up for free Email at http://ureg.home.net.my/
---

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



Re: [PHP] Creating a Calender

2003-09-08 Thread Sn!per
PEAR Date Calc is your friend.

rgds.

--

Quoting CPT John W. Holmes [EMAIL PROTECTED]:

 From: Dan Anderson [EMAIL PROTECTED]
 
 
  Does anybody know how to generate calendars easily?  (i.e. print out
  complete calenders from the current month on)
 
 I'd check out PEAR or phpclasses.org. I'm sure something is already written,
 but I don't know of any personally.
 
 ---John Holmes...
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 





---
Sign Up for free Email at http://ureg.home.net.my/
---

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



[PHP] tv programme lineup

2003-09-08 Thread Sn!per
nebody know where i can find a script that does something like:

(the admin module)
- add/edit/delete tv programme lineup daily/weekly/monthly
- lineup will include things like programme title, episode, time, synopsis etc

(the public portion)
- can perform search
- calendar
- hilights
- etc

pls advise.


---
Sign Up for free Email at http://ureg.home.net.my/
---

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



[PHP] help needed with this mcal script

2003-08-21 Thread Sn!per
the output of this short mcal-php script is 0. and the no /var/calendar/[EMAIL 
PROTECTED] mcal file was created.

appreciate some advise.

?php
$year = 2003; $month = 8; $day = 21;
$description = the description; $category = 2; $title = the title;

$stream=mcal_open({/mstore}[EMAIL PROTECTED],cal,passwd);

mcal_event_set_title($stream,$title);
mcal_event_set_description($stream,$description);
mcal_event_set_category($stream,$category);
mcal_event_set_start($stream,$year,$month,$day);
$err=mcal_store_event($stream);

print $err;

?

--
rgds


---
Sign Up for free Email at http://ureg.home.net.my/
---

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



Re: [PHP] Problem with mktime, need to add 30 days to current date

2003-08-20 Thread Sn!per
print date('Y-m-d',mktime(0,0,0,date('m'),date('d')+30,date('Y')));

Quoting James Johnson [EMAIL PROTECTED]:

 Sorry about the previous post. 
 
 Hi,
 
 I need to make a date that is 30 days from the current date, and, am
 having problems with mktime
 
 Here's what I've tried:
 
 $endDate=date('Y-m-d',mktime(0,0,0,date('m',time()),30,date('y',time()))
 );
 
 Return this: 2003-08-30
 
 Is there an easy way to do this?
 
 Thanks,
 James
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 





---
Sign Up for free Email at http://ureg.home.net.my/
---

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



Re: [PHP] LAST DAY OF MONTH

2003-08-15 Thread Sn!per
? print date(t) ?

rgds.


Quoting Ralph Guzman [EMAIL PROTECTED]:

 How can I get the last day for the current month?
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 





---
Sign Up for free Email at http://ureg.home.net.my/
---

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



RE: [PHP] LAST DAY OF MONTH

2003-08-15 Thread Sn!per
play with mktime to get the months that you want. the code snippet below is for July 
2003:
--- start code ---
?
$xMonths = mktime (0,0,0, date(m)-1,1,date(Y));

print total days in .date(M,$xMonths). = .date(t,$xMonths).BR;
print and that WAS on .date(D,$xMonths);

?
--- end code ---

rgds.


Quoting Ralph Guzman [EMAIL PROTECTED]:

 wow. I missed that one in the manual. I guess it's time for me to call
 it a night.
 
 Thanks.
 
 
 -Original Message-
 From: Sn!per [mailto:[EMAIL PROTECTED] 
 Sent: Friday, August 15, 2003 1:21 AM
 To: Ralph Guzman
 Cc: PHP General Mailing List
 Subject: Re: [PHP] LAST DAY OF MONTH
 
 ? print date(t) ?
 
 rgds.
 
 
 Quoting Ralph Guzman [EMAIL PROTECTED]:
 
  How can I get the last day for the current month?
  
  
  
  -- 
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
  
  
 
 
 
 
 
 ---
 Sign Up for free Email at http://ureg.home.net.my/
 ---
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 





---
Sign Up for free Email at http://ureg.home.net.my/
---

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



[PHP] saving mail attachment to another server

2003-08-15 Thread Sn!per
i am using Horde's IMP.
i am playing with the idea of saving mail attachment(s) into another server.
the mail server is like mail.example.com on server-A and the 2nd server is like 
photos.example.com on server-B.

is this _normally_ done with cURL and/or snoopy ?

appreciate some guidelines.


rgds.



---
Sign Up for free Email at http://ureg.home.net.my/
---

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



[PHP] size of submitted textarea field in bytes

2003-08-14 Thread Sn!per
i have a textarea where ppl will enter their bio.
after they submit the form, i need to compute the size of their bio in bytes _without_ 
creating any file. is this at all possible ?
please advise.

sample script:

?
if ($_POST['submit']) {
print you have submitted xyz bytes;
}
else {
?
form method=post action=./p.php
textarea name=html_code cols=70 rows=10/textarea
input type=submit name=submit value=submit
/form
?
}
?

rgds.



---
Sign Up for free Email at http://ureg.home.net.my/
---

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



[PHP] ACL howto

2003-06-15 Thread Sn!per
I have several admin modules for my portal. And I have also several admin users who 
are supposed to have access only to certain modules.

Say, the superadmin can access ALL modules (modA, modB, modC, modD) and
admin-A can only access modA and modB
admin-B can only access modA and modD
...
...

How can I setup my ACL that do bit (XOR) checking ?
Please advise.



---
Sign Up for free Email at http://ureg.home.net.my/
---

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