[PHP] Re: Converting HTML to BBCode [SOLVED]

2006-03-07 Thread J_K9
Hi,

Thank you for that - although I do have to admit that I don't 
understand a single bit of the reg-exp part. :)

It is now working flawlessly! Here is the final code I used:

---CODE---

';

/**
   * Performes BBCode conversion for some simple HTML elements
   *
   * @staticvar string  $str_http_valid
   * @staticvar array   $arr_replace
   * @param string  $string
   * @returnstring
   * @since Mon Mar 06 23:44:40 CST 2006
   * @authorrsalazar
   */
function to_bbcode( $string ) {
  static  $str_http_valid = '-:\/a-z.0-9_%+';
  $arr_replace= array(

"/(.+?)<\/a>/Xis"
 => '[link=\\2\\3]\\4[/link]',

"//Xis"
 => '[img]\\2\\3[/img]',
  '/<(\/)?(strong|em)>/Xise' => '( strcasecmp("em", "\\2") ? 
"[\\1b]" : "[\\1i]" )',
  '/<(\/?(?:b|i|u))>/Xis'  => '[\\1]',

  '/<(\/)?[ou]l>/Xis'=> '[\\1list]',
  '/<(\/)?li>/Xise'  => '( "\\1" == "" ? "[*]" : "" )',
  );
  $string = preg_replace(array_keys($arr_replace),
 array_values($arr_replace),
 $string);
  return  $string;
}

$text = to_bbcode($text);

echo '' . "$text" . '';

?>
---/CODE---

Thank you very much for your help! I hope I get onto reg-exp and PREG 
stuff soon so that someday I might be able to understand that code.. :D

Cheers,


J_K9

>   First of all, the back-slashes added before a " character is 
probably 
> because of the gpc_magic_quotes directive in PHP, wich tries 
to "escape" 
> the quotes (pretty stupid, if you ask me), so you must have to use 
> strip_slashes() on the string you received, e.g:
>$text = '';
>if ( isset($_POST['text']) ) {
>$text = $_POST['text'];
>if ( get_magic_quotes_gpc() ) {
>$text = stripslashes($text);
>}
>}
> 
>   Now, what you're trying to do is definetely not 
something "basic", 
> since you want to replace some non-fixed strings that can either be 
in 
> lower or uppercase (and without changing the case of the rest of the 
> text), so basicaly what you have are patterns (some kind of 'rules' 
that 
> shall be followed by the tags)
> 
>   By your code I can tell you've already try a little the hard 
way to 
> solve this issue, although it would be quite more laborious than 
that 
> because you would have to search the string almost char-by-char (in 
a 
> figurative way, but pretty much what PHP would be doing) for all the 
> tags you want to replace, and possibly be working with two strings: 
one 
> for the original text and other with a lowercase version of it 
(since 
> you cannot search in a case-insensitive way --only in PHP5)
> 
>   Anyway, the medium/advanced way (IMHO) would be to use regular 
> expressions.  These are quite useful, but also rather cryptic, even 
for 
> advanced users --sometimes it's easier to come up with a new one 
rather 
> than understanding what already exists :p
> 
>   The function I've test with your test HTML-code is this one:
>/**
> * Performes BBCode conversion for some simple HTML elements
> *
> * @staticvar string  $str_http_valid
> * @staticvar array   $arr_replace
> * @param string  $string
> * @returnstring
> * @since Mon Mar 06 23:44:40 CST 2006
> * @authorrsalazar
> */
>function to_bbcode( $string ) {
>  static  $str_http_valid = '-:\/a-z.0-9_%+';
>  $arr_replace= array(
>  
> "/(.+?)<\/a>/Xis"
>   => '[link=\\2\\3]\\4[/link]',
>  
> "//Xis"
>   => '[img]\\2\\3[/img]',
>'/<(\/)?(strong|em)>/Xise' => '( strcasecmp
("em", "\\2") ? 
> "[\\1b]" : "[\\1i]" )',
>'/<(\/?(?:b|i|u))>/Xis'  => '[\\1]',
> 
>'/<(\/)?[ou]l>/Xis'=> '[\\1list]',
>'/<(\/)?li>/Xise'  => '( "\\1" == "" ? "[*]" : "" )',
>  );
>  $string = preg_replace(array_keys($arr_replace),
> array_values($arr_replace),
> $string);
>  return  $string;
>}
> 
>   As I mentiones before, keep in mind that reg-exp can be rather 
cryptic 
> sometimes.  Also, this is the raw code, it should be optimized but 
I'm 
> feeling really lazy right now, so it should have to wait for a 
better 
> ocasion.
> 
>   It's up to you to decide wheter you'll use this function or 
not, what I 
> would recommend you is not to forget about regexp and give them a 
try 
> later (when you're more familiar with PHP), and I would also 
recommend 
> you to use PREG family rather than EGREP.
> 

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



[PHP] encrypt and decrypt in php

2006-03-07 Thread suresh kumar
I searched google,weberdev and php.net sites. i implemented the 2 encrypt and 
decrypt functions  mcrypt_encrypt(),mcrypt_decrypt() and mcrypt_ecb() 
functions.but it not working properly.i dont need more complicated encrypt and 
decrypt functionality.just i want to encrypt my user id when i pass from page1 
to page2 and i want to decrypt  it in page2.i am looking forward reply from u
   
 A.suresh


-
 Jiyo cricket on Yahoo! India cricket
Yahoo! Messenger Mobile Stay in touch with your buddies all the time.

[PHP] Re: encrypt and decrypt in php

2006-03-07 Thread Barry

suresh kumar wrote:

I searched google,weberdev and php.net sites. i implemented the 2 encrypt and 
decrypt functions  mcrypt_encrypt(),mcrypt_decrypt() and mcrypt_ecb() 
functions.but it not working properly.i dont need more complicated encrypt and 
decrypt functionality.just i want to encrypt my user id when i pass from page1 
to page2 and i want to decrypt  it in page2.i am looking forward reply from u
   
 A.suresh



-
 Jiyo cricket on Yahoo! India cricket
Yahoo! Messenger Mobile Stay in touch with your buddies all the time.

Generate an MD5 hash.
This surely will noone decrypt :)

And when you pass vars from site1 to site2 you can also use session 
variables or POST vars.


In a session, noone will have access to it, well except you of course.

Greets
Barry
--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)

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



[PHP] Re: PHP Post to other Servers

2006-03-07 Thread João Cândido de Souza Neto
My suggestion is that you use the ftp functions of php. With this you can
put your files into anywhere do you want.


Robert Sandie wrote:

> Want to load balance a server and send image uploads to a different box
> with PHP installed. What would the correct method to authenticate on the
> second machine and send without ruining user experience by sending them to
> a second page?
> 
>  
> 
> Initial thought was to keep the box address inside of the box address?
> 
>  
> 
> - Rob

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



Re: [PHP] Re: PHP4 with MYSQL5

2006-03-07 Thread João Cândido de Souza Neto
An example that don't work is "delimiter |".


Chris wrote:

> João Cândido de Souza Neto wrote:
>> I receive aa answer by e-mail in order this telling me that i must
>> upgrade my php4 to php5.
>> 
>> It means that a php4 server don't works fine with mysql5 server?
>> 
>> João Cândido de Souza Neto wrote:
>> 
>> 
>>>Hello everyone.
>>>
>>>I'm trying to use my php4 conecting to a mysql5 server, and then
>>>executing some command lines to create a stored procedure but it's not
>>>working.
>>>
>>>When a tried to execute "delimiter |", my php gets de follow error:
>>>
>>>You have an error in your SQL syntax; check the manual that corresponds
>>>to your MySQL server version for the right syntax to use near 'delimiter
>>>|' at line 1
>>>
>>>If I connect to server as local and try to execute the above command, it
>>>works fine.
>>>
>>>Could anyone help me about this? I'll be pleased by any tips.
>>>
>>>Thanks.
>> 
>> 
> 
> Depends on your query.
> 
> Post your exact query and we'll see if we can help.
> 

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



[PHP] Multiple directories in open_basedir

2006-03-07 Thread Carles Xavier Munyoz Baldó
Hi,
I want to use the open_basedir PHP configuration directive in order to 
restrict the file access to serveral directories for one of my domains.

I'm using:
php_admin_value open_basedir "/dir1/path/;/dir2/path/"
in the domain virtual host configuration for my Apache web server, but it 
doesn't go.

Which is the syntax for specify multiple directories in open_basedir using the 
Apache web server ?

Thank you very much for your help.
---
Carles Xavier Munyoz Baldó
[EMAIL PROTECTED]
http://www.unlimitedmail.net/
---

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



[PHP] LDAP - The Adventure Continues

2006-03-07 Thread jblanchard
Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to
allocate 94 bytes) in /srv/www/htdocs/test/ldapTest.php on line 47

47 -> $info = ldap_get_entries($ds, $sr);

$sr=ldap_search($ds, "dc=foo,dc=local", "cn=*");
$ds is the connection to the LDAP server

Does anyone know what this means? 

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



RE: [PHP] LDAP - The Adventure Continues SOLVED

2006-03-07 Thread jblanchard
[snip]
Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to
allocate 94 bytes) in /srv/www/htdocs/test/ldapTest.php on line 47

47 -> $info = ldap_get_entries($ds, $sr);

$sr=ldap_search($ds, "dc=foo,dc=local", "cn=*");
$ds is the connection to the LDAP server

Does anyone know what this means? 
[/snip]

The php.ini still had an 8mb memory limit set. I increased the amount
and all is well.

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



Re: [PHP] LDAP - The Adventure Continues

2006-03-07 Thread Jochem Maas

[EMAIL PROTECTED] wrote:

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to


(8388608 / 1024) / 1024 = 8.


allocate 94 bytes) in /srv/www/htdocs/test/ldapTest.php on line 47

47 -> $info = ldap_get_entries($ds, $sr);

$sr=ldap_search($ds, "dc=foo,dc=local", "cn=*");
$ds is the connection to the LDAP server

Does anyone know what this means? 


at a guess the number of entries you are getting back doesn't fit into the
8 megs of memory your php script has.

now I know next to nothing about ldap but I recall someone on
the list asking about how to go about getting paged/limited results from
a ldap query  IIRC ldap supports paged/limited results but it was no
clear (or maybe not even possible) to requested paged/limited result via php...

anyway quick qorkaround would be to up or drop the memorylimit for the
script in question.





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



Re: [PHP] Re: Converting HTML to BBCode [SOLVED]

2006-03-07 Thread Rafael

Hi,
	I'm glad it worked (so far, hehe)  Also, there's something I forgot to 
tell you (though I think you may as well be already doing this): there 
will be some unknown tags for the to_bbcode() function (even maybe some 
variations of those that it should recognize but it won't), so you 
should take care of those tags too, with something similar to this:


  $text = to_bbcode($text);// try to convert to BBCode
  $text = strip_tags($text);   // get rid of remaining tags
  $text = htmlspecialchars($text); // replace basic HTML-entities

J_K9 wrote:

Hi,

Thank you for that - although I do have to admit that I don't 
understand a single bit of the reg-exp part. :)


It is now working flawlessly! Here is the final code I used:


[···]


Thank you very much for your help! I hope I get onto reg-exp and PREG 
stuff soon so that someday I might be able to understand that code.. :D


	Good luck on that. Oh, a little correction: it should be PCRE not PREG, 
"preg_" is the functions prefix (my mistake, sorry)

--
Atentamente,
J. Rafael Salazar Magaña
Innox - Innovación Inteligente
Tel: +52 (33) 3615 5348 ext. 205 / 01 800 2-SOFTWARE
http://www.innox.com.mx

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



Re: [PHP] Prepared statements

2006-03-07 Thread Julius Hacker
Anthony Ettinger wrote:
> On 3/6/06, Anthony Ettinger <[EMAIL PROTECTED]> wrote:
>   
>> On 3/6/06, Julius Hacker <[EMAIL PROTECTED]> wrote:
>> 
>>> Curt Zirzow wrote:
>>>   
 I assume your loop is something like:
   while(condition) {
 $auction_parts['id'] = 'some value';
 $auction_parts['name'] = 'some value';
 ...
 $insert->execute();
   }

 
>>> Yes, thats it.
>>>
>>>   
 My first guess would be, if not aleady done, initialize
 $auction_parts before you do your bind_param() with something like:

   $auction_parts = array('id' => null, 'name' => null, ...);
   $insert->bind_param("issdsis", $auction_house["id"], ...);

 
>>> Unfortunately it helps nothing :-(
>>> But I think also that it's something because of the declaration and
>>> initalization of the variables because it works if I have the bind_param
>>> in the loop after I gave the variables their values.
>>> But to have the bind_param in the loop isn't the best solution I think.
>>>
>>> --
>>> Regards
>>> Julius Hacker
>>>
>>> http://www.julius-hacker.de
>>> [EMAIL PROTECTED]
>>>
>>> OpenPGP-Key-ID: 0x4B4A486E
>>>
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>>
>>>
>>>   
>> $stmt = $mysqli->prepare("INSERT INTO CountryLanguage VALUES (?, ?, ?, ?)");
>> $stmt->bind_param('sssd', $code, $language, $official, $percent);
>>
>> $code = 'DEU';
>> $language = 'Bavarian';
>> $official = "F";
>> $percent = 11.2;
>>
>> /* execute prepared statement */
>> $stmt->execute();
>>
>> http://us2.php.net/manual/en/function.mysqli-stmt-bind-param.php
>>
>> 
>
>
> Table 1. Type specification chars
> Character Description
> i corresponding variable has type integer
> d corresponding variable has type double
> s corresponding variable has type string
> b corresponding variable is a blob and will be send in packets
>
>
> 'sssd' defines the datatypes of the 4 arguments you're passing in.
>
>   
I know the example ;-)
I checked the statement now without the loop, but defined the variables
also after the bind_param.
Very interesting is that it works if I write $auction_parts["..."] =
"..."; but that it doesn't if I write $auction_parts = array("..." =>
"...", ...);

--
Regards
Julius Hacker

http://www.julius-hacker.de
[EMAIL PROTECTED]

OpenPGP-Key-ID: 0x4B4A486E

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



[PHP] include not working properly?

2006-03-07 Thread robert mena
Hi,

I am facing a strange problem.  One of my classes uses a include("Log.php")
to enable to to use the Log class that comes with pear.

*Fatal error*: require_once()
[function.require]:
Failed opening required 'Log.php'
(include_path='.:/usr/local/lib/php/:/home/httpd/html/php/:/home/httpd/html/include/php/')
in */var/www/html/domain/php/Conexion.inc* on line *14*
**
*I do have the Log.php*
**
*ls -lsa /usr/local/lib/php/Log.php
20 -rw-r--r--  1 root root 18563 Mai 25  2005 /usr/local/lib/php/Log.php*
**
*My virtualhost*
**

ServerAdmin [EMAIL PROTECTED]
DocumentRoot /var/www/html/domain
ServerName www.domain
ErrorLog   logs/domain-error_log
CustomLog  logs/domain-access_log combined
ScriptAlias /cgi-bin/ /var/www/cgi-bin/

php_admin_value doc_root "/var/www/html/domain/"
php_admin_flag safe_mode off
php_admin_value safe_mode_include_dir
"/var/www/html/domain/:/tmp/:/usr/local/lib/php"
php_admin_value open_basedir "/var/www/html/domain/:/tmp/"
php_admin_value safe_mode_exec_dir "/var/www/php_exec_dir"
AllowOverride AuthConfig Limit



You will notice that the safe mode is off.  It was originally on but the
same error happened.   I've even tryied using a include
("/usr/local/lib/php/Log.php") with the same error.

Any ideas?

 PHP Version 5.1.2
System Linux baco.argo.com.br 2.6.12-1.1381_FC3 #1 Fri Oct 21 03:46:55 EDT
2005 i686
Build Date Jan 31 2006 10:17:45
Configure Command './configure' '--with-mysql' '--with-gd' '--with-apxs2'
'--with-xml' '--with-ftp' '--enable-session' '--enable-trans-sid'
'--with-zlib' '--enable-inline-optimization' '--with-mcrypt=/usr/local'
'--with-imap=/usr/include/imap' '--with-kerberos' '--enable-sigchild'
'--with-gettext' '--with-freetype' '--with-ttf' '--with-ftp' '--enable-ftp'
'--with-jpeg-dir=/usr' '--with-imap-ssl=/usr/include/openssl'
'--with-xpm-dir=/usr/X11R6' '--enable-gd-native-ttf' '--with-png'
'--with-freetype-dir=/usr' '--with-openssl=/usr' '--with-openssl-dir=/usr/'
'--with-pgsql'


[PHP] what is wrong with my big array

2006-03-07 Thread Ross
I cannot see it

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



[PHP] Re: what is wrong with my big array

2006-03-07 Thread Ross
get a parse error!

$region_array = array('a' =>'All of Scotland', 1 =>'Aberdeen City Council', 
2 =>'Aberdeenshire Council', 3 =>'AngusCouncil', 5 =>'Argyll and Bute 
Council', 6 => 'Clackmannanshire Council', 9 =>'Dumfries and Gallowalloway', 
10 => 'Dundee City Council', 11 => 'East Ayrshire Council', 13 => 'East 
Dunbartonshire', 14 => 'East Lothian Council', 15 => 'East Renfrewshire 
Council', 16 =>'Edinburgh City Council', 17 =>'Falkirk Council', 18 =>'Fife 
Council', 20 =>'Highland Council', 21 =>'Inverclyde Council', 22 
=>'Midlothian Council', 23 => 'Moray Council', 24 =>'North Ayrshire 
Council', 25 =>'North Lanarkshire Council', 26 =>'Orkney Islands Council', 
27 =>'Perth & Kinross Council', 28 => 'Renfrewshire Council',29 =>'Scottish 
Borders Council', 30 = > 'Shetland Isles Council', 31 =>'South Ayrshire 
Council', 32 => 'South Lanarkshire Council', 33 => 'Stirling Council', 34 
=>'West Dunbartonshire', 35 => 'West Lothian Council', 8 => 'Comhairle nan 
Eilean');
  ?> 

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



Re: [PHP] what is wrong with my big array

2006-03-07 Thread Stut

Ross wrote:


I cannot see it


If it helps... neither can we!

-Stut

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



Re: [PHP] Re: what is wrong with my big array

2006-03-07 Thread Ray Hauge
On Tuesday 07 March 2006 08:08, Ross wrote:
> $region_array = array('a' =>'All of Scotland', 1 =>'Aberdeen City Council',
> 2 =>'Aberdeenshire Council', 3 =>'AngusCouncil', 5 =>'Argyll and Bute
> Council', 6 => 'Clackmannanshire Council', 9 =>'Dumfries and
> Gallowalloway', 10 => 'Dundee City Council', 11 => 'East Ayrshire Council',
> 13 => 'East Dunbartonshire', 14 => 'East Lothian Council', 15 => 'East
> Renfrewshire Council', 16 =>'Edinburgh City Council', 17 =>'Falkirk
> Council', 18 =>'Fife Council', 20 =>'Highland Council', 21 =>'Inverclyde
> Council', 22
> =>'Midlothian Council', 23 => 'Moray Council', 24 =>'North Ayrshire
> Council', 25 =>'North Lanarkshire Council', 26 =>'Orkney Islands Council',
> 27 =>'Perth & Kinross Council', 28 => 'Renfrewshire Council',29 =>'Scottish
> Borders Council', 30 = > 'Shetland Isles Council', 31 =>'South Ayrshire
> Council', 32 => 'South Lanarkshire Council', 33 => 'Stirling Council', 34
> =>'West Dunbartonshire', 35 => 'West Lothian Council', 8 => 'Comhairle nan
> Eilean');

After the 30 element you have a space after the '=' like: "= >" instead of 
"=>"

HTH

-- 
Ray Hauge
Programmer/Systems Administrator
American Student Loan Services
http://www.americanstudentloan.com
1.800.575.1099

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



Re: [PHP] what is wrong with my big array

2006-03-07 Thread Barry

Stut wrote:

Ross wrote:


I cannot see it


If it helps... neither can we!

-Stut

And again:
PHP is best coded with open eyes: (O_O)

--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)

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



[PHP] Re: what is wrong with my big array

2006-03-07 Thread Ross
Nice spot ray! 

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



Re: [PHP] Re: what is wrong with my big array

2006-03-07 Thread Stut

Ross wrote:


get a parse error!

$region_array = array('a' =>'All of Scotland', 1 =>'Aberdeen City Council', 
2 =>'Aberdeenshire Council', 3 =>'AngusCouncil', 5 =>'Argyll and Bute 
Council', 6 => 'Clackmannanshire Council', 9 =>'Dumfries and Gallowalloway', 
10 => 'Dundee City Council', 11 => 'East Ayrshire Council', 13 => 'East 
Dunbartonshire', 14 => 'East Lothian Council', 15 => 'East Renfrewshire 
Council', 16 =>'Edinburgh City Council', 17 =>'Falkirk Council', 18 =>'Fife 
Council', 20 =>'Highland Council', 21 =>'Inverclyde Council', 22 
=>'Midlothian Council', 23 => 'Moray Council', 24 =>'North Ayrshire 
Council', 25 =>'North Lanarkshire Council', 26 =>'Orkney Islands Council', 
27 =>'Perth & Kinross Council', 28 => 'Renfrewshire Council',29 =>'Scottish 
Borders Council', 30 = > 'Shetland Isles Council', 31 =>'South Ayrshire 
Council', 32 => 'South Lanarkshire Council', 33 => 'Stirling Council', 34 
=>'West Dunbartonshire', 35 => 'West Lothian Council', 8 => 'Comhairle nan 
Eilean');
 ?> 


You might want to consider laying your code out in a more readable format.

$region_array = array(
   'a' => 'All of Scotland',
 1 => 'Aberdeen City Council',
 2 => 'Aberdeenshire Council',
 3 => 'AngusCouncil',
 5 => 'Argyll and Bute Council',
 6 => 'Clackmannanshire Council',
 9 => 'Dumfries and Gallowalloway',
10 => 'Dundee City Council',
11 => 'East Ayrshire Council',
13 => 'East Dunbartonshire',
14 => 'East Lothian Council',
15 => 'East Renfrewshire Council',
16 => 'Edinburgh City Council',
17 => 'Falkirk Council',
18 => 'Fife Council',
20 => 'Highland Council',
21 => 'Inverclyde Council',
22 => 'Midlothian Council',
23 => 'Moray Council',
24 => 'North Ayrshire Council',
25 => 'North Lanarkshire Council',
26 => 'Orkney Islands Council',
27 => 'Perth & Kinross Council',
28 => 'Renfrewshire Council',
29 => 'Scottish Borders Council',
30 = > 'Shetland Isles Council',
31 => 'South Ayrshire Council',
32 => 'South Lanarkshire Council',
33 => 'Stirling Council',
34 => 'West Dunbartonshire',
35 => 'West Lothian Council',
 8 => 'Comhairle nan Eilean');

As already pointed out, there is a space between the = and > after the 
30. Laying code out like this also tends to limit the amount of code you 
need to look at to find syntax errors like this since PHP happily points 
to the precise line.


-Stut

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



[PHP] Re: what is wrong with my big array

2006-03-07 Thread João Cândido de Souza Neto
I think that the error is in the line above that.

Ross wrote:

> get a parse error!
> 
> $region_array = array('a' =>'All of Scotland', 1 =>'Aberdeen City
> Council', 2 =>'Aberdeenshire Council', 3 =>'AngusCouncil', 5 =>'Argyll and
> Bute Council', 6 => 'Clackmannanshire Council', 9 =>'Dumfries and
> Gallowalloway', 10 => 'Dundee City Council', 11 => 'East Ayrshire
> Council', 13 => 'East Dunbartonshire', 14 => 'East Lothian Council', 15 =>
> 'East Renfrewshire Council', 16 =>'Edinburgh City Council', 17 =>'Falkirk
> Council', 18 =>'Fife Council', 20 =>'Highland Council', 21 =>'Inverclyde
> Council', 22 =>'Midlothian Council', 23 => 'Moray Council', 24 =>'North
> Ayrshire Council', 25 =>'North Lanarkshire Council', 26 =>'Orkney Islands
> Council', 27 =>'Perth & Kinross Council', 28 => 'Renfrewshire Council',29
> =>'Scottish Borders Council', 30 = > 'Shetland Isles Council', 31 =>'South
> Ayrshire Council', 32 => 'South Lanarkshire Council', 33 => 'Stirling
> Council', 34 =>'West Dunbartonshire', 35 => 'West Lothian Council', 8 =>
> 'Comhairle nan Eilean');
>   ?>

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



Re: [PHP] Re: what is wrong with my big array

2006-03-07 Thread João Cândido de Souza Neto
You're Right. I don't saw that.

Stut wrote:

> Ross wrote:
> 
>>get a parse error!
>>
>>$region_array = array('a' =>'All of Scotland', 1 =>'Aberdeen City
>>Council', 2 =>'Aberdeenshire Council', 3 =>'AngusCouncil', 5 =>'Argyll and
>>Bute Council', 6 => 'Clackmannanshire Council', 9 =>'Dumfries and
>>Gallowalloway', 10 => 'Dundee City Council', 11 => 'East Ayrshire
>>Council', 13 => 'East Dunbartonshire', 14 => 'East Lothian Council', 15 =>
>>'East Renfrewshire Council', 16 =>'Edinburgh City Council', 17 =>'Falkirk
>>Council', 18 =>'Fife Council', 20 =>'Highland Council', 21 =>'Inverclyde
>>Council', 22 =>'Midlothian Council', 23 => 'Moray Council', 24 =>'North
>>Ayrshire Council', 25 =>'North Lanarkshire Council', 26 =>'Orkney Islands
>>Council', 27 =>'Perth & Kinross Council', 28 => 'Renfrewshire Council',29
>>=>'Scottish Borders Council', 30 = > 'Shetland Isles Council', 31 =>'South
>>Ayrshire Council', 32 => 'South Lanarkshire Council', 33 => 'Stirling
>>Council', 34 =>'West Dunbartonshire', 35 => 'West Lothian Council', 8 =>
>>'Comhairle nan Eilean');
>>  ?>
>>
> You might want to consider laying your code out in a more readable format.
> 
> $region_array = array(
> 'a' => 'All of Scotland',
>   1 => 'Aberdeen City Council',
>   2 => 'Aberdeenshire Council',
>   3 => 'AngusCouncil',
>   5 => 'Argyll and Bute Council',
>   6 => 'Clackmannanshire Council',
>   9 => 'Dumfries and Gallowalloway',
>  10 => 'Dundee City Council',
>  11 => 'East Ayrshire Council',
>  13 => 'East Dunbartonshire',
>  14 => 'East Lothian Council',
>  15 => 'East Renfrewshire Council',
>  16 => 'Edinburgh City Council',
>  17 => 'Falkirk Council',
>  18 => 'Fife Council',
>  20 => 'Highland Council',
>  21 => 'Inverclyde Council',
>  22 => 'Midlothian Council',
>  23 => 'Moray Council',
>  24 => 'North Ayrshire Council',
>  25 => 'North Lanarkshire Council',
>  26 => 'Orkney Islands Council',
>  27 => 'Perth & Kinross Council',
>  28 => 'Renfrewshire Council',
>  29 => 'Scottish Borders Council',
>  30 = > 'Shetland Isles Council',
>  31 => 'South Ayrshire Council',
>  32 => 'South Lanarkshire Council',
>  33 => 'Stirling Council',
>  34 => 'West Dunbartonshire',
>  35 => 'West Lothian Council',
>   8 => 'Comhairle nan Eilean');
> 
> As already pointed out, there is a space between the = and > after the
> 30. Laying code out like this also tends to limit the amount of code you
> need to look at to find syntax errors like this since PHP happily points
> to the precise line.
> 
> -Stut

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



[PHP] [Semi-OT] Online-Shops

2006-03-07 Thread Michelle Konzack
Hello *,

After trying out more then 30 Online-Shops (mostly written in PHP) I
have not found a suitable one for me because of laking in functionality
or grave security problems (I have cracked some of them myself being
not a cracker).

OK, I was looking for an open source one and for free.

NON-FREE would ne Internoliv InterShop which has all I want, but I do
not want to pay 10.000 Euro or more for it!  -  Yeah, tats its price!

What I need is:

1.  It must run as a VHost on my Main-Server where each VHost IS a
UNIX-User wher ~/public_html/ is the Website, ~/bin-cgi/ the CGI
Directory beside ~/bin/

2.  Must work with PostgreSQL which IS in another (and internal) server
for security reason.

3.  Because I run it with two friends I need several INDEPENDANT
main rubriks like "computer", "clothes" or "beauty" but can be
visited and payed together.

4.  Must support at least 10.000 Items per rubric (and subrubics)

5.  Must support for an interface which is used be the peoples
arranging the incoming stock over laptop (adding of new artikles)
in the magazines

6.  Customers maybe enduser, reseller or distributors, where each can
have individual rebates and without sales tax (reseller or
distributors).

7.  Because we are selling international, I like to use PayPal
(direct) and PayPal/CC.

8.  Customers can collect bonus points based on buy-value or on
product to get special offers or reductions of future buyings.

9.  All articles of subcategories are shown on a preview table
(customer customisable from 10 to 100 items)

10. All articles of subcategories can be chown one by one clicking on
prev/next buttons

11. "number of articles in stock" must be shown for each item.

12. Special rebates based on Item-No and e.g. color
Example:
 itemno |  Item   | color  | price
+-++
 01 | Socks   | red|   1.00
 02 | Socks   | orange |   1.00
 03 | Socks   | green  |   1.00
 04 | Socks   | black  |   1.00
 05 | Socks   | white  |   1.00

So if a client buy only one pair she/he woulkd pay 1.00 Euro
and it is easy to make a new column if someone want to buy
5 pairs of socks to get a special price.  But what I want is
the functionality to resemble those 5 items to one and the
customer can chose 5 pair of socks of different colors...

There is no one Online-Store (except IS) which support such.

13. The boss (me) and my friends wnt to get realtime statistics of
buyed and selled products (by itmes and Euro) given rebates...

14. The Web-Interface MUST support i18n AND bidi, which mean, it
MUST work for fars, arabic and hebrew too.  No discrimination
or limitations agains laguages.

15. All invoices, statistics, ..., blahblah can be printed via fpdf.

16. Must contain a ticket management for backsending of unwanted or
defectiv items with RMA-Number or something like this.

17. Customers can register them self On-Line and can be validated
by sending a predefined letter by post which contain a special-
code which must be entered on the webform like eBay-France do it
with its french customers.  Using the Credit-Card number is not
enough to avoid frauds.


So it is a little bit more complex as the Online-Stores I have found.
I do not need a very compley Webdesign and I do not want to use tonns
of GIFs which are blinking around and making tables shown with round
corners...

It must be nice, easy to use for the Online-Shop-Team and the vustomers,
functional and working perfectly like Linux!

Does anyone know such Online-Shop?

Currently I have not the money to let some one code this stuff via
 which is a realy good website if you need
stuff coded or if you want to earn money...

And yes, this new Online-Store driven by me and my two friends are a
new business and I if I must code the stuf for my own, I like to put
it under GPL (100& DFSG-Free) and into Debian GNU/Linux.

Sponsors and Co-Workers are welcome.

Note:   There is no problem to get Pakistani or Indian Super-Coders
(They are realy fit, - my own experience) to code the stuff
for 1000-1500 US$.

If all is working fine, my website will be online again in march 2006
and if I need to code the stuff myself and/or with coworkers I will
create a project page for it.

Oh yes, the Online-Store should use php5, fpdf and postgresql 7.4 or
better.

Greetings
Michelle Konzack
Systemadministrator
Tamay Dogan Network
Debian GNU/Linux Consultant


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
# Debian GNU/Linux Consultant #
Michelle Konzack   Apt. 917  ICQ #328449886
   50, rue de Soultz MSM LinuxMichi
0033/3/8845235667100 Strasbourg/France   IRC #Debian (irc.icq.com)

-- 
PHP General Mailing List (http://www

[PHP] php and suid

2006-03-07 Thread Michelle Konzack
Hello *,

since PHP-CGI's can be set suid, how can this done IF I can
not use CGI because all off my webpages are PHP pages?

Greetings
Michelle Konzack

-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
# Debian GNU/Linux Consultant #
Michelle Konzack   Apt. 917  ICQ #328449886
   50, rue de Soultz MSM LinuxMichi
0033/3/8845235667100 Strasbourg/France   IRC #Debian (irc.icq.com)

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



[PHP] Re: simplify DOM api

2006-03-07 Thread Rob Richards

Andreas Korthaus wrote:

Rob Richards wrote:

You can also look at using xmlwriter, when creating serialized trees, 
that automatically does escaping for you.


Hm, AFAIK latest xmlwriter versions provide an OO API. Do you know 
about any documentation for it?

I will try to add some time permitting.


The only code I've seen so far is:
http://cvs.php.net/viewcvs.cgi/pecl/xmlwriter/examples/xmlwriter_oo.php?view=markup&rev=1.1.2.2 



And that's not too much (but promising) ;-) Or do you know about some 
more complex examples?
I do, but none are available anywhere public. You should also look at 
the test cases that have been written for it:

http://cvs.php.net/viewcvs.cgi/php-src/ext/xmlwriter/tests/
These have cases for both OO and procedural.


Btw. I need to validate my created documents against an XML schema, I 
doubt this is possible with xmlwriter.
Not unless you re-load the document using a validating parser. I had 
just thrown that extension out there in the event you were just creating 
a serialized tree.


Rob

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



[PHP] Classes and OOP

2006-03-07 Thread Wolf
I'm looking for a couple of good books or online sources where I can get
a lot better grasp of Classes and OOP programming in general.  Mostly I
use PHP so that is the best option.

Thanks,
Robert

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



[PHP] Poker stats GET/POST page devleopment

2006-03-07 Thread The Doctor
Someone wishes to develop a site using PHP/SQL .


Here are the specs:

The site the client is looking for is not a gaming site.
 
It is a site where players register to keep track of their winnings on GAMING 
sites.  It will have a freeroll side(where players get points not money)  and a 
Money tour side where players will win money and points. 
 
This site will request (GET) data from the gaming sites for the registered 
members and compile(POST) the info into the db.  A number of queries will need 
to be set up ie.
 
top 10 - 20 - 50 for free roll
top 10 - 20 - 50 for money tour
 
List of registered members   by date registered
 
List of registered members   by points earned
 
List of registered members   by money won
 
List of registered members   by last name alphabetacally
 
We should also have a db of all the poker sites which we could concatenate with 
other queries.
 
ie.  registered members placements in xxxpokerroom.com  etc.
 
I hope all this makes sense to you.  Let me know if any of this is not doable.
 
P.S. They want to able to administer to the site themselves... We could set up 
a secure sign in and allow them access to the CGI bin through html pages or 
shtml pages.  Not too familiar with the CMS side of things for something like 
this.

end of client request.


How doable is this and what Can I use in the process?

SQL options are MySQL and PostGresQL.


-- 


Member - Liberal International  
This is [EMAIL PROTECTED]   Ici [EMAIL PROTECTED]
God Queen and country! Beware Anti-Christ rising!
Canada's New CONservatives - Same old Tory.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

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



Re: [PHP] Classes and OOP

2006-03-07 Thread Kim Hunter
PHP5 Objects, Patterns and Practice
1590593804 -  Matt Zandstra - Apress

This is a  good way to get a good grasp of object-oriented programming
covers the basics of uml as well as using decent examples to explain
the use of objective programming (unlike all the web sites out there
that i tried to understand)
its at least worth going to the book shop to flick through it to see
if you like it.

On 3/8/06, Wolf <[EMAIL PROTECTED]> wrote:
> I'm looking for a couple of good books or online sources where I can get
> a lot better grasp of Classes and OOP programming in general.  Mostly I
> use PHP so that is the best option.
>
> Thanks,
> Robert
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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



Re: [PHP] Classes and OOP

2006-03-07 Thread Anthony Ettinger
On 3/7/06, Wolf <[EMAIL PROTECTED]> wrote:
> I'm looking for a couple of good books or online sources where I can get
> a lot better grasp of Classes and OOP programming in general.  Mostly I
> use PHP so that is the best option.
>
> Thanks,
> Robert
>


PHP5 - Objects, Patterns, and Best Practices (publisher apress)
http://tinyurl.com/ohybj


I just finished reading this book, it's an excellent source for OOP
with php5. Also includes common patterns, complete with UML diagrams,
something you rarely see in programming books, at least the ones I've
read.



--
Anthony Ettinger
Signature: http://chovy.dyndns.org/hcard.html

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



[PHP] max unique number

2006-03-07 Thread Pieter du Toit
Hi guys

How do i get a unique max number from a mysql table column? 

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



RE: [PHP] max unique number

2006-03-07 Thread jblanchard
[snip]
How do i get a unique max number from a mysql table column? 
[/snip]

SELECT MAX(number) FROM table LIMIT 1;

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



Re: [PHP] Poker stats GET/POST page devleopment

2006-03-07 Thread Miles Thompson

At 12:26 PM 3/7/2006, The Doctor wrote:


Someone wishes to develop a site using PHP/SQL .


Here are the specs:

The site the client is looking for is not a gaming site.

It is a site where players register to keep track of their winnings on 
GAMING sites.  It will have a freeroll side(where players get points not 
money)  and a Money tour side where players will win money and points.


This site will request (GET) data from the gaming sites for the registered 
members and compile(POST) the info into the db.  A number of queries will 
need to be set up ie.


top 10 - 20 - 50 for free roll
top 10 - 20 - 50 for money tour

List of registered members   by date registered

List of registered members   by points earned

List of registered members   by money won

List of registered members   by last name alphabetacally

We should also have a db of all the poker sites which we could concatenate 
with other queries.


ie.  registered members placements in xxxpokerroom.com  etc.

I hope all this makes sense to you.  Let me know if any of this is not doable.

P.S. They want to able to administer to the site themselves... We could 
set up a secure sign in and allow them access to the CGI bin through html 
pages or shtml pages.  Not too familiar with the CMS side of things for 
something like this.


end of client request.


How doable is this and what Can I use in the process?

SQL options are MySQL and PostGresQL.

Member - Liberal International
This is [EMAIL PROTECTED]   Ici [EMAIL PROTECTED]
God Queen and country! Beware Anti-Christ rising!
Canada's New CONservatives - Same old Tory.


Yes, this is doable, but do you have permission to query the results on the 
gaming sites? I should think they would be very reluctant to release that 
information.


PostGreSQL would let you do subqueries, so some operations will be a little 
simpler.


So -- yes you can do it, using PHP - Ruby - Python - Perl or ??? What's the 
real question?


Cheers - Miles in Nova Scotia. 



--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.1.375 / Virus Database: 268.2.0/275 - Release Date: 3/6/2006

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



RE: [PHP] max unique number

2006-03-07 Thread Philip Hallstrom

[snip]
How do i get a unique max number from a mysql table column?
[/snip]

SELECT MAX(number) FROM table LIMIT 1;


That might not be unique though... I'm wondering if the original poster is 
looking for AUTO_INCREMENT (ie. sequences) to ensure a unique id to use 
for insertion...?


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



Re: [PHP] max unique number

2006-03-07 Thread John Meyer
Philip Hallstrom wrote:
>> [snip]
>> How do i get a unique max number from a mysql table column?
>> [/snip]
>>
>> SELECT MAX(number) FROM table LIMIT 1;
> 
> That might not be unique though... I'm wondering if the original poster
> is looking for AUTO_INCREMENT (ie. sequences) to ensure a unique id to
> use for insertion...?
> 

mysql_insert_id() should do the trick for an automatically incremented
sequence.

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



[PHP] LDAP and Single Sign On

2006-03-07 Thread Justin Cook
We are developing an intranet for my company. I would like to implement a 
single sign on service. We have Active Directory on one server and the intranet 
is being housed on a Redhat Linux server. When the internal user pulls up the 
intranet, I would like it to check to see if they successfully joined the 
domain when they logged into their personal machine, if so they do not need to 
log on to the intranet. Does anybody have any links to tutorials on this? 
Thanks!

RE: [PHP] encrypt and decrypt in php

2006-03-07 Thread Shaunak Kashyap
When you say that it is not working properly, what exactly is the
problem? Are you getting any error messages? What version of PHP are you
using? What platform is PHP installed on?

The reason I ask those questions is that
http://us2.php.net/manual/en/ref.mcrypt.php states that the mcrypt
functions need the mcrypt libraries to work. Perhaps the reason your
functions are not working is because those libraries are not installed
on your system.

Of course, you could just use Barry's suggestion of using the session
since it seems to meet your end goals.


Shaunak Kashyap
 
Senior Web Developer
WPT Enterprises, Inc.
5700 Wilshire Blvd., Suite 350
Los Angeles, CA 90036
 
Direct: 323.330.9870
Main: 323.330.9900
 
www.worldpokertour.com
 
Confidentiality Notice:  This e-mail transmission (and/or the
attachments accompanying) it may contain confidential information
belonging to the sender which is protected.  The information is intended
only for the use of the intended recipient.  If you are not the intended
recipient, you are hereby notified that any disclosure, copying,
distribution or taking of any action in reliance on the contents of this
information is prohibited. If you have received this transmission in
error, please notify the sender by reply e-mail and destroy all copies
of this transmission.

> -Original Message-
> From: suresh kumar [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, March 07, 2006 12:45 AM
> To: php-general@lists.php.net
> Subject: [PHP] encrypt and decrypt in php
> 
> I searched google,weberdev and php.net sites. i implemented the 2
encrypt
> and decrypt functions  mcrypt_encrypt(),mcrypt_decrypt() and
mcrypt_ecb()
> functions.but it not working properly.i dont need more complicated
encrypt
> and decrypt functionality.just i want to encrypt my user id when i
pass
> from page1 to page2 and i want to decrypt  it in page2.i am looking
> forward reply from u
> 
>  A.suresh
> 
> 
> -
>  Jiyo cricket on Yahoo! India cricket
> Yahoo! Messenger Mobile Stay in touch with your buddies all the time.

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



RE: [PHP] LDAP and Single Sign On

2006-03-07 Thread Shaunak Kashyap
Maybe this will help: http://us2.php.net/manual/en/ref.ldap.php

Shaunak Kashyap
 
Senior Web Developer
WPT Enterprises, Inc.
5700 Wilshire Blvd., Suite 350
Los Angeles, CA 90036
 
Direct: 323.330.9870
Main: 323.330.9900
 
www.worldpokertour.com
 
Confidentiality Notice:  This e-mail transmission (and/or the
attachments accompanying) it may contain confidential information
belonging to the sender which is protected.  The information is intended
only for the use of the intended recipient.  If you are not the intended
recipient, you are hereby notified that any disclosure, copying,
distribution or taking of any action in reliance on the contents of this
information is prohibited. If you have received this transmission in
error, please notify the sender by reply e-mail and destroy all copies
of this transmission.


> -Original Message-
> From: Justin Cook [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, March 07, 2006 9:55 AM
> To: php-general@lists.php.net
> Subject: [PHP] LDAP and Single Sign On
> 
> We are developing an intranet for my company. I would like to
implement a
> single sign on service. We have Active Directory on one server and the
> intranet is being housed on a Redhat Linux server. When the internal
user
> pulls up the intranet, I would like it to check to see if they
> successfully joined the domain when they logged into their personal
> machine, if so they do not need to log on to the intranet. Does
anybody
> have any links to tutorials on this? Thanks!

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



[PHP] What am I missing?

2006-03-07 Thread Gustav Wiberg

Hi there!

Why...

I have this code:

Add manufacturer:
action="admin/phpfunctions/addnewmanufacturer.php?frmManufacturer=$frmIDManufacturer;?>&frmModel=" method="post">





When i press the submit - button, I get this error:

Not Found
The requested URL 
/mobilkamera/admin/admin/phpfunctions/addnewmanufacturer.php was not found 
on this server.


Apache/2.0.53 (Win32) Server at 192.168.0.3 Port 80

Why is there TWO admins? Why isn't the path like this...?
The requested URL /mobilkamera/admin/phpfunctions/addnewmanufacturer.php was 
not found on this server.


???

If this is not a question that suits the list, please guide me tips where to 
look...


Best regards
/Gustav Wiberg

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



RE: [PHP] LDAP and Single Sign On

2006-03-07 Thread Justin Cook
I've been there. I can connect and search my active directory, that's  no 
problem. I'm more curious on how to check to see if they have  already 
authenticated to the domain.  _  

From: Shaunak Kashyap [mailto:[EMAIL PROTECTED]
To: Justin Cook [mailto:[EMAIL PROTECTED], php-general@lists.php.net
Sent: Tue, 07 Mar 2006 12:06:42 -0600
Subject: RE: [PHP] LDAP and Single Sign On

Maybe this will help: http://us2.php.net/manual/en/ref.ldap.php

Shaunak Kashyap
 
Senior Web Developer
WPT Enterprises, Inc.
5700 Wilshire Blvd., Suite 350
Los Angeles, CA 90036
 
Direct: 323.330.9870
Main: 323.330.9900
 
www.worldpokertour.com
 
Confidentiality Notice:  This e-mail transmission (and/or the
attachments accompanying) it may contain confidential information
belonging to the sender which is protected.  The information is intended
only for the use of the intended recipient.  If you are not the intended
recipient, you are hereby notified that any disclosure, copying,
distribution or taking of any action in reliance on the contents of this
information is prohibited. If you have received this transmission in
error, please notify the sender by reply e-mail and destroy all copies
of this transmission.


> -Original Message-
> From: Justin Cook [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, March 07, 2006 9:55 AM
> To: php-general@lists.php.net
> Subject: [PHP] LDAP and Single Sign On
> 
> We are developing an intranet for my company. I would like to
implement a
> single sign on service. We have Active Directory on one server and the
> intranet is being housed on a Redhat Linux server. When the internal
user
> pulls up the intranet, I would like it to check to see if they
> successfully joined the domain when they logged into their personal
> machine, if so they do not need to log on to the intranet. Does
anybody
> have any links to tutorials on this? Thanks!

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


  

Re: [PHP] What am I missing?

2006-03-07 Thread Joe Henry
On Tuesday 07 March 2006 11:45 am, Gustav Wiberg wrote:

>  action="admin/phpfunctions/addnewmanufacturer.php?frmManufacturer= echo $frmIDManufacturer;?>&frmModel="
> method="post"> 
> 
> 

You could try using an absolute rather than a relative path:

 /mobilkamera/admin/phpfunctions/addnewmanufacturer.php
-- 
Joe Henry
www.celebrityaccess.com
[EMAIL PROTECTED]

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



RE: [PHP] What am I missing?

2006-03-07 Thread Shaunak Kashyap
It is more of an HTML/HTTP question than PHP but here's my shot at a
possible explanation:

The file containing the form code seems to live in the
/mobilkamera/admin/ directory. Therefore action="admin/phpfunctions..."
implies that the form is to be submitted to that path starting from the
current directory (i.e. /mobilkamera/admin/), which resolves to
/mobilkamera/admin/admin/phpfunctions...

One solution would be remove the "admin/" from the action. Another (and
probably better solution) would be to use absolute paths, as Joe Henry
suggests.

Shaunak Kashyap
 
Senior Web Developer
WPT Enterprises, Inc.
5700 Wilshire Blvd., Suite 350
Los Angeles, CA 90036
 
Direct: 323.330.9870
Main: 323.330.9900
 
www.worldpokertour.com
 
Confidentiality Notice:  This e-mail transmission (and/or the
attachments accompanying) it may contain confidential information
belonging to the sender which is protected.  The information is intended
only for the use of the intended recipient.  If you are not the intended
recipient, you are hereby notified that any disclosure, copying,
distribution or taking of any action in reliance on the contents of this
information is prohibited. If you have received this transmission in
error, please notify the sender by reply e-mail and destroy all copies
of this transmission.


> -Original Message-
> From: Gustav Wiberg [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, March 07, 2006 10:45 AM
> To: PHP General
> Subject: [PHP] What am I missing?
> 
> Hi there!
> 
> Why...
> 
> I have this code:
> 
> Add manufacturer:
> 
action="admin/phpfunctions/addnewmanufacturer.php?frmManufacturer= echo
> $frmIDManufacturer;?>&frmModel="
method="post">
> 
> 
> 
> 
> When i press the submit - button, I get this error:
> 
> Not Found
> The requested URL
> /mobilkamera/admin/admin/phpfunctions/addnewmanufacturer.php was not
found
> on this server.
> 
> Apache/2.0.53 (Win32) Server at 192.168.0.3 Port 80
> 
> Why is there TWO admins? Why isn't the path like this...?
> The requested URL
/mobilkamera/admin/phpfunctions/addnewmanufacturer.php
> was
> not found on this server.
> 
> ???
> 
> If this is not a question that suits the list, please guide me tips
where
> to
> look...
> 
> Best regards
> /Gustav Wiberg
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

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



Re: [PHP] What am I missing?

2006-03-07 Thread Gustav Wiberg


- Original Message - 
From: "Shaunak Kashyap" <[EMAIL PROTECTED]>
To: "Gustav Wiberg" <[EMAIL PROTECTED]>; "PHP General" 


Sent: Tuesday, March 07, 2006 8:05 PM
Subject: RE: [PHP] What am I missing?


It is more of an HTML/HTTP question than PHP but here's my shot at a
possible explanation:

The file containing the form code seems to live in the
/mobilkamera/admin/ directory. Therefore action="admin/phpfunctions..."
implies that the form is to be submitted to that path starting from the
current directory (i.e. /mobilkamera/admin/), which resolves to
/mobilkamera/admin/admin/phpfunctions...

One solution would be remove the "admin/" from the action. Another (and
probably better solution) would be to use absolute paths, as Joe Henry
suggests.

Shaunak Kashyap

Senior Web Developer
WPT Enterprises, Inc.
5700 Wilshire Blvd., Suite 350
Los Angeles, CA 90036

Direct: 323.330.9870
Main: 323.330.9900

www.worldpokertour.com

Confidentiality Notice:  This e-mail transmission (and/or the
attachments accompanying) it may contain confidential information
belonging to the sender which is protected.  The information is intended
only for the use of the intended recipient.  If you are not the intended
recipient, you are hereby notified that any disclosure, copying,
distribution or taking of any action in reliance on the contents of this
information is prohibited. If you have received this transmission in
error, please notify the sender by reply e-mail and destroy all copies
of this transmission.



-Original Message-
From: Gustav Wiberg [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 07, 2006 10:45 AM
To: PHP General
Subject: [PHP] What am I missing?

Hi there!

Why...

I have this code:

Add manufacturer:

action="admin/phpfunctions/addnewmanufacturer.php?frmManufacturer=
echo
$frmIDManufacturer;?>&frmModel="

method="post">





When i press the submit - button, I get this error:

Not Found
The requested URL
/mobilkamera/admin/admin/phpfunctions/addnewmanufacturer.php was not

found

on this server.

Apache/2.0.53 (Win32) Server at 192.168.0.3 Port 80

Why is there TWO admins? Why isn't the path like this...?
The requested URL

/mobilkamera/admin/phpfunctions/addnewmanufacturer.php

was
not found on this server.

???

If this is not a question that suits the list, please guide me tips

where

to
look...

Best regards
/Gustav Wiberg

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


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

Thanx!!!

/Gustav Wiberg

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



RE: [PHP] OpenSSL error:0E06D06C:configuration file routines:func(109):reason(108) ??!

2006-03-07 Thread Daevid Vincent
I just tried this with PHP 5.1.1 and OpenSSL 0.9.7i and got the exact same
errors.

> -Original Message-
> I copied and pasted the example found here:
> http://www.php.net/openssl_csr_new
> And this one too:
> http://www.php.net/manual/en/function.openssl-pkey-new.php
> 
> And I get the output that looks like valid 'gibberish' for 
> all three (CSR,
> Cert, PK), except what concerns me is that I get fifteen of the same
> (completely useless and unhelpful) errors too?!
> 
> while (($e = openssl_error_string()) !== false)
>echo $e . "\n";
> 
> error:0E06D06C:configuration file routines:func(109):reason(108)
>   ... Snip the other 13 of these ...
> error:0E06D06C:configuration file routines:func(109):reason(108)
> 
> Google doesn't return a single hit for that error message!?
> 
> I tried this "trick" to 'clear' the error buffer prior to my cert
> generation, 
> but no luck.
> http://www.php.net/manual/en/function.openssl-error-string.php
> 
> I'm using PHP v5.0.3 on linux.
> 
> This program makes use of the Zend Scripting Language Engine:
> Zend Engine v2.0.3, Copyright (c) 1998-2004 Zend Technologies
> with Zend Extension Manager v1.0.9, Copyright (c) 
> 2003-2005, by Zend
> Technologies
> with Zend Optimizer v2.6.0, Copyright (c) 1998-2005, by Zend
> Technologies
> 
> # openssl version  
> OpenSSL 0.9.7d 17 Mar 2004

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



[PHP] Re: What am I missing?

2006-03-07 Thread David Dorward
Gustav Wiberg wrote:
> I have this code:
> 
> Add manufacturer:

Bold then a line break? Shouldn't this be a heading?

> action="admin/phpfunctions/addnewmanufacturer.php?frmManufacturer= The requested URL
> /mobilkamera/admin/admin/phpfunctions/addnewmanufacturer.php was not found
> on this server.

> Why is there TWO admins? Why isn't the path like this...?

Presumably because the resource with that form on it is found at the
URL /mobilkamera/admin/SOMETHING and your URL is relative to that.

http://www.iusmentis.com/technology/www/relativeurls/

-- 
David Dorward      
 Home is where the ~/.bashrc is

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



RE: [PHP] LDAP and Single Sign On

2006-03-07 Thread jblanchard
[snip]
We are developing an intranet for my company. I would like to implement
a single sign on service. We have Active Directory on one server and the
intranet is being housed on a Redhat Linux server. When the internal
user pulls up the intranet, I would like it to check to see if they
successfully joined the domain when they logged into their personal
machine, if so they do not need to log on to the intranet. Does anybody
have any links to tutorials on this? Thanks!

[/snip]

Just to be clear, you want to take the network logon (from the Windows
environment) and compare it against the AD via LDAP when someone
accesses the intranet to make sure that they are authorized?

I don't think that it is possible; it is a question that I have asked
before. I have seen this sort of behavior before; when all of the boxes
were Windows boxes (IIS web servers, etc).

As far as I can tell you will have to ask the user to login at the web
application level again, but you can verify it against your AD via LDAP
with the basic stuff from http://www.php.net/ldap



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



[PHP] class constants

2006-03-07 Thread Arnaldo Gandol
how can I to iterate the class constant without knowing their names?, I've
reviewed the Class/Object Functions and Reflexion and nothing, I dont want
to use static class variables, can any one help.


[PHP] Building php-pcre extension on windows

2006-03-07 Thread Manish Marathe
PHP experts everywhere!!

I am building PHP 5.1.2 on windows without pcre-regex extension. I am
building building pcre independently and then I am building the extension
php_pcre.dll.

I build few other extensions too. I keep the extensions in c:\php\extensions
which is set in php.ini.

I am getting an error that php_pcre.dll extension is invalid or corrupt
whenever php call is being invoked.

I believe I am not building php_pcre.dll extension properly, although any
insights as to what could be the problem. Also is OK to build php
--without-pcre-regex extension at all?

Thanks

--
Manish Marathe
SpikeSource, Inc.
http://developer.spikesource.com


RE: [PHP] LDAP and Single Sign On MORE THOUGHTS

2006-03-07 Thread jblanchard
[snip]
As far as I can tell you will have to ask the user to login at the web
application level again, but you can verify it against your AD via LDAP
with the basic stuff from http://www.php.net/ldap
[/snip]

We are sitting here having a discussion on login techniques and I cam up
with a thought...why not have a login script write a cookie that then
coulod be read by PHP and compared against the AD via LDAP? Does anyone
see any gotcha's with that kind of process?

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



Re: [PHP] include not working properly?

2006-03-07 Thread Chris

robert mena wrote:

Hi,

I am facing a strange problem.  One of my classes uses a include("Log.php")
to enable to to use the Log class that comes with pear.

*Fatal error*: require_once()
[function.require]:
Failed opening required 'Log.php'
(include_path='.:/usr/local/lib/php/:/home/httpd/html/php/:/home/httpd/html/include/php/')
in */var/www/html/domain/php/Conexion.inc* on line *14*
**
*I do have the Log.php*
**
*ls -lsa /usr/local/lib/php/Log.php
20 -rw-r--r--  1 root root 18563 Mai 25  2005 /usr/local/lib/php/Log.php*


The only difference I can see is that I don't have the / on the end of 
my include paths:


include_path = ".:/usr/share/pear:/usr/local/php/lib/php"

Try removing the / from the end of each folder and see what happens ?

--
Postgresql & php tutorials
http://www.designmagick.com/

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



Re: [PHP] class constants

2006-03-07 Thread Chris

Arnaldo Gandol wrote:

how can I to iterate the class constant without knowing their names?, I've
reviewed the Class/Object Functions and Reflexion and nothing, I dont want
to use static class variables, can any one help.



Constants aren't per class, they are per system. Whether you define them 
in a class or not won't change this.


You can list all constants using 
http://www.php.net/manual/en/function.get-defined-constants.php



If you want to look at the class variables:
http://www.php.net/manual/en/function.get-class-vars.php

--
Postgresql & php tutorials
http://www.designmagick.com/

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



Re: [PHP] Prepared statements

2006-03-07 Thread Curt Zirzow
On Mon, Mar 06, 2006 at 10:03:10PM +0100, Julius Hacker wrote:
> Curt Zirzow wrote:
> >
> > I assume your loop is something like:
> >   while(condition) {
> > $auction_parts['id'] = 'some value';
> > $auction_parts['name'] = 'some value';
> > ...
> > $insert->execute();
> >   }
> >   
> Yes, thats it.
> 
> > My first guess would be, if not aleady done, initialize
> > $auction_parts before you do your bind_param() with something like:
> >
> >   $auction_parts = array('id' => null, 'name' => null, ...);
> >   $insert->bind_param("issdsis", $auction_house["id"], ...);
> >   
> Unfortunately it helps nothing :-(

Ok, i didn't really think it would but might have shown a obvious
bug with mysqli. 

According to your original post it was odd that the update prepared
statment didn't complain about a NULL value, but the insert did,
and it does seem to be related to bind_param and prepare.

What are your versions of:
  php?
  mysql_client php is built with?
  mysql server you are connecting to?

> But I think also that it's something because of the declaration and
> initalization of the variables because it works if I have the bind_param
> in the loop after I gave the variables their values.
> But to have the bind_param in the loop isn't the best solution I think.

agreed.

Curt.
-- 
cat .signature: No such file or directory

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



RE: [PHP] class constants

2006-03-07 Thread Shaunak Kashyap
> 
> Constants aren't per class, they are per system. Whether you define
them
> in a class or not won't change this.
> 
> You can list all constants using
> http://www.php.net/manual/en/function.get-defined-constants.php
> 
> 

Actually, PHP5 allows constants per class, aka class constants. I think
that's what the OP is referring to.

Shaunak Kashyap
 
Senior Web Developer
WPT Enterprises, Inc.
5700 Wilshire Blvd., Suite 350
Los Angeles, CA 90036
 
Direct: 323.330.9870
Main: 323.330.9900
 
www.worldpokertour.com
 
Confidentiality Notice:  This e-mail transmission (and/or the
attachments accompanying) it may contain confidential information
belonging to the sender which is protected.  The information is intended
only for the use of the intended recipient.  If you are not the intended
recipient, you are hereby notified that any disclosure, copying,
distribution or taking of any action in reliance on the contents of this
information is prohibited. If you have received this transmission in
error, please notify the sender by reply e-mail and destroy all copies
of this transmission.

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



Re: [PHP] class constants

2006-03-07 Thread Chris

Shaunak Kashyap wrote:

Constants aren't per class, they are per system. Whether you define


them


in a class or not won't change this.

You can list all constants using
http://www.php.net/manual/en/function.get-defined-constants.php





Actually, PHP5 allows constants per class, aka class constants. I think
that's what the OP is referring to.


I have been educated :) I didn't know they existed.

They don't show up in var_dump or anything like it :/

From the looks of things you can't get them - maybe put in a feature 
request (bugs.php.net) and see what happens for the next version.


--
Postgresql & php tutorials
http://www.designmagick.com/

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



RE: [PHP] class constants

2006-03-07 Thread Jared Williams

Hi,

ReflectionClass

getConstant
getConstants
hasConstant

http://www.ren.dotgeek.org/classbrowser/class.php?class=ReflectionClass 

Jared

> -Original Message-
> From: Arnaldo Gandol [mailto:[EMAIL PROTECTED] 
> Sent: 07 March 2006 21:03
> To: php-general@lists.php.net
> Subject: [PHP] class constants
> 
> how can I to iterate the class constant without knowing their 
> names?, I've reviewed the Class/Object Functions and 
> Reflexion and nothing, I dont want to use static class 
> variables, can any one help.
> 

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



[PHP] Incremental Date Based ID

2006-03-07 Thread Kevin Murphy
I'm trying to set up an ID field that works like this for news  
articles that are posted to a website.


2006-03-05a
2006-03-05b

I know how to generate the date, and I am pretty sure I can generate  
the letter code based on counting the number of rows and then  
assigning the next letter (we will never have more than 26 in a  
day... usually its closer to 1 or 2 per day).


The problem is if there has been something deleted.

2006-03-05a
2006-03-05c

If I then Count the rows with this date I get an answer of 2, and so  
the next letter should be "c" but there already is a "c" because "b"  
got deleted.


So, is there any way of generating this style ID number automatically?

--
Kevin Murphy
Webmaster - Information and Marketing Services
Western Nevada Community College
www.wncc.edu
(775) 445-3326

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



Re: [PHP] class constants

2006-03-07 Thread Arnaldo Gandol
I've try this with no successful results. the constant rr and gg were not in
the array  $ee.

 $value)
echo $key." => ".$value."";
?>

On 3/7/06, Jared Williams <[EMAIL PROTECTED]> wrote:
>
>
> Hi,
>
> ReflectionClass
>
> getConstant
> getConstants
> hasConstant
>
> http://www.ren.dotgeek.org/classbrowser/class.php?class=ReflectionClass
>
> Jared
>
> > -Original Message-
> > From: Arnaldo Gandol [mailto:[EMAIL PROTECTED]
> > Sent: 07 March 2006 21:03
> > To: php-general@lists.php.net
> > Subject: [PHP] class constants
> >
> > how can I to iterate the class constant without knowing their
> > names?, I've reviewed the Class/Object Functions and
> > Reflexion and nothing, I dont want to use static class
> > variables, can any one help.
> >
>
>


[PHP] Re: Incremental Date Based ID

2006-03-07 Thread Al

Kevin Murphy wrote:
I'm trying to set up an ID field that works like this for news articles 
that are posted to a website.


2006-03-05a
2006-03-05b

I know how to generate the date, and I am pretty sure I can generate the 
letter code based on counting the number of rows and then assigning the 
next letter (we will never have more than 26 in a day... usually its 
closer to 1 or 2 per day).


The problem is if there has been something deleted.

2006-03-05a
2006-03-05c

If I then Count the rows with this date I get an answer of 2, and so the 
next letter should be "c" but there already is a "c" because "b" got 
deleted.


So, is there any way of generating this style ID number automatically?

--Kevin Murphy
Webmaster - Information and Marketing Services
Western Nevada Community College
www.wncc.edu
(775) 445-3326



Why not simply use the Unix time stamp. time() If more than one can arrive 
within the same second, append a letter.

If users need to see the key, use date() to decode it for them

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



Re: [PHP] Incremental Date Based ID

2006-03-07 Thread Chris

Kevin Murphy wrote:
I'm trying to set up an ID field that works like this for news  articles 
that are posted to a website.


2006-03-05a
2006-03-05b

I know how to generate the date, and I am pretty sure I can generate  
the letter code based on counting the number of rows and then  assigning 
the next letter (we will never have more than 26 in a  day... usually 
its closer to 1 or 2 per day).


The problem is if there has been something deleted.

2006-03-05a
2006-03-05c

If I then Count the rows with this date I get an answer of 2, and so  
the next letter should be "c" but there already is a "c" because "b"  
got deleted.


So, is there any way of generating this style ID number automatically?



Why do you want to do this? If you want to order your results, make it a 
timestamp field instead of a date field then:


select * from table order by timestamp_field desc;


If you want to count the number of posts a day, then it depends on which 
database you are using.


--
Postgresql & php tutorials
http://www.designmagick.com/

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



Re: [PHP] Re: Incremental Date Based ID

2006-03-07 Thread Kevin Murphy
Well, part of the issue is that I want to be able to use this as part  
of the link:


/news.php?article=2006-03-05a
/news.php?article=2006-03-05b

which i will eventually do a htacess rewrite to make it look like

/news/2006-03-05a.php
/news/2006-03-05a.php

I don't think I can do that with just the Unix timestamp.

On Mar 7, 2006, at 4:56 PM, Al wrote:


Kevin Murphy wrote:
I'm trying to set up an ID field that works like this for news  
articles that are posted to a website.

2006-03-05a
2006-03-05b
I know how to generate the date, and I am pretty sure I can  
generate the letter code based on counting the number of rows and  
then assigning the next letter (we will never have more than 26 in  
a day... usually its closer to 1 or 2 per day).

The problem is if there has been something deleted.
2006-03-05a
2006-03-05c
If I then Count the rows with this date I get an answer of 2, and  
so the next letter should be "c" but there already is a "c"  
because "b" got deleted.
So, is there any way of generating this style ID number  
automatically?

--Kevin Murphy
Webmaster - Information and Marketing Services
Western Nevada Community College
www.wncc.edu
(775) 445-3326



Why not simply use the Unix time stamp. time() If more than one can  
arrive within the same second, append a letter.


If users need to see the key, use date() to decode it for them


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



Re: [PHP] class constants

2006-03-07 Thread Arnaldo Gandol
getConstants());
?>

Thank you, I've try this above and works, I hadn't seen the message below.
Excuse my english.



On 3/7/06, Jared Williams < [EMAIL PROTECTED]> wrote:
> >
> >
> > Hi,
> >
> > ReflectionClass
> >
> > getConstant
> > getConstants
> > hasConstant
> >
> > http://www.ren.dotgeek.org/classbrowser/class.php?class=ReflectionClass
> >
> > Jared
> >
>


Re: [PHP] Re: Incremental Date Based ID

2006-03-07 Thread Chris

Kevin Murphy wrote:
Well, part of the issue is that I want to be able to use this as part  
of the link:


/news.php?article=2006-03-05a
/news.php?article=2006-03-05b

which i will eventually do a htacess rewrite to make it look like

/news/2006-03-05a.php
/news/2006-03-05a.php

I don't think I can do that with just the Unix timestamp.


That doesn't answer the question about why you care about gaps or why 
you need the number of posts per day.




On Mar 7, 2006, at 4:56 PM, Al wrote:


Kevin Murphy wrote:

I'm trying to set up an ID field that works like this for news  
articles that are posted to a website.

2006-03-05a
2006-03-05b
I know how to generate the date, and I am pretty sure I can  generate 
the letter code based on counting the number of rows and  then 
assigning the next letter (we will never have more than 26 in  a 
day... usually its closer to 1 or 2 per day).

The problem is if there has been something deleted.
2006-03-05a
2006-03-05c
If I then Count the rows with this date I get an answer of 2, and  so 
the next letter should be "c" but there already is a "c"  because "b" 
got deleted.

So, is there any way of generating this style ID number  automatically?
--Kevin Murphy
Webmaster - Information and Marketing Services
Western Nevada Community College
www.wncc.edu
(775) 445-3326




Why not simply use the Unix time stamp. time() If more than one can  
arrive within the same second, append a letter.


If users need to see the key, use date() to decode it for them






--
Postgresql & php tutorials
http://www.designmagick.com/

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



RE: [PHP] Re: Incremental Date Based ID

2006-03-07 Thread Shaunak Kashyap
A possible solution:

Make a composite primary key where the first field is the date and the
second field would be of type enumeration (A..Z, in ascending order).
Then use MAX() WHERE  =  to
figure out the next primary key.

Shaunak Kashyap
 
Senior Web Developer
WPT Enterprises, Inc.
5700 Wilshire Blvd., Suite 350
Los Angeles, CA 90036
 
Direct: 323.330.9870
Main: 323.330.9900
 
www.worldpokertour.com
 
Confidentiality Notice:  This e-mail transmission (and/or the
attachments accompanying) it may contain confidential information
belonging to the sender which is protected.  The information is intended
only for the use of the intended recipient.  If you are not the intended
recipient, you are hereby notified that any disclosure, copying,
distribution or taking of any action in reliance on the contents of this
information is prohibited. If you have received this transmission in
error, please notify the sender by reply e-mail and destroy all copies
of this transmission.


> -Original Message-
> From: Kevin Murphy [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, March 07, 2006 5:06 PM
> To: php-general@lists.php.net
> Subject: Re: [PHP] Re: Incremental Date Based ID
> 
> Well, part of the issue is that I want to be able to use this as part
> of the link:
> 
> /news.php?article=2006-03-05a
> /news.php?article=2006-03-05b
> 
> which i will eventually do a htacess rewrite to make it look like
> 
> /news/2006-03-05a.php
> /news/2006-03-05a.php
> 
> I don't think I can do that with just the Unix timestamp.
> 
> On Mar 7, 2006, at 4:56 PM, Al wrote:
> 
> > Kevin Murphy wrote:
> >> I'm trying to set up an ID field that works like this for news
> >> articles that are posted to a website.
> >> 2006-03-05a
> >> 2006-03-05b
> >> I know how to generate the date, and I am pretty sure I can
> >> generate the letter code based on counting the number of rows and
> >> then assigning the next letter (we will never have more than 26 in
> >> a day... usually its closer to 1 or 2 per day).
> >> The problem is if there has been something deleted.
> >> 2006-03-05a
> >> 2006-03-05c
> >> If I then Count the rows with this date I get an answer of 2, and
> >> so the next letter should be "c" but there already is a "c"
> >> because "b" got deleted.
> >> So, is there any way of generating this style ID number
> >> automatically?
> >> --Kevin Murphy
> >> Webmaster - Information and Marketing Services
> >> Western Nevada Community College
> >> www.wncc.edu
> >> (775) 445-3326
> >
> >
> > Why not simply use the Unix time stamp. time() If more than one can
> > arrive within the same second, append a letter.
> >
> > If users need to see the key, use date() to decode it for them
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

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



Re: [PHP] Re: Incremental Date Based ID

2006-03-07 Thread Gerry Danen
Kevin,

You can do it with a Unix timestamp, but that would just confuse the issue.

Have you considered using two fields instead of one? An article ID and
and article sub-ID would be retrieved as article ID = date, and all
sub-ID's descending. The first record in the list would contain the
highest sub-ID, irregardless of gaps.

Gerry
http://groups.yahoo.com/group/php_and_mysql/

On 3/7/06, Kevin Murphy <[EMAIL PROTECTED]> wrote:
> Well, part of the issue is that I want to be able to use this as part
> of the link:
>
> /news.php?article=2006-03-05a
> /news.php?article=2006-03-05b
>
> which i will eventually do a htacess rewrite to make it look like
>
> /news/2006-03-05a.php
> /news/2006-03-05a.php
>
> I don't think I can do that with just the Unix timestamp.
>
> On Mar 7, 2006, at 4:56 PM, Al wrote:
>
> > Kevin Murphy wrote:
> >> I'm trying to set up an ID field that works like this for news
> >> articles that are posted to a website.
> >> 2006-03-05a
> >> 2006-03-05b
> >> I know how to generate the date, and I am pretty sure I can
> >> generate the letter code based on counting the number of rows and
> >> then assigning the next letter (we will never have more than 26 in
> >> a day... usually its closer to 1 or 2 per day).
> >> The problem is if there has been something deleted.
> >> 2006-03-05a
> >> 2006-03-05c
> >> If I then Count the rows with this date I get an answer of 2, and
> >> so the next letter should be "c" but there already is a "c"
> >> because "b" got deleted.
> >> So, is there any way of generating this style ID number
> >> automatically?
> >> --Kevin Murphy
> >> Webmaster - Information and Marketing Services
> >> Western Nevada Community College
> >> www.wncc.edu
> >> (775) 445-3326
> >
> >
> > Why not simply use the Unix time stamp. time() If more than one can
> > arrive within the same second, append a letter.
> >
> > If users need to see the key, use date() to decode it for them
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--
Gerry
http://portal.danen.org/

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



Re: [PHP] Re: Incremental Date Based ID

2006-03-07 Thread Gerry Danen
Should have read the whole thread first, I guess... :)

Gerry
http://groups.yahoo.com/group/php_and_mysql/

On 3/7/06, Shaunak Kashyap <[EMAIL PROTECTED]> wrote:
> A possible solution:
>
> Make a composite primary key where the first field is the date and the
> second field would be of type enumeration (A..Z, in ascending order).
> Then use MAX() WHERE  =  to
> figure out the next primary key.
>
> Shaunak Kashyap

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



Re: [PHP] Incremental Date Based ID

2006-03-07 Thread Miles Thompson

At 08:46 PM 3/7/2006, Kevin Murphy wrote:


I'm trying to set up an ID field that works like this for news
articles that are posted to a website.

2006-03-05a
2006-03-05b

I know how to generate the date, and I am pretty sure I can generate
the letter code based on counting the number of rows and then
assigning the next letter (we will never have more than 26 in a
day... usually its closer to 1 or 2 per day).

The problem is if there has been something deleted.

2006-03-05a
2006-03-05c

If I then Count the rows with this date I get an answer of 2, and so
the next letter should be "c" but there already is a "c" because "b"
got deleted.

So, is there any way of generating this style ID number automatically?

--
Kevin Murphy
Webmaster - Information and Marketing Services
Western Nevada Community College
www.wncc.edu
(775) 445-3326



Why make it so HARD??
Having gone that far, just timestamp your id. Not a  timestamp in the sense 
of it being triggered whenever a record was changed, but the time it 
was  created.


Better yet - use your publish date and assign a  sequence number to the 
article. Doesn't matter what the number is, but you can then use it to 
roughly - or accurately - sequence articles for publication. If articles 
have same sequence number they'll appear in whatever order they were added 
to the database.


For a count of the articles, just count(pub_date).

And yes, if you insist, you can generate the number automatically. Just 
establish a table for id values. It has two fields, table_name and id_value.
Write a function to grab the current id_value, then increment and store it. 
Note grab first, then increment and store. I still think this is much more 
work than you need.


Regards - Miles Thompson 



--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.1.375 / Virus Database: 268.2.0/275 - Release Date: 3/6/2006

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



Re: [PHP] Re: Incremental Date Based ID

2006-03-07 Thread Miles Thompson

At 09:05 PM 3/7/2006, Kevin Murphy wrote:


Well, part of the issue is that I want to be able to use this as part
of the link:

/news.php?article=2006-03-05a
/news.php?article=2006-03-05b

which i will eventually do a htacess rewrite to make it look like

/news/2006-03-05a.php
/news/2006-03-05a.php

I don't think I can do that with just the Unix timestamp.



Why not - treat the number as a string and assign that to the file.
I was under the impression you were storing the articles in a database.

Alternately, create a directory for each year, one for each month within 
the year, one for each day within the month, then sequence alphabetically 
within the day. Does this resemble the structure of the MS knowledgebase? Yep!


The first year Allnovascotia.com was published we did something like that, 
although the articles just had regular titles.


In any event - have fun.

Cheers - Miles

PS Convention in this group is to bottom post. /mt 



--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.1.375 / Virus Database: 268.2.0/275 - Release Date: 3/6/2006

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



[PHP] test security of code

2006-03-07 Thread Gregory Machin
Hi
Is there an application that can pass source code and report potential
security problem and or the live site ?
Many thanks
--
Gregory Machin
[EMAIL PROTECTED]
[EMAIL PROTECTED]
www.linuxpro.co.za
www.exponent.co.za
Web Hosting Solutions
Scalable Linux Solutions
www.iberry.info (support and admin)

+27 72 524 8096