Re: [PHP] select from db

2004-06-03 Thread Robert Sossomon

> table name 'Selections'
>
> (rows)  RoundGameName Winner   Points
>   data eg  1 1mark Hawthorn   4
> (if  team is a winner then 4 points added)
>
>1 2mark Geelong 0
>


Assuming you have them submit a form to get here:
";
print
"RoundGameNameWinnerPoints";

$total_points=0;
/* Iterate through to make it clean */
while ($i < $number)
{
 $item_1 = mysql_result($result, $i,"Round");
 $item_2 = mysql_result($result, $i,"Game");
 $item_3 = mysql_result($result, $i,"Name");
 $item_4 = mysql_result($result, $i,"Winner");
 $item_5 = mysql_result($result, $i,"Points");

/* This makes it print out in 2 separate color, depending on rows. */
 if ($i%2 == 0)
 {
  print "$item_1$item_2$item_3$item_4$item_5\n";
 }
 else
 {
 print "$item_1$item_2$item_3$item_4$item_5\n";
 }
/* Increase record count and total_points to date */
 $i++;
 $total_points += $item_5;
}
/* close everything up */
 print "Total Points Earned: $total_points";
 print "";
}

?>

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



Re: [PHP] Bulk table updates

2004-06-03 Thread Robert Sossomon
I use a separate page to do the addition of information to my DB
currently, the whole set of information is being re-written as I type
this, but where I am stuck is getting the whole thing to be parsed through
then just one line.

The code I currently use is as follows:




$get_Quote = "select st.id, st.sel_item_id, st.sel_item_desc,
st.sel_item_price, st.sel_item_qty, st.sel_item_comment from
store_shoppertrack as st left join items as si on si.id = st.sel_item_id
where session_id = '$PHPSESSID' order by $vsort";

$get_Quote_res = mysql_query($get_Quote) or die(mysql_error());

while ($row = MYSQL_FETCH_ROW($get_Quote_res))
$number = mysql_numrows($get_Quote_res);


if (mysql_num_rows($get_Quote_res) < 1)
 { //print message
  $display_block = "You have no items in your Quote. Please continue to shop!";
 }
else
 { //get info and build Quote display

 while ($i < $number)
  {
   $id = mysql_result($get_Quote_res,$i,'id');
   $item_title = mysql_result($get_Quote_res,$i,'sel_item_id');
   $item_desc = mysql_result($get_Quote_res,$i,'sel_item_desc');
   $item_price = mysql_result($get_Quote_res,$i,'sel_item_price');
   $item_qty = mysql_result($get_Quote_res,$i,'sel_item_qty');
   $item_comment = mysql_result($get_Quote_res,$i,'sel_item_comment');


   if ($item_title == " >")
   {
$display_block .= "Comment:\n\naquablackbluefuchsiagraygreenlimemaroonnavyolivepurpleredsilvertealwhiteyellow\nCurrently:
$item_comment\n";   }
   else
   {
$display_block .= "\n\n";
$display_block .= "$item_title\n";
$display_block .= "";
$display_block .= "\n\n\n";
$display_block .= "\n";
$display_block .= "\n\n\n";
$display_block .= "\n";

   }
   $i++;
   }





   $addtocart = "replace into store_shoppertrack
values('$_POST[id]','$_POST[SESSID]','$_POST[sel_item_id]','$_POST[sel_item_qty]','$_POST[sel_item_price]','$_POST[sel_item_desc]','$comment',
now(),'','','','')";

   mysql_query($addtocart);





I have a test set of data and stuff set up on my server:
http://lonewolf.homelinux.net/quoter

There are some errors in not getting to other tables, but they are
irrelevant for seeing what is there.  The data in the table is of course
bogus data, but you should see what I am getting at.

Thanks,
Robert


> Use a SELECT query to get the values (SELECT * FROM table) and a table
> that has form input fields in the cells.  The values for the form fields
> would be based on the array you get from the SELECT query.  The form could
> be something like .  In the
> script, before the body, you would have an if statement to check whether
> the submit button for the form is set; if it is set, it will run an INSERT
> INTO query:
>
> if (isset ($submit)) {
> $query = "INSERT INTO . . . ";
> $query_result = @mysql_query ($query);
> }
>
> If the form is submitted, then the values in all the form fields
> (including any changes) will go into the database.  If it's not submitted,
> the current values will be displayed in the tabled-embedded form.
> Actually, I think if the form is submitted, it will redisplay with the new
> values as defaults.
>
> Hopefully this will work, or lead you in the right direction.
>
>
>
> -Original Message-
> From: Robert Sossomon <[EMAIL PROTECTED]>
> Sent: Jun 3, 2004 6:23 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Bulk table updates
>
> I am looking for a tutorial or a already created class or file that I can
> use to learn how to create a form that is populated from a database table
> that can be edited in every row and column and takes only 1 SAVE button to
> upload all the changes.
>
> 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
>

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



[PHP] select from db

2004-06-03 Thread BigMark
Hi i have a football tipping database and i need to extract certain records
from a users 'selections' table
table name 'Selections'

(rows)  RoundGameName Winner   Points
  data eg  1 1mark Hawthorn   4
(if  team is a winner then 4 points added)

   1 2mark Geelong 0


What i want to do is show all the above rows of a particular user and round,
ie:  all of user 'mark' round 1 details which includes games 1-8, the team
names he picked, and the points for a win.

p.s. is there a way of totaling the points as well

mark

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



Re: [PHP] Current URL

2004-06-03 Thread Robert Cummings
On Fri, 2004-06-04 at 01:38, Aidan Lister wrote:
> Hi,
> 
> You could use $_SERVER['DOCUMENT_ROOT']
> 

That doesn't work... as the OP mentioned, the URLs might need to refer
locally within a subsite built as a subdirectory within the document
root.

Cheers,
Rob.


> 
> "Robert Cummings" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > On Thu, 2004-06-03 at 23:15, Stephen Craton wrote:
> > > I've wondered for quite some time, and search just as long it seems
> like,
> > > for a way to get the current URL directory. For example, let's say you
> were
> > > at www.example.com/files. The script is executing in this directory, and
> > > it's calling an include script from the base (www.example.com or maybe
> even
> > > www.example.com/includes). In this included file are some links and
> maybe
> > > some images. These images and links are set up to be called from the
> base
> > > directory, so basically all the links inside the file say something like
> > > "images/bob.gif" or something of that nature.
> > >
> > > How could you dynamicaly change this in relation to where the included
> > > script is? If I were to include it in that files in /files, it would
> look
> > > for the images in /files/images/bob.gif which would not be there. One
> > > solution I have thought of is just putting the / at the beginning
> (/images/)
> > > but that wouldn't be the safest solution if the script were running in a
> > > subfolder to begind with (like the entire site is in
> www.example.com/site1).
> > >
> > > I hope you understand what I'm trying to say. Any ideas?
> >
> > In a configuration file shared by the project's scripts have a constant
> > or global variable like follows:
> >
> > $GLOBALS['imageBase'] = '/site1/';
> >
> > Now wherever in your site you use an image you can use this value to
> > prepend the image path.
> >
> > Cheers,
> > Blobbie.
> > -- 
> > ..
> > | InterJinn Application Framework - http://www.interjinn.com |
> > ::
> > | An application and templating framework for PHP. Boasting  |
> > | a powerful, scalable system for accessing system services  |
> > | such as forms, properties, sessions, and caches. InterJinn |
> > | also provides an extremely flexible architecture for   |
> > | creating re-usable components quickly and easily.  |
> > `'
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] Current URL

2004-06-03 Thread Aidan Lister
Hi,

You could use $_SERVER['DOCUMENT_ROOT']


"Robert Cummings" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Thu, 2004-06-03 at 23:15, Stephen Craton wrote:
> > I've wondered for quite some time, and search just as long it seems
like,
> > for a way to get the current URL directory. For example, let's say you
were
> > at www.example.com/files. The script is executing in this directory, and
> > it's calling an include script from the base (www.example.com or maybe
even
> > www.example.com/includes). In this included file are some links and
maybe
> > some images. These images and links are set up to be called from the
base
> > directory, so basically all the links inside the file say something like
> > "images/bob.gif" or something of that nature.
> >
> > How could you dynamicaly change this in relation to where the included
> > script is? If I were to include it in that files in /files, it would
look
> > for the images in /files/images/bob.gif which would not be there. One
> > solution I have thought of is just putting the / at the beginning
(/images/)
> > but that wouldn't be the safest solution if the script were running in a
> > subfolder to begind with (like the entire site is in
www.example.com/site1).
> >
> > I hope you understand what I'm trying to say. Any ideas?
>
> In a configuration file shared by the project's scripts have a constant
> or global variable like follows:
>
> $GLOBALS['imageBase'] = '/site1/';
>
> Now wherever in your site you use an image you can use this value to
> prepend the image path.
>
> Cheers,
> Blobbie.
> -- 
> ..
> | InterJinn Application Framework - http://www.interjinn.com |
> ::
> | An application and templating framework for PHP. Boasting  |
> | a powerful, scalable system for accessing system services  |
> | such as forms, properties, sessions, and caches. InterJinn |
> | also provides an extremely flexible architecture for   |
> | creating re-usable components quickly and easily.  |
> `'

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



Re: [PHP] Problem with PHP + WML + Post method

2004-06-03 Thread Shelby
Hi,
the href property is going back to index.php. It is going back to itself.



"Tyler Replogle" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> hey,
> don't you need a page thats after that and will check the info, if you
have
> it will help use see what your problem with the $_POST[] is.
>
>
>
>
> >From: "Shelby" <[EMAIL PROTECTED]>
> >To: [EMAIL PROTECTED]
> >Subject: [PHP]  Problem with PHP + WML + Post method
> >Date: Fri, 4 Jun 2004 11:46:10 +0800
> >
> >Hi,
> >I'm having problem with the "Post" method in my PHP + WML file.
> >Note that I have No problem with the "Get" method.
> >
> >When I click "Login",
> >The Error:
> >Malformed server response
> >
> >
> >I'm using Win2k + PHP436 for testing.
> >And I have set the MIME type in the IIS:
> >.wml
> >application/x-httpd-php
> >
> >
> >=
> >index.php
> >=
> > >header("Content-type: text/vnd.wap.wml");
> >echo "";
> >echo " >. " \"http://www.wapforum.org/DTD/wml_1.1.xml\";>";
> >?>
> >
> >
> >
> >User ID: 
> >Password: 
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >Is there anything I miss out?
> >By the way, when I test with Win2003 server + PHP436, there is no
problem.
> >Does the problem lie with the Win2k server?
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
> _
> Stop worrying about overloading your inbox - get MSN Hotmail Extra
Storage!
> http://join.msn.click-url.com/go/onm00200362ave/direct/01/

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



RE: [PHP] Problem with PHP + WML + Post method

2004-06-03 Thread Tyler Replogle
hey,
don't you need a page thats after that and will check the info, if you have 
it will help use see what your problem with the $_POST[] is.



From: "Shelby" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: [PHP]  Problem with PHP + WML + Post method
Date: Fri, 4 Jun 2004 11:46:10 +0800
Hi,
I'm having problem with the "Post" method in my PHP + WML file.
Note that I have No problem with the "Get" method.
When I click "Login",
The Error:
Malformed server response
I'm using Win2k + PHP436 for testing.
And I have set the MIME type in the IIS:
.wml
application/x-httpd-php
=
index.php
=
";
echo "http://www.wapforum.org/DTD/wml_1.1.xml\";>";
?>



User ID: 
Password: 









Is there anything I miss out?
By the way, when I test with Win2003 server + PHP436, there is no problem.
Does the problem lie with the Win2k server?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
_
Stop worrying about overloading your inbox - get MSN Hotmail Extra Storage! 
http://join.msn.click-url.com/go/onm00200362ave/direct/01/

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


[PHP] Problem with PHP + WML + Post method

2004-06-03 Thread Shelby
Hi,
I'm having problem with the "Post" method in my PHP + WML file.
Note that I have No problem with the "Get" method.

When I click "Login",
The Error:
Malformed server response


I'm using Win2k + PHP436 for testing.
And I have set the MIME type in the IIS:
.wml
application/x-httpd-php


=
index.php
=
";
echo "http://www.wapforum.org/DTD/wml_1.1.xml\";>";
?>



User ID: 
Password: 












Is there anything I miss out?
By the way, when I test with Win2003 server + PHP436, there is no problem.
Does the problem lie with the Win2k server?

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



Re: [PHP] Current URL

2004-06-03 Thread Robert Cummings
On Thu, 2004-06-03 at 23:15, Stephen Craton wrote:
> I've wondered for quite some time, and search just as long it seems like,
> for a way to get the current URL directory. For example, let's say you were
> at www.example.com/files. The script is executing in this directory, and
> it's calling an include script from the base (www.example.com or maybe even
> www.example.com/includes). In this included file are some links and maybe
> some images. These images and links are set up to be called from the base
> directory, so basically all the links inside the file say something like
> "images/bob.gif" or something of that nature.
>  
> How could you dynamicaly change this in relation to where the included
> script is? If I were to include it in that files in /files, it would look
> for the images in /files/images/bob.gif which would not be there. One
> solution I have thought of is just putting the / at the beginning (/images/)
> but that wouldn't be the safest solution if the script were running in a
> subfolder to begind with (like the entire site is in www.example.com/site1).
>  
> I hope you understand what I'm trying to say. Any ideas?

In a configuration file shared by the project's scripts have a constant
or global variable like follows:

$GLOBALS['imageBase'] = '/site1/';

Now wherever in your site you use an image you can use this value to
prepend the image path.

Cheers,
Blobbie.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



[PHP] Current URL

2004-06-03 Thread Stephen Craton
I've wondered for quite some time, and search just as long it seems like,
for a way to get the current URL directory. For example, let's say you were
at www.example.com/files. The script is executing in this directory, and
it's calling an include script from the base (www.example.com or maybe even
www.example.com/includes). In this included file are some links and maybe
some images. These images and links are set up to be called from the base
directory, so basically all the links inside the file say something like
"images/bob.gif" or something of that nature.
 
How could you dynamicaly change this in relation to where the included
script is? If I were to include it in that files in /files, it would look
for the images in /files/images/bob.gif which would not be there. One
solution I have thought of is just putting the / at the beginning (/images/)
but that wouldn't be the safest solution if the script were running in a
subfolder to begind with (like the entire site is in www.example.com/site1).
 
I hope you understand what I'm trying to say. Any ideas?
 
Thanks,
Stephen Craton
http://www.melchior.us  
 

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



Re: [PHP] Bulk table updates

2004-06-03 Thread John W. Holmes
Robert Sossomon wrote:
I am looking for a tutorial or a already created class or file that I can
use to learn how to create a form that is populated from a database table
that can be edited in every row and column and takes only 1 SAVE button to
upload all the changes.
Look on phpclasses.org or in PEAR; I know there are classes that do 
this. If all else fails, install PHPMyAdmin, which allows you do this.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals – www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Bulk table updates

2004-06-03 Thread deseavers
Use a SELECT query to get the values (SELECT * FROM table) and a table that has form 
input fields in the cells.  The values for the form fields would be based on the array 
you get from the SELECT query.  The form could be something like .  In the script, before the body, you would 
have an if statement to check whether the submit button for the form is set; if it is 
set, it will run an INSERT INTO query:

if (isset ($submit)) {
$query = "INSERT INTO . . . ";
$query_result = @mysql_query ($query);
}

If the form is submitted, then the values in all the form fields (including any 
changes) will go into the database.  If it's not submitted, the current values will be 
displayed in the tabled-embedded form.  Actually, I think if the form is submitted, it 
will redisplay with the new values as defaults.

Hopefully this will work, or lead you in the right direction.



-Original Message-
From: Robert Sossomon <[EMAIL PROTECTED]>
Sent: Jun 3, 2004 6:23 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Bulk table updates

I am looking for a tutorial or a already created class or file that I can
use to learn how to create a form that is populated from a database table
that can be edited in every row and column and takes only 1 SAVE button to
upload all the changes.

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



[PHP] Bulk table updates

2004-06-03 Thread Robert Sossomon
I am looking for a tutorial or a already created class or file that I can
use to learn how to create a form that is populated from a database table
that can be edited in every row and column and takes only 1 SAVE button to
upload all the changes.

Thanks,
Robert

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



Re: [PHP] Asuming query without the ?

2004-06-03 Thread Marek Kilimajer
Robert Winter wrote:
Where and how do I set this? I'm to Unix and PHP.
in .htaccess file
RewriteRule ^/path/([0-9]+)$/path/index.php?code=$1

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


RE: [PHP] Asuming query without the ?

2004-06-03 Thread Chris W. Parker
Robert Winter 
on Thursday, June 03, 2004 4:31 PM said:

> Where and how do I set this? I'm to Unix and PHP.

just look up mod_rewrite and you'll get some answers.

http://www.engelschall.com/pw/apache/rewriteguide/



chris.

p.s. please don't respond to two different messages with exactly the
same one-word-missing response. it's very annoying. at least for me...
and maybe some others... i can think of one person. but i wont name
names.



NED: Elaine, when my father was black listed he couldn't work for years.
He and his friends used to sit at Hop Sing's every day figuring out how
to survive.

ELAINE: You're father was blacklisted? 

NED: Yes he was, and you know why? Because he was betrayed by people he
trusted. They "named names".

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



[PHP] help needed with tiger tree hashes

2004-06-03 Thread Carl S. in 't Veld
I am trying to generate tiger tree hashes the same way as directconnect
does, but I am failing.

I checked the output from php with the reference vectors from
http://www.cs.technion.ac.il/~biham...ssie-format.dat
and they appear to be different!

echo bin2hex(mhash(MHASH_TIGER, 'abc'))."\n";
outputs
f258c1e88414ab2a527ab541ffc5b8bf935f7b951c132951
instead of
2AAB1484E8C158F2BFB8C5FF41B57A525129131C957B5F93

and, for example,
echo bin2hex(mhash(MHASH_TIGER, 'message digest'))."\n";
outputs
951a2078cbf881d91c441e754830cf0df6295aa51aca7f51
instead of
D981F8CB78201A950DCF3048751E441C517FCA1AA55A29F6

What am I doing wrong here?


begin 666 frown.gif
M1TE&.#EA#P`/`-4_`/_XH-++?L[(?-7/@-_8AO_WF__[SO_XI__YL=W6A/_\
MW/_ZO?_WG?_XJ_KREO_[TO_YL/_\U?WUF.[GC__XHO_[Q\K#>?_[RO'JD<.]
M=KCC/_\V/_YK__YMOGQE?_[QO_ZO__XH__YM.CAB^':A]3-
[EMAIL PROTECTED]/LU-D4+"R5%``P%11L)`T4(""T-% 4=$B`P(:
.RLIJ7K_044E*L$E!`#L`
`
end

begin 666 confused.gif
M1TE&.#EA#P`6`-4_`,.]=?GQE?#HD/_XH=++?O_WF_'JD>;?BL[(?.KCC,?!
M=__XJ__[Q__[RO_\W-7.@/_YL?_YL-W6A/_[TOKREO_WG=_8AO_\U?WUF/_\
MV?_YM?_XHO_[SO_ZO?_ZN__XI^[GC__XI?3MD_;ND__ZP/_[QLK#>>GBC/[V
MF/_\V/_[RO_ZO/_YM/_XJO_XH__YK][7A?_\T__\U^':A__ZPO_ZO__W
MF?_\W?_XJ/STE_;NE/_\V\&[= ```*2DI"'Y! $``#\`+ `/`!8```:E
MP-_/)Q02B\>A4GDD)I?&(O1)E5JOTBH2R\7ZOE_NUY&:-$CAK /'[EMAIL PROTECTED]
MZ9ME,FZ&K96K4)H3,E\U'AI?% 9.# TJ7Q$NXVE7TN5!`#L`
`
end

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



Re: [PHP] Asuming query without the ?

2004-06-03 Thread Daniel Clark
I think it's in the Apache config file.

> Where and how do I set this? I'm to Unix and PHP.
>
> "Marek Kilimajer" <[EMAIL PROTECTED]> escribió en el mensaje
> news:[EMAIL PROTECTED]
>> Robert Winter wrote:
>> > Is it possible to configure PHP/.htAccess/etc. for assuming a query
>> when
> the
>> > users enters a path like this:
>> >
>> > www.myserver.com/path/154--> assumes
>> > www.myserver.com/path/index.php?code=154
>> >
>> > The only thing I could do is avoid writing index.php but I still have
>> to
>> > write the ?: www.myserver.com/path/?154
>> >
>> > Any idea?
>> > Thanks.
>> > Gus
>> >
>>
>> RewriteRule ^/path/([0-9]+)$/path/index.php?code=$1

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



Re: [PHP] Asuming query without the ?

2004-06-03 Thread Robert Winter
Where and how do I set this? I'm to Unix and PHP.

"John Nichel" <[EMAIL PROTECTED]> escribió en el mensaje
news:[EMAIL PROTECTED]
> Robert Winter wrote:
> > Is it possible to configure PHP/.htAccess/etc. for assuming a query when
the
> > users enters a path like this:
> >
> > www.myserver.com/path/154--> assumes
> > www.myserver.com/path/index.php?code=154
> >
> > The only thing I could do is avoid writing index.php but I still have to
> > write the ?: www.myserver.com/path/?154
> >
> > Any idea?
> > Thanks.
> > Gus
> >
>
> mod_rewrite
>
> -- 
> John C. Nichel
> KegWorks.com
> 716.856.9675
> [EMAIL PROTECTED]

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



Re: [PHP] Asuming query without the ?

2004-06-03 Thread Robert Winter
Where and how do I set this? I'm to Unix and PHP.

"Marek Kilimajer" <[EMAIL PROTECTED]> escribió en el mensaje
news:[EMAIL PROTECTED]
> Robert Winter wrote:
> > Is it possible to configure PHP/.htAccess/etc. for assuming a query when
the
> > users enters a path like this:
> >
> > www.myserver.com/path/154--> assumes
> > www.myserver.com/path/index.php?code=154
> >
> > The only thing I could do is avoid writing index.php but I still have to
> > write the ?: www.myserver.com/path/?154
> >
> > Any idea?
> > Thanks.
> > Gus
> >
>
> RewriteRule ^/path/([0-9]+)$/path/index.php?code=$1

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



[PHP] Cron Job in vDeck

2004-06-03 Thread Matt Palermo
Hey guys.  I was wondering if anyone knows how to go about creating a cron
job using vDeck (that's what is installed on the server) that just accesses
a PHP file and runs everything in the PHP file.  Does anyone know how to go
about doing something like this?

Thanks,

Matt
http://sweetphp.com

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



[PHP] PHP Debugger 4 Linux?

2004-06-03 Thread Nick Wilson
Hi everyone, 

Can anyone recommend a good debugger for *nix?

Many thx!
-- 
Nick W

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



[PHP] image resize looks horrible..

2004-06-03 Thread Edward Peloke
I am using the below function which does seem to resize the image yet the
colors in the resized image look horrible. How can I resize the image yet
keep the colors in tact?

Thanks,
Eddie

Justin-I tried your code but it didn't seem to do anything...I will just use
this function if the color will work.



function createthumb($name,$filename,$new_w,$new_h){
global $gd2;
$system=explode(".",$name);
$src_img=imagecreatefromjpeg($name);
$old_x=imageSX($src_img);
$old_y=imageSY($src_img);
if ($old_x > $old_y) {
$thumb_w=$new_w;
$thumb_h=$old_y*($new_h/$old_x);
}
if ($old_x < $old_y) {
$thumb_w=$old_x*($new_w/$old_y);
$thumb_h=$new_h;
}
if ($old_x == $old_y) {
$thumb_w=$new_w;
$thumb_h=$new_h;
}
if ($gd2==""){
$dst_img=ImageCreate($thumb_w,$thumb_h);

imagecopyresized($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y);
}else{
$dst_img=ImageCreateTrueColor($thumb_w,$thumb_h);

imagecopyresampled($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y
);
}
if (preg_match("/png/",$system[1])){
imagepng($dst_img,$filename);
} else {
imagejpeg($dst_img,$filename);
}
imagedestroy($dst_img);
imagedestroy($src_img);
}


 WARNING:  The information contained in this message and any attachments is
intended only for the use of the individual or entity to which it is
addressed.  This message may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  It may also
contain trade secrets and other proprietary information for which you and
your employer may be held liable for disclosing.  You are hereby notified
that any unauthorized dissemination, distribution or copying of this
communication is strictly prohibited.  If you have received this
communication in error,  please notify [EMAIL PROTECTED] by E-Mail and then
destroy this communication in a manner appropriate for privileged
information.

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



Re: [PHP] php as user apache

2004-06-03 Thread John W. Holmes
From: "Travis Low" <[EMAIL PROTECTED]>
> John W. Holmes wrote:
> > From: "Nirnimesh" <[EMAIL PROTECTED]>
> >
> >>I have a problem regarding using my php scripts to write files to my
> >>account.
> >>We know that php runs as user apache. Now giving write permissions to
> >>apache for uploading files to my account essentially means that I have
to
> >>give write permissions for apache (i.e. o+w). Now, does that not mean
that
> >>any user which is can run php scripts can have access to my account?
> >
> > Yes (well, has access to that directory).
> >
> >>Is there any configuration setting that I'm missing.
> >
> > Safe mode, open_basedir, etc.
>
> Is there a way to cause PHP scripts to run as the user and group
associated
> with the apache virtual host?

If you use PHP as a CGI, you can do this. I believe I've also heard that
Apache2 has ways of doing this also (with PHP as a module), but I don't know
the details.

---John Holmes...


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



Re: [PHP] php as user apache

2004-06-03 Thread Travis Low
John W. Holmes wrote:
From: "Nirnimesh" <[EMAIL PROTECTED]>
I have a problem regarding using my php scripts to write files to my
account.
We know that php runs as user apache. Now giving write permissions to
apache for uploading files to my account essentially means that I have to
give write permissions for apache (i.e. o+w). Now, does that not mean that
any user which is can run php scripts can have access to my account?
Yes (well, has access to that directory).
Is there any configuration setting that I'm missing.
Safe mode, open_basedir, etc.
Is there a way to cause PHP scripts to run as the user and group associated 
with the apache virtual host?

cheers,
Travis
--
Travis Low


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


Re: [PHP] php as user apache

2004-06-03 Thread John W. Holmes
From: "Nirnimesh" <[EMAIL PROTECTED]>

> I have a problem regarding using my php scripts to write files to my
> account.
> We know that php runs as user apache. Now giving write permissions to
> apache for uploading files to my account essentially means that I have to
> give write permissions for apache (i.e. o+w). Now, does that not mean that
> any user which is can run php scripts can have access to my account?

Yes (well, has access to that directory).

> Is there any configuration setting that I'm missing.

Safe mode, open_basedir, etc.

---John Holmes...

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



[PHP] php as user apache

2004-06-03 Thread Nirnimesh

I have a problem regarding using my php scripts to write files to my
account.
We know that php runs as user apache. Now giving write permissions to
apache for uploading files to my account essentially means that I have to
give write permissions for apache (i.e. o+w). Now, does that not mean that
any user which is can run php scripts can have access to my account?

Is there any configuration setting that I'm missing.


Nirnimesh.
IIIT-Hyd.
India.

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



Re: [PHP] CAUTION FRAUD: IMPORTANT MASSAGE FROM THE BANK

2004-06-03 Thread Jordi Canals
Some time ago, I was working for a governement departament, and I asked 
about this kind of messages. The answer was clear and explicit:

This kind of message are a FRAUD (I don't now how they do the fraud) and 
are investigated and are INVESTIGATED and PERSECUTED by the Spanish 
Police in collaboration with INTERPOL.

So, the advice of the police here is to NOT believe any line of it and 
redirect the message to the nearest police department in your country.

Davies Harries wrote:
FROM:Mr DAVIES HARRIES
bills and exchange director
GUARANTY TRUST BANK PLC
Email:[EMAIL PROTECTED]
Fax No:14134519233
[Rest of message deleted]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] imploding a multi-dimensional array

2004-06-03 Thread John W. Holmes
From: "Tom Wuyts" <[EMAIL PROTECTED]>

> I want to implode a multi-dimensional array into 1 string.

Any reason you need to implode() instead of serialize() the array?

---John Holmes...

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



Re: [PHP] Re: Call JS Function with PHP Header()?

2004-06-03 Thread Nick Wilson

* and then Dennis Seavers declared
> You should be able to use the comment tags, just put them inside the
>  tags:
> 
> echo "