php-general Digest 3 Jun 2006 14:23:06 -0000 Issue 4164

2006-06-03 Thread php-general-digest-help

php-general Digest 3 Jun 2006 14:23:06 - Issue 4164

Topics (messages 237310 through 237326):

Re: SPL Iterator and Associative Array
237310 by: Greg Beaver
237313 by: Jason Karns

Parse error: syntax error, unexpected '}'
237311 by: Mark Sargent
237312 by: Rick Emery
237314 by: Bagus Nugroho
237316 by: Mark Sargent

Re: php java intregration
237315 by: Vedanta Barooah
237319 by: Vedanta Barooah
237324 by: Rabin Vincent

Recall: [PHP] Parse error: syntax error, unexpected '}'
237317 by: Bagus Nugroho

HTTP HEADERS
237318 by: kartikay malhotra
237320 by: David Tulloh
237321 by: Joe Wollard

Re: OO purism sucks - this is a rant for anyone who is  allergic to 
thatkind of thing...
237322 by: Jochem Maas

$B$$d$G$9!#(B
237323 by: ƒ‰ƒCƒgƒjƒ“ƒOƒvƒ‰ƒYƒ}

New release of phpEditIni Ver 1.0 Beta4 is now available
237325 by: Jeremy O'Connor

Re: Retrieving Content
237326 by: chris smith

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

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


--
---BeginMessage---
Jason Karns wrote:
 I'm going to try my best to explain what I'm trying to do.
 
 I have my own class that has an array member.  This class itself implements
 Iterator.  One of the fields in the array is itself an array that I would
 like to iterate over. Here's some code:
 
 class Folio implements Iterator {
 $projects = array(
   array(
   'title'=,
   'clip'=,
   'small'=array('1','2','3')),
   array(
   'title'=,
   'clip'=,
   'small'=array('0','1','2'))
 );
 function title($x){
   return current($this-projects[$]['small']);
  ^^
 }
 
 function smalls($x){
   return $this-projects[$x]['small'];
 }
 }

snip
Hi Jason,

The code you pasted is littered with fatal errors and bugs (I marked one
example with ^^ above).  Please paste a real batch of code that you've
tested and reproduces the error and that will be much more helpful.  The
PHP version would be helpful to know as well.

Greg
---End Message---
---BeginMessage---
 -Original Message-
 From: Greg Beaver [mailto:[EMAIL PROTECTED] 
 Sent: Friday, June 02, 2006 10:39 PM
 To: Jason Karns
 Cc: php-general@lists.php.net
 Subject: Re: SPL Iterator and Associative Array
 
 Jason Karns wrote:
  I'm going to try my best to explain what I'm trying to do.
  
  I have my own class that has an array member.  This class itself 
  implements Iterator.  One of the fields in the array is itself an 
  array that I would like to iterate over. Here's some code:
  
snip
 
 snip
 Hi Jason,
 
 The code you pasted is littered with fatal errors and bugs (I 
 marked one example with ^^ above).  Please paste a real 
 batch of code that you've tested and reproduces the error and 
 that will be much more helpful.  The PHP version would be 
 helpful to know as well.
 
 Greg
 
 --
 No virus found in this incoming message.
 Checked by AVG Free Edition.
 Version: 7.1.394 / Virus Database: 268.8.1/354 - Release 
 Date: 6/1/2006
  
 

?php
class Folio implements Iterator {
private $projects = array();
private $valid = FALSE;
public function __construct($file = null) {
if(!is_null($file))
$this-load($file);
}
public function load($file){
...
$keys = array();
$values = array();
foreach ($projects as $project) {
$small = array();
$big = array();
foreach
($xpath-query('showcase/images/screenshot/thumbnail',$project) as $img){
$small[] = $img-nodeValue;}
foreach
($xpath-query('showcase/images/screenshot/src',$project) as $img){
$big[] = $img-nodeValue;}

$keys[] =
$xpath-query('@id',$project)-item(0)-nodeValue;
$values[] = array(

'title'=$xpath-query('showcase/title',$project)-item(0)-nodeValue,

'href'=$xpath-query('livesite',$project)-item(0)-nodeValue,

'clip'=$xpath-query('showcase/images/feature/thumbnail',$project)-item(0)
-nodeValue,
'big'=$big,
'small'=$small,

'text'=$xpath-query('showcase/description',$project)-item(0)-nodeValue);
}
$this-projects = array_combine($keys,$values);
}

function smalls($x=null){
if(is_null($x) or !key_exists($x,$this-projects)) $x =
$this-key();
  

php-general Digest 4 Jun 2006 04:15:43 -0000 Issue 4165

2006-06-03 Thread php-general-digest-help

php-general Digest 4 Jun 2006 04:15:43 - Issue 4165

Topics (messages 237327 through 237333):

ASCII Chars Only
237327 by: Richard Collyer
237328 by: Rabin Vincent
237329 by: Richard Collyer

.htaccess - change index.php to index.abc
237330 by: Labunski
237332 by: Joe Wollard

Delete
237331 by: George Babichev

Re: php java intregration
237333 by: Vedanta Barooah

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

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


--
---BeginMessage---

Hello,

Trying to get the following working. I am trynig to select only ASCII 
characters (not extended ASCII) so that if the string contains 
characters outside the 32 - 126 range of good characters then $Discard 
is returned as  0.


But it is going overboard telling me that every character is bad :(

Ideas?

Cheers
Richard


$test = 飯島真�as;

function non_ascii($str) {  
$Discard = 0;

for ($i=0; $i  strlen($str); $i++)
{
$char = ord($test{$i});

if (($char  32 || $char  126)) {
$Discard++;
}
}   

return $Discard;
}

print non_ascii($test);
---End Message---
---BeginMessage---

On 6/3/06, Richard Collyer [EMAIL PROTECTED] wrote:

Hello,

Trying to get the following working. I am trynig to select only ASCII
characters (not extended ASCII) so that if the string contains
characters outside the 32 - 126 range of good characters then $Discard
is returned as  0.

But it is going overboard telling me that every character is bad :(

Ideas?

Cheers
Richard


$test = 飯島真理as;

function non_ascii($str) {
$Discard = 0;

for ($i=0; $i  strlen($str); $i++)
{
$char = ord($test{$i});


That should be $str, not $test.

Rabin
---End Message---
---BeginMessage---

Rabin Vincent wrote:

On 6/3/06, Richard Collyer [EMAIL PROTECTED] wrote:

Hello,

Trying to get the following working. I am trynig to select only ASCII
characters (not extended ASCII) so that if the string contains
characters outside the 32 - 126 range of good characters then $Discard
is returned as  0.

But it is going overboard telling me that every character is bad :(

Ideas?

Cheers
Richard


$test = 飯島真理as;

function non_ascii($str) {
$Discard = 0;

for ($i=0; $i  strlen($str); $i++)
{
$char = ord($test{$i});


That should be $str, not $test.

Rabin


Doh!

I am indeed a spanner. Thanks.

Cheers
Richard
---End Message---
---BeginMessage---
Hello,

What should I change in .htaccess, so that visitors will see index.abc 
instead of index.php.
I just wanna hide file's extension.

Thanks 
---End Message---
---BeginMessage---

If you don't want to change the names of the files themselve from .php to
.abc then you'd need to use something like mod_rewrite for apache's HTTPD.
I'm not entirely certain as to how you'd do this, but I've included what I
normally use to hide index.php in the url. If possible I'd put this in
httpd.conf instead of .htaccess - there are performance concerns that may be
involved there. Anyway, I hope this gets you started or sparks an idea from
another list member.

Directory /var/www/html/
 RewriteEngine on
 RewriteBase /

 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule ^(.*)$ index.php/$1 [L,QSA]
/Directory



On 6/3/06, Labunski [EMAIL PROTECTED] wrote:


Hello,

What should I change in .htaccess, so that visitors will see index.abc
instead of index.php.
I just wanna hide file's extension.

Thanks

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


---End Message---
---BeginMessage---

Hello everyone! I wrote a blog application, but now for the admin panel, i
am trying to add a feature to delete blog posts. It would show the title of
the post next to it, and have a delete link which would delete it. How would
I do this? I mean if I have multiple blog entry's, how would I delete them
without using php my admin?
---End Message---
---BeginMessage---

the pecl snapshots have the dll php_java.dll, but does not have the
jar php_java.jar which is also required?
- vedanta

On 6/3/06, Rabin Vincent [EMAIL PROTECTED] wrote:

On 6/2/06, Vedanta Barooah [EMAIL PROTECTED] wrote:
 i am setting up php_java.dll extension under windows/iis, my php
 version is 5.1.2. can any one point me to the download location of
 php_java.jar which is needed for the setup.

Download Collection of 

Re: [PHP] Re: php java intregration

2006-06-03 Thread Vedanta Barooah

So i tried to install the java support using the info available at
php.net/java but things here are still upset:

here is my configure:

'./configure' '--with-apxs2=/home/vedanta/srv/httpd2/bin/apxs'
'--with-config-file-path=/home/vedanta/srv/php5'
'--prefix=/home/vedanta/srv/php5' '--with-java=/opt/sun-jdk-1.4.2.10'
'--enable-java'

the build and install is a success, there is nothing created, which is
related to java, not even a directory named ext/java in the source
tree exists. the pecl.php.net site has no package named java...
finally i search the php-src cvs tree and  whoa! - the
php-src/ext/java/ java tree is empty - are the extns removed?? -
http://cvs.php.net/viewcvs.cgi/php-src/ext/java/

after giving up the build yesterday on windows, i am not giving up
today on linux.
i am still kinda lost - and its getting frustrating.

thanks,
vedanta

PHP - 5.1.4
ABI : Gentoo 2006.0




On 6/3/06, Vedanta Barooah [EMAIL PROTECTED] wrote:

if i am not wrong the bridge is better if you are trying to put in php
into a java app server. i do know to create the jar in linux i
will try some other combinations and keep things posted.
i am not able to find the jar, anywhere yet though :(
- vedanta

On 6/3/06, Jon Anderson [EMAIL PROTECTED] wrote:
 You could try something like PHP-Java bridge:
 http://php-java-bridge.sourceforge.net/

 I've set it up for our server farm at work, but never used it myself.
 The developer who requested it seems quite fond of the extension, and
 performance seems to be excellent.

 jon

 Vedanta Barooah wrote:
  really no one?
 
  On 6/2/06, Vedanta Barooah [EMAIL PROTECTED] wrote:
  hello all,
  i am setting up php_java.dll extension under windows/iis, my php
  version is 5.1.2. can any one point me to the download location of
  php_java.jar which is needed for the setup.
 
  i searched all the sites/mirrors but its not available. do i have to
  compile from source to get that jar? ... let me know,... thanks
 
  - regards, vedanta
 
 
 




--
*~:~*~:~*~:~*~:~*~:~*~:~*~:~*~:~*~:~*~:~*
Vedanta Barooah




--
*~:~*~:~*~:~*~:~*~:~*~:~*~:~*~:~*~:~*~:~*
Vedanta Barooah

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



Re: [PHP] HTTP HEADERS

2006-06-03 Thread David Tulloh
kartikay malhotra wrote:
 Hi all!
 
 I use HTTP POST to upload a file. I've a PHP script running on the server.
 Are HTTP headers passed with this request? How can I see the headers passed
 to the server?

Headers are passed by the client and server with every request.  The
Firefox Tamper Data extension shows the headers being sent and allows
you to modify them on the fly.


David

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



Re: [PHP] HTTP HEADERS

2006-06-03 Thread Joe Wollard

(sorry for the dup kartikay, forgot to hit reply to all;-)
So is the file going from server to server or from a client machine to the
server? It sounds like server to server - which if that's the case you can
use headers_list() to see what your server is going to be sending out to the
other server ( http://www.php.net/manual/en/function.headers-list.php) -
otherwise you can use the get_headers() function
(http://www.php.net/manual/en/function.get-headers.php)
see what headers the client sent you along with the file.

-Joe


On 6/3/06, kartikay malhotra [EMAIL PROTECTED] wrote:


Hi all!

I use HTTP POST to upload a file. I've a PHP script running on the server.
Are HTTP headers passed with this request? How can I see the headers
passed
to the server?

Thanks
KM




Re: [PHP] OO purism sucks - this is a rant for anyone who is allergic to that kind of thing...

2006-06-03 Thread Jochem Maas

Rasmus Lerdorf wrote:

Jochem Maas wrote:

I understand the point you made below - you have made this argument 
before

and I, for one, accepted it as valid when I first read the discussion
on internals - which is why I avoided ranting about that (and changes 
like it)



But you didn't avoid it, you used it as an example to back up your rant.


that wasn't me that was Robert in a reply to my rant.



And on the OO side your argument gets shaky as well.  The whole point of 
OO is to add a very structured layer on top of your code to make it more 
consistent and more maintainable than the equivalent procedural code. 
There is nothing you can do in OO that you can't do with completely 
freeform procedural code.  When you choose to go OO, you choose a set of 
rules and a certain code structure that by definition is going to be 
somewhat constrained.  The argument over exactly how constrained this 
should be and where we should loosen things up will continue until the 
end of time.  PPP and Interfaces are all about constraints.  They serve 
no practical purpose whatsoever other than to add constraints.


the point I *tried* to make (granted maybe not very well) was that the engine
constraints  behaviour themselves are not particularly consistent *and* they
change too often and in too arbitrary a fashion.

...

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



Re: [PHP] php java intregration

2006-06-03 Thread Rabin Vincent

On 6/2/06, Vedanta Barooah [EMAIL PROTECTED] wrote:

i am setting up php_java.dll extension under windows/iis, my php
version is 5.1.2. can any one point me to the download location of
php_java.jar which is needed for the setup.


Download Collection of PECL modules for PHP from the
Windows binaries section of php.net/downloads.php.

This is mentioned in php.net/java.

Rabin

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



[PHP] New release of phpEditIni Ver 1.0 Beta4 is now available

2006-06-03 Thread Jeremy O'Connor
New release of phpEditIni Ver 1.0 Beta4 is now available at 
http://phpeditini.net .. Now handles Windows and Linux/*nix line ends 
correctly.

Use phpEditIni to edit your PHP.INI files in a browser.

--
[EMAIL PROTECTED] 

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



Re: [PHP] Re: Retrieving Content

2006-06-03 Thread chris smith

On 6/3/06, Adam Zey [EMAIL PROTECTED] wrote:

Rodrigo de Oliveira Costa wrote:
 I just discovered the problem I have to retrieve the output of the
 site and not the url since its dynamic. Ca I do it like retrieve the
 output of this url:

 www.tryout.com/1/2/

 And of course store it on a variable? How to do it? I founr the func
 below but couldnt understand how to make it work with a url.

 Thanks guys,
 Rodrigo


 ob_start();
 include('file.php');  //  Could be a site here? What should I do to
 retrieve it from an url?
 $output = ob_get_contents();
 ob_end_clean();
Umm. As I said, just use file_get_contents():

$file = file_get_contents(http://www.tryout.com/1/2/;);


Assuming allow_url_fopen is on.

If not, you could try using curl - see http://www.php.net/curl

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

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



[PHP] ASCII Chars Only

2006-06-03 Thread Richard Collyer

Hello,

Trying to get the following working. I am trynig to select only ASCII 
characters (not extended ASCII) so that if the string contains 
characters outside the 32 - 126 range of good characters then $Discard 
is returned as  0.


But it is going overboard telling me that every character is bad :(

Ideas?

Cheers
Richard


$test = 飯島真�as;

function non_ascii($str) {  
$Discard = 0;

for ($i=0; $i  strlen($str); $i++)
{
$char = ord($test{$i});

if (($char  32 || $char  126)) {
$Discard++;
}
}   

return $Discard;
}

print non_ascii($test);

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



Re: [PHP] ASCII Chars Only

2006-06-03 Thread Rabin Vincent

On 6/3/06, Richard Collyer [EMAIL PROTECTED] wrote:

Hello,

Trying to get the following working. I am trynig to select only ASCII
characters (not extended ASCII) so that if the string contains
characters outside the 32 - 126 range of good characters then $Discard
is returned as  0.

But it is going overboard telling me that every character is bad :(

Ideas?

Cheers
Richard


$test = 飯島真理as;

function non_ascii($str) {
$Discard = 0;

for ($i=0; $i  strlen($str); $i++)
{
$char = ord($test{$i});


That should be $str, not $test.

Rabin


Re: [PHP] ASCII Chars Only

2006-06-03 Thread Richard Collyer

Rabin Vincent wrote:

On 6/3/06, Richard Collyer [EMAIL PROTECTED] wrote:

Hello,

Trying to get the following working. I am trynig to select only ASCII
characters (not extended ASCII) so that if the string contains
characters outside the 32 - 126 range of good characters then $Discard
is returned as  0.

But it is going overboard telling me that every character is bad :(

Ideas?

Cheers
Richard


$test = 飯島真理as;

function non_ascii($str) {
$Discard = 0;

for ($i=0; $i  strlen($str); $i++)
{
$char = ord($test{$i});


That should be $str, not $test.

Rabin


Doh!

I am indeed a spanner. Thanks.

Cheers
Richard

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



[PHP] .htaccess - change index.php to index.abc

2006-06-03 Thread Labunski
Hello,

What should I change in .htaccess, so that visitors will see index.abc 
instead of index.php.
I just wanna hide file's extension.

Thanks 

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



[PHP] Delete

2006-06-03 Thread George Babichev

Hello everyone! I wrote a blog application, but now for the admin panel, i
am trying to add a feature to delete blog posts. It would show the title of
the post next to it, and have a delete link which would delete it. How would
I do this? I mean if I have multiple blog entry's, how would I delete them
without using php my admin?


Re: [PHP] .htaccess - change index.php to index.abc

2006-06-03 Thread Joe Wollard

If you don't want to change the names of the files themselve from .php to
.abc then you'd need to use something like mod_rewrite for apache's HTTPD.
I'm not entirely certain as to how you'd do this, but I've included what I
normally use to hide index.php in the url. If possible I'd put this in
httpd.conf instead of .htaccess - there are performance concerns that may be
involved there. Anyway, I hope this gets you started or sparks an idea from
another list member.

Directory /var/www/html/
 RewriteEngine on
 RewriteBase /

 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule ^(.*)$ index.php/$1 [L,QSA]
/Directory



On 6/3/06, Labunski [EMAIL PROTECTED] wrote:


Hello,

What should I change in .htaccess, so that visitors will see index.abc
instead of index.php.
I just wanna hide file's extension.

Thanks

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




Re: [PHP] php java intregration

2006-06-03 Thread Vedanta Barooah

the pecl snapshots have the dll php_java.dll, but does not have the
jar php_java.jar which is also required?
- vedanta

On 6/3/06, Rabin Vincent [EMAIL PROTECTED] wrote:

On 6/2/06, Vedanta Barooah [EMAIL PROTECTED] wrote:
 i am setting up php_java.dll extension under windows/iis, my php
 version is 5.1.2. can any one point me to the download location of
 php_java.jar which is needed for the setup.

Download Collection of PECL modules for PHP from the
Windows binaries section of php.net/downloads.php.

This is mentioned in php.net/java.

Rabin




--
*~:~*~:~*~:~*~:~*~:~*~:~*~:~*~:~*~:~*~:~*
Vedanta Barooah

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



Re: [PHP] Delete

2006-06-03 Thread benifactor
when you insert each blog into your database, im assuming your not doing
this by hand each and every time, assign each blog an id.

in the place you want to delete the blog entries, list all of the blogs
titles and ids.
and then use mysql(delete);

example:
?
//create a variable for the delete blog entry of you control panel
if ($view == delete_blog) {
//this should be the value of your submit button
if ($deleteBlog) {
//this is the value of the blog entries to delete
if (!$idblog) {
//this is your error message, to be displayed if no blog was
chosen to delete
$de = font face=tahoma color=black size=1You Need To
Choose a post to delete/font;
 }
else {
//list the values of the array in which all the blog entries
you would like to delete are
$delBlog = implode(,, $idblog);
//do the actual deletion
mysql_query(delete From blogs where id
IN($delBlog)) or die(mysql_error());
//display the succesfull message if the blog
entries were deleted
echo(font face=tahoma color=black
size=1bcenterblog(s):/b $delBlog bhas/have been
deleted;/b/b/center);

//now we display the blog entries
//plus the sucsessfull message
?

form method=post
?php
$gn = mysql_query(Select * FROM blogs);
while ($d = mysql_fetch_array($gn)) {
?
INPUT TYPE=checkbox NAME=idBlog[] VALUE=? echo($d[id]); ??
echo(font face=tahoma color=black size=1bPost id:/b $d[id]b;/b
bPost Title:/b $d[title]b;/b bPosted by:/b
$d[poster]b;/bbr); ?
?php
 }
?
brbrinput type=submit name=deleteNerd value=Delete
class=button
/form
?php
}
}
else {
//display blog entries only
?
form method=post
?php
$gn = mysql_query(Select * FROM blogs);
while ($d = mysql_fetch_array($gn)) {
?
INPUT TYPE=checkbox NAME=idBlog[] VALUE=? echo($d[id]); ??
echo(font face=tahoma color=black size=1bPost id:/b $d[id]b;/b
bPost Title:/b $d[title]b;/b bPosted by:/b
$d[poster]b;/bbr); ?
?php
 }
?
brbrinput type=submit name=deleteNerd value=Delete class=button
/form
?php
}
?
this is a very rough example, however you should catch the drift, make your
id an array, implode that array and delete all the array data from the
database.

- Original Message - 
From: George Babichev [EMAIL PROTECTED]
To: PHP General list php-general@lists.php.net
Sent: Saturday, June 03, 2006 6:40 PM
Subject: [PHP] Delete


 Hello everyone! I wrote a blog application, but now for the admin panel, i
 am trying to add a feature to delete blog posts. It would show the title
of
 the post next to it, and have a delete link which would delete it. How
would
 I do this? I mean if I have multiple blog entry's, how would I delete them
 without using php my admin?


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



Re: [PHP] Delete

2006-06-03 Thread Rabin Vincent

On 6/4/06, George Babichev [EMAIL PROTECTED] wrote:

Hello everyone! I wrote a blog application, but now for the admin panel, i
am trying to add a feature to delete blog posts. It would show the title of
the post next to it, and have a delete link which would delete it. How would
I do this? I mean if I have multiple blog entry's, how would I delete them
without using php my admin?


Presumably, you have an id column in your blog posts table
which is the primary key. Then you can just delete posts by
doing something like:

mysql_query('DELETE FROM posts WHERE id = 2312');

Or if you want to delete multiple in one go

mysql_query('DELETE FROM posts WHERE id IN (23,34,12)');

Rabin

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



Re: [PHP] php java intregration

2006-06-03 Thread Rabin Vincent

On 6/4/06, Vedanta Barooah [EMAIL PROTECTED] wrote:

the pecl snapshots have the dll php_java.dll, but does not have the
jar php_java.jar which is also required?


I don't know about the snapshots, but the PECL zip on the
download page does have the jar you are looking for.

Rabin

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



Re: [PHP] Delete

2006-06-03 Thread George Babichev

Thank you for the help guys, but the I guess I kinda have another question.
So I do assign an id to each blog post, and it is auto_increment, so in my
blog delete page, it would display all the blog title's and a delete button
nex to it. So lets say I click delete on the third entry. How would my
program know to delete THAT entry and not another one?

On 6/3/06, benifactor [EMAIL PROTECTED] wrote:


when you insert each blog into your database, im assuming your not doing
this by hand each and every time, assign each blog an id.

in the place you want to delete the blog entries, list all of the blogs
titles and ids.
and then use mysql(delete);

example:
?
//create a variable for the delete blog entry of you control panel
if ($view == delete_blog) {
//this should be the value of your submit button
if ($deleteBlog) {
//this is the value of the blog entries to delete
if (!$idblog) {
//this is your error message, to be displayed if no blog
was
chosen to delete
$de = font face=tahoma color=black size=1You Need To
Choose a post to delete/font;
 }
else {
//list the values of the array in which all the blog
entries
you would like to delete are
$delBlog = implode(,, $idblog);
//do the actual deletion
mysql_query(delete From blogs where id
IN($delBlog)) or die(mysql_error());
//display the succesfull message if the blog
entries were deleted
echo(font face=tahoma color=black
size=1bcenterblog(s):/b $delBlog bhas/have been
deleted;/b/b/center);

//now we display the blog entries
//plus the sucsessfull message
?

form method=post
?php
$gn = mysql_query(Select * FROM blogs);
while ($d = mysql_fetch_array($gn)) {
?
INPUT TYPE=checkbox NAME=idBlog[] VALUE=? echo($d[id]); ??
echo(font face=tahoma color=black size=1bPost id:/b $d[id]b;/b
bPost Title:/b $d[title]b;/b bPosted by:/b
$d[poster]b;/bbr); ?
?php
}
?
brbrinput type=submit name=deleteNerd value=Delete
class=button
/form
?php
}
}
else {
//display blog entries only
?
form method=post
?php
$gn = mysql_query(Select * FROM blogs);
while ($d = mysql_fetch_array($gn)) {
?
INPUT TYPE=checkbox NAME=idBlog[] VALUE=? echo($d[id]); ??
echo(font face=tahoma color=black size=1bPost id:/b $d[id]b;/b
bPost Title:/b $d[title]b;/b bPosted by:/b
$d[poster]b;/bbr); ?
?php
}
?
brbrinput type=submit name=deleteNerd value=Delete
class=button
/form
?php
}
?
this is a very rough example, however you should catch the drift, make
your
id an array, implode that array and delete all the array data from the
database.

- Original Message -
From: George Babichev [EMAIL PROTECTED]
To: PHP General list php-general@lists.php.net
Sent: Saturday, June 03, 2006 6:40 PM
Subject: [PHP] Delete


 Hello everyone! I wrote a blog application, but now for the admin panel,
i
 am trying to add a feature to delete blog posts. It would show the title
of
 the post next to it, and have a delete link which would delete it. How
would
 I do this? I mean if I have multiple blog entry's, how would I delete
them
 without using php my admin?