[PHP] failed to open stream: Resource temporarily unavailable

2007-03-04 Thread Tijnema !

Hi,

I have just finished installing Apache with PHP, and now i'm trying to open
a file and gives me this error:
failed to open stream: Resource temporarily unavailable

What can i do? i searched the error_log, but it doesn't show anything about
this i believe, but the log is very big because of a lot of errors of
apache.

TIA

Tijnema


Re: [PHP] Array help

2007-03-04 Thread Tijnema !

Well, you are using the file_get_contents function right now, what about a
loop that reads the file line by line, checks if the user matches, and stops
when found the right user?

it's an all in one loop :)

just like this:
$found = false;
$fp = fopen($file,"r");
while(!feof($fp) && $found == false)
{
$line = fread($fp,256);
if($line == $user.":".$pass)
{
$found = true;
}
}

It is possible to get it even smaller, but i'm not a genius in writing fast
code :P

Tijnema

On 3/4/07, Ryan A <[EMAIL PROTECTED]> wrote:


Hey Stut,
Thanks for replying.

Will be making two versions, one with a DB and one to work with the file
for the old school folks who dont want to convert their file and use "new
fangled" databases... some people its easier to just not argue or try to
convince...
and however stupid someone's opinion is, they are still entitled to
it...esp when you are thinking of (maybe) selling a future product it does
not make much sense telling them they are stupid :-))

"If you *need* to stick to using the file, are you looking for a
particular username or just want to load the whole list?"

I'm looking to match a login (user:pass)... so I would need to load the
whole list right? or do you have an alternative idea? am totally open to
suggestions and alternatives at this point... just looking for the easiest
way in terms of server load and processing..which is why I am trying to
avoid a for() or while() loop.

Thanks!
Ryan

Stut <[EMAIL PROTECTED]> wrote: Ryan A wrote:
> I have a login/password file with these kind of  values:
> user1:pass1
> user2:pass2
> cat:dog
> love:hate
>
> I have  opened the file and put it into an array with this code:
> (thanks to richard lynch from this list for idea and code snippets)
>
> $file =  file_get_contents('a.htpasswd');
> preg_match_all('/(.*):(.*)$/msU', $file,  $htpassd);
>
> but how do I get it into this format  :
>
> $users['username'] = 'password'
>
> without using a loop? I was  thinking something like array_flip or
array_splice??
> (The reason I dont want to use a loop (for,while) is there can be
thousands of user:pass combos in the files and thousands of logins and
attempted logins a day)

My advice would be to swap to using a database. With that number of
users it's going to give you a huge boost in performance. SQLite would do.

If you *need* to stick to using the file, are you looking for a
particular username or just want to load the whole list?

-Stut



--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)

-
Now that's room service! Choose from over 150,000 hotels
in 45,000 destinations on Yahoo! Travel to find your fit.


Re: [PHP] TabPage like in Java or Windows

2007-03-04 Thread Tijnema !

I can't find your screenshot

but anyway, i think this is again client side, and so you can't do anything
with PHP as PHP is server side code.

Tijnema


On 3/4/07, Alain Roger <[EMAIL PROTECTED]> wrote:


Hi,

I would like to know if it exist a class with allow to have a windowed
form tabbed like under Firefox (each web page is included into a tabbed page
control)

I attached a screenshot to this post in order to illustrate what i'm
looking for.

thanks a lot for your comment.

--
Alain

Windows XP SP2
PostgreSQL 8.1.4
Apache 2.0.58
PHP 5
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] module and access rights

2007-03-04 Thread Tijnema !

On 3/4/07, Stut <[EMAIL PROTECTED]> wrote:


Alain Roger wrote:
> I would like to implement a module access rights in my web application.
> Basically after authentication and authorization. Logged user has a
> particular profile which allow him to have access to some part of the
web
> application.
>
> after reading the security guide from *php*sec.org webpage, i'm confused
> regarding how to store user login and password.
> I mean the encrypted password stored in database is compared to
encrypted
> password that user type.
>
> But where to store login and password once user is logged ?
>
> when i read the security guide it seems that it is not secured enough to
> store them in cookies or in sessions data...
> both can be hacked... So what is the best solution ?
>
> i will use those stored data to check if logged user can have access to
a
> particular part of the web application.
>
> What is your point of view in such domain ?

Ok, once the user has logged in there is no need to store the password.
Simply store the username or other user details (but not the password)
in the session - that's as secure as it's gonna get.

*Never* store a password in a cookie. *Ever*.

-Stut



That's right, never store a password in a cookie or session, maybe a little
extra security could be added by locking the cookie to a IP address, but
even more secure isn't possible.

Tijnema

--

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




Re: [PHP] module and access rights

2007-03-04 Thread Tijnema !

Give your server a unique ID, and add that to your check string lets say
so you store in your cookie the username and the check string.

example
$user = "tijnema";
$server_unique_key = "w#$#%#54dfa4vf4w5$2!@@$
";
$check_string = md5($server_unique_key.$user.$server_unqie_key);

and check that each time the user does an action.

Tijnema

-
Now to the PHP list


On 3/4/07, Alain Roger <[EMAIL PROTECTED]> wrote:


Ok, but i would be very glad to know how can i REALLY authenticate the
user.
for example, user is logged, so i have in the cookie his login name.

how can i be sure that it's the same user and not some hacker who hacked
the cookie and the session ?
what should be checked and where those data should be stored ?

because i can store in DB the sessionID, and check it to every DB request
user does...but a sessionID can be easily fake.

So what should I do ?

Al.

On 3/4/07, Tijnema ! <[EMAIL PROTECTED]> wrote:
>
> On 3/4/07, Stut <[EMAIL PROTECTED]> wrote:
> >
> > Alain Roger wrote:
> > > I would like to implement a module access rights in my web
> application.
> > > Basically after authentication and authorization. Logged user has a
> > > particular profile which allow him to have access to some part of
> the
> > web
> > > application.
> > >
> > > after reading the security guide from *php*sec.org webpage, i'm
> confused
> > > regarding how to store user login and password.
> > > I mean the encrypted password stored in database is compared to
> > encrypted
> > > password that user type.
> > >
> > > But where to store login and password once user is logged ?
> > >
> > > when i read the security guide it seems that it is not secured
> enough to
> > > store them in cookies or in sessions data...
> > > both can be hacked... So what is the best solution ?
> > >
> > > i will use those stored data to check if logged user can have access
> to
> > a
> > > particular part of the web application.
> > >
> > > What is your point of view in such domain ?
> >
> > Ok, once the user has logged in there is no need to store the
> password.
> > Simply store the username or other user details (but not the password)
>
> > in the session - that's as secure as it's gonna get.
> >
> > *Never* store a password in a cookie. *Ever*.
> >
> > -Stut
>
>
> That's right, never store a password in a cookie or session, maybe a
> little
> extra security could be added by locking the cookie to a IP address, but
> even more secure isn't possible.
>
> Tijnema
>
> --
> > PHP General Mailing List (http://www.php.net/ )
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>



--
Alain

Windows XP SP2
PostgreSQL 8.1.4
Apache 2.0.58
PHP 5



Re: [PHP] module and access rights

2007-03-04 Thread Tijnema !

On 3/4/07, Stut <[EMAIL PROTECTED]> wrote:


Tijnema ! wrote:
> Give your server a unique ID, and add that to your check string lets say
> so you store in your cookie the username and the check string.
>
> example
> $user = "tijnema";
> $server_unique_key =
> "w#$#%#54dfa4vf4w5$2!@@$
> ";
> $check_string = md5($server_unique_key.$user.$server_unqie_key);
>
> and check that each time the user does an action.

How, exactly, is that any more secure than a standard session identifier?

While it's good to worry about security, adding pointless activity such
as this to every request is not going to help. Anything you do is going
to involve some piece of data being transferred from client to server,
and can therefore be faked/shared by the client. Get over it.

-Stut



It is ofcourse possible to share it to another client, but when combining
this with the IP address. This means it can only be used in the same LAN.
To get to the point, using this means you cannot simply fake the username in
the cookie, which is possible else. session identifiers can be faked too.

Tijnema


On 3/4/07, Alain Roger <[EMAIL PROTECTED]> wrote:
>>
>> Ok, but i would be very glad to know how can i REALLY authenticate the
>> user.
>> for example, user is logged, so i have in the cookie his login name.
>>
>> how can i be sure that it's the same user and not some hacker who
hacked
>> the cookie and the session ?
>> what should be checked and where those data should be stored ?
>>
>> because i can store in DB the sessionID, and check it to every DB
request
>> user does...but a sessionID can be easily fake.
>>
>> So what should I do ?
>>
>> Al.
>>
>> On 3/4/07, Tijnema ! <[EMAIL PROTECTED]> wrote:
>> >
>> > On 3/4/07, Stut <[EMAIL PROTECTED]> wrote:
>> > >
>> > > Alain Roger wrote:
>> > > > I would like to implement a module access rights in my web
>> > application.
>> > > > Basically after authentication and authorization. Logged user has
a
>> > > > particular profile which allow him to have access to some part of
>> > the
>> > > web
>> > > > application.
>> > > >
>> > > > after reading the security guide from *php*sec.org webpage, i'm
>> > confused
>> > > > regarding how to store user login and password.
>> > > > I mean the encrypted password stored in database is compared to
>> > > encrypted
>> > > > password that user type.
>> > > >
>> > > > But where to store login and password once user is logged ?
>> > > >
>> > > > when i read the security guide it seems that it is not secured
>> > enough to
>> > > > store them in cookies or in sessions data...
>> > > > both can be hacked... So what is the best solution ?
>> > > >
>> > > > i will use those stored data to check if logged user can have
>> access
>> > to
>> > > a
>> > > > particular part of the web application.
>> > > >
>> > > > What is your point of view in such domain ?
>> > >
>> > > Ok, once the user has logged in there is no need to store the
>> > password.
>> > > Simply store the username or other user details (but not the
>> password)
>> >
>> > > in the session - that's as secure as it's gonna get.
>> > >
>> > > *Never* store a password in a cookie. *Ever*.
>> > >
>> > > -Stut
>> >
>> >
>> > That's right, never store a password in a cookie or session, maybe a
>> > little
>> > extra security could be added by locking the cookie to a IP address,
>> but
>> > even more secure isn't possible.
>> >
>> > Tijnema
>> >
>> > --
>> > > PHP General Mailing List (http://www.php.net/ )
>> > > To unsubscribe, visit: http://www.php.net/unsub.php
>> > >
>> > >
>> >
>>
>>
>>
>> --
>> Alain
>> 
>> Windows XP SP2
>> PostgreSQL 8.1.4
>> Apache 2.0.58
>> PHP 5
>>
>




Re: [PHP] PHP Site Hacking Tools Revealed

2007-03-04 Thread Tijnema !

Hi,

I'm not able to open any of these files, because my NAV detects them as PHP
Backdoor Trojans. So they look nice, but they are detected by my AV (and
probably other AV programs too)
I'm not going to test these scripts, but i think it does show how many harm
a PHP script can do.
Do these scripts work on Linux & Windows?


On 3/5/07, Wolf <[EMAIL PROTECTED]> wrote:


Folks,

I have been busy with life over the last number of months and have
finally been able to sit down and take the time to construct a site to
house the scripts that people have used to try to take down my server.
The following URL links to the majority of the hack tools that have been
tried.  They are set to display their source only, a couple of them do
not display their Source, but I am sure that if you look on the web for
them as they are named on the link, that you will find what you seek.

http://ambiguous.dnsalias.net/

Wolf

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




Re: [PHP] Password Protect Directory

2007-03-04 Thread Tijnema !

Well, you could try to edit each PHP file and add a piece of login code at
top, but if the directory will also contain images (which need a password to
access), it would not be possible that way.

Tijnema


On 3/4/07, Jason Karns <[EMAIL PROTECTED]> wrote:


I'm trying to find a way to password protect a directory.  I currently
have
an authentication and authorization system in place for pages in my
directory.  I'd prefer to use my existing system somehow (as it includes
OpenID authentication) as opposed to using htaccess and HTTP Auth.  The
only
idea of found is to use mod_rewrite to have a PHP script serve up all the
files in the particular directory and have the authentication handled in
this script.  This just seems a little 'hackish' to me.  Is there any
other
way to password protect a directory with PHP?  I'd even entertain the idea
of using HTTP Auth if I could get PHP to 'login'.  For instance, the user
logs in at another page in the site, and then during the login process,
PHP
sets the HTTP Auth password so when the files in the directory are
accessed,
the user has already been logged in.

Any suggestions would be great, I can't find anything else online.



Re: [PHP] RE:[[PHP] Error in Script!!!

2007-03-06 Thread Tijnema !

On 3/5/07, Helder Lopes <[EMAIL PROTECTED]> wrote:


Helder Lopes wrote:

Erro no banco de
dados!");//line 23

Where is $con defined???
-B

$total = mysql_num_rows($result_id);
// Caso o usuário tenha digitado um login válido o número de linhas será
1..


if($total)
{

  // Obtém os dados do usuário, para poder verificar a senha e passar os
demais dados para a sessão

  $dados = mysql_fetch_array($result_id);



  // Agora verifica a senha

  if(!strcmp($senha, $dados["password"]))

  {
  // TUDO OK! Agora, passa os dados para a sessão e redireciona o
usuário
  $_SESSION["username"]   = $dados["username"];
  $_SESSION["realname"]   = $dados["realname"];
  $_SESSION["gid"]= $dados["gid"];
  require_once ('../utilizadores/listar.php');
  exit;
  }

  // Senha inválida
  else
  {
  echo "Senha inválida!";
  exit;
  }
}
// Login inválido
else
{
  echo "Error";
  exit;
}
?>

Why this script give me a error:


**Warning**: mysql_query(): supplied argument is not a valid MySQL-Link
resource in **ver.php** on line *23*

in a file with a name mysql.php
the $con is correct
with the other that results



I don't know , but if you have only 1 mysql connection, there's no need to
use a MySQL link, you can just leave that out, and it will use the last
opened connection by mysql_connect.

Tijnema


Re: [PHP] List all files in directory

2007-03-07 Thread Tijnema !

On 3/6/07, Jay Blanchard <[EMAIL PROTECTED]> wrote:


[snip]
Oh, yes, about that, how do you _really_ use PHP to do some reading on
the
client machine... like say. listing files... ;D
[/snip]

You're kidding, right? Here's how, set up a PHP enabled.nah, never
mind. Just repeat to yourself Dorothy, "PHP is server-side, not
client-side.."



Yeah that's what i tell a lot of people...

--

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




Re: [PHP] Class and subclass

2007-03-07 Thread Tijnema !

On 3/7/07, Alain Roger <[EMAIL PROTECTED]> wrote:


A() or B() mean constructors of th class A and B respectively.

Al.



Yes but they are functions.

On 3/7/07, Robert Cummings <[EMAIL PROTECTED]> wrote:

>
> On Wed, 2007-03-07 at 14:23 +0100, Alain Roger wrote:
> > Hi,
> >
> > i have a class A with some properties.
> > i have a class B with several public functions (i.e : Render())
> >
> > i would like to do something like that :
> >
> > class B()
> > {
> >  B()
>
> I'm pretty sure you mean "function B()" or in PHP 5 "function
> __construct()".
>
> >  {
> >  }
> >
> >  public function Render()
> >  {
> >   ...
> >  }
> > }
> >
> > class A
> > {
> >  private $myotherclass;
> >
> >  A()
>
> Similarly, I'm pretty sure you mean "function A()" or in PHP 5 "function
> __construct()".
>
> >  {
> >   $this->myotherclass = new classB();
> >  }
> >
> >  public function test()
> >  {
> >   $this->myotherclass->Render();
> >  }
> > }
> >
> > however, i'm not able to access to ->Render() of class B from Class A
> > property. Where could be the problem ?
>
> Cheers,
> Rob.
> --
> ..
> | 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.  |
> `'
>
>


--
Alain

Windows XP SP2
PostgreSQL 8.1.4
Apache 2.0.58
PHP 5



Re: [PHP] create and save file to folder

2007-03-07 Thread Tijnema !

On 3/7/07, Ross <[EMAIL PROTECTED]> wrote:


Hi,

I am trying to create a file with php. I want to enter the value of a
string
into it and then browse (if possible) and save to a specified folder with
the filename/extension (.php/.txt) entered in the dialog box.



R.


Sure it is possible, but it seems you have totally no knowledge about file
opening etc, if you want to browser stuff en save things, you are actually
making a file manager, and believe me, that's quite a lot of work.
Opening files is just by fopen, saving data with fread, and then closing it
with fclose. (simple huh?)
their manual pages:
http://www.php.net/fopen
http://www.php.net/fread
http://www.php.net/fclose

and sure, if you want to make a file manager, you might want to look at the
readdir function, http://www.php.net/readdir

Tijnema

--

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




Re: [PHP] db query not working

2007-03-07 Thread Tijnema !

On 3/7/07, Ed Curtis <[EMAIL PROTECTED]> wrote:


I have this code:

mysql_connect ($local_host, $local_user, $local_pass);
mysql_select_db ($local_db);

mysql_query ("DELETE FROM tmphitsmag");

$result = mysql_query ("SELECT DISTINCT company FROM view_log WHERE
company != ''");

if ($row = mysql_fetch_array($result)) {

do {

$magazine_path = $row['company'];
$magazine_path = explode("/", $magazine_path);

echo str_replace("_", " ", $magazine_path[2]) . "";

mysql_query ("INSERT INTO tmphitsmag (magazine)
   VALUES('$magazine_path[2]'");



Look how many ( you have, and how many ) you have
that's the problem...
try
mysql_query ("INSERT INTO tmphitsmag (magazine)
VALUES('$magazine_path[2]')");
that should solve the problem

Tijnema

   } while($row = mysql_fetch_array($result));


} mysql_close();

It dumps the table fine, works the explode, outputs the string in the
echo command the way I expect, but doesn't place the value in tmphitsmag
table.

Anyone have a clue?

Thanks,

Ed

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




Re: [PHP] db query not working as expected

2007-03-07 Thread Tijnema !

On 3/7/07, Ed Curtis <[EMAIL PROTECTED]> wrote:


I have this code:

mysql_connect ($local_host, $local_user, $local_pass);
mysql_select_db ($local_db);

mysql_query ("DELETE FROM tmphitsmag");

$result = mysql_query ("SELECT DISTINCT company FROM view_log WHERE
company != ''");

if ($row = mysql_fetch_array($result)) {

do {

$magazine_path = $row['company'];
$magazine_path = explode("/", $magazine_path);

echo str_replace("_", " ", $magazine_path[2]) . "";

mysql_query ("INSERT INTO tmphitsmag (magazine)
VALUES  ('$magazine_path[2]')");



Not sure about it but try this:
 mysql_query ("INSERT INTO tmphitsmag (magazine) VALUES
('".$magazine_path[2]."')");

Tijnema

   } while($row = mysql_fetch_array($result));


} mysql_close();

The code dumps the first table fine, selects, manipulates, and echoes
the string the way I expect, but fails to input the string into the
tmphitsmag table.

Any ideas?

Thanks,

Ed

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




Re: [PHP] db query not working as expected

2007-03-07 Thread Tijnema !

On 3/7/07, Ed Curtis <[EMAIL PROTECTED]> wrote:


I have this code:

mysql_connect ($local_host, $local_user, $local_pass);
mysql_select_db ($local_db);

mysql_query ("DELETE FROM tmphitsmag");

$result = mysql_query ("SELECT DISTINCT company FROM view_log WHERE
company != ''");

if ($row = mysql_fetch_array($result)) {

do {

$magazine_path = $row['company'];
$magazine_path = explode("/", $magazine_path);

echo str_replace("_", " ", $magazine_path[2]) . "";

mysql_query ("INSERT INTO tmphitsmag (magazine)
VALUES  ('$magazine_path[2]')");




what about adding the usual "or die"?
mysql_query ("INSERT INTO tmphitsmag (magazine)VALUES
('$magazine_path[2]')") or die(mysql_error());

Tijnema

   } while($row = mysql_fetch_array($result));


} mysql_close();

The code dumps the first table fine, selects, manipulates, and echoes
the string the way I expect, but fails to input the string into the
tmphitsmag table.

Any ideas?

Thanks,

Ed

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




Re: [PHP] Textarea update problem

2007-03-07 Thread Tijnema !

The file permissions are not set right, Apache is not able to read the PHP
file you've just uploaded to your server, chmod it to 644.

That should fix it.

Tijnema


On 3/7/07, Delta Storm <[EMAIL PROTECTED]> wrote:


[EMAIL PROTECTED] wrote:
> is there a question here, or are you asking us to write the script for
> you?
>
>   - Rick
>
>
>  Original Message 
>
>> Date: Wednesday, March 07, 2007 01:54:04 PM +0100
>> From: Delta Storm <[EMAIL PROTECTED]>
>> To: php-general@lists.php.net
>> Subject: [PHP] Textarea update problem
>>
>> Hi,
>>
>> I'd like to thank everybody who have helped me till now. All your
>> advices were very helpfull... :)
>>
>> But I have a problem again
>>
>> I need to build a script which will have have the following functions:
>>
>> 1.Be able to select 3 columns from a MySQL database(idnetify the
>> columns by ID) and put the column contents into 3 textarea objects.
>> (for example title,Text1,Text2 each into i textarea).
>>
>> 2.Edit and MySQL update the textarea contents
>>
>>
>> And all in one script.
>>
>> The script has a $id = $_GET['id'] variable which holds the
>> information about the certain table id.
>>
>>
>
> -- End Original Message --
>
>
>
>
This is the script, I have dealt with both problems but when I click on
the update button (submit button) i get an error msg:


Access forbidden!

You don't have permission to access the requested object. It is either
read-protected or not readable by the server.

If you think this is a server error, please contact the webmaster
<mailto:[EMAIL PROTECTED]>.


   Error 403

localhost 
03/07/07 16:17:37
Apache/2.2.3 (Win32) DAV/2 mod_ssl/2.2.3 OpenSSL/0.9.8d
mod_autoindex_color PHP/5.2.0


The user name and pass for the MySQL server are 100% correct.

It reads out the data from the database into the textarea object but
when I click the update button I get that msg.

Thank you! :)



http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
http://www.w3.org/1999/xhtml"; lang="hr">



UPDATE news and article items





 0)
   {
   while ($row = mysql_fetch_array($selResult))
   {
   if (!$_POST["submit"])
   {
   echo '';
   echo "";
   echo '';
   echo "";
   echo "";
   echo "";
   echo "";
   echo "";
   echo "";
   echo "sText";
   echo '';
   echo $row['sText'];
   echo "";
   echo '
   
   fText
   ';
   echo $row['fText'];
   echo '
   
   
   
   
   
   
   
   
   ';
   }
   else
   {
   $title = ($_POST['title']);
   $sText = ($_POST['sText']);
   $fText = ($_POST['fText']);

   $query = "update news set title='$title',
sText='$sText', fText='$fText' where id='$id'";

   $result = mysql_query($query) or die ("could not process
query : $query" . mysql_error());

   if ($result)
   {
   echo "Data updated succesfully";
   echo 'Povratak na
editiranje';
   }
   else
   {
   echo "Data update FAILED";
   }
   mysql_close($link);
   }
   }
   }

?>



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




Re: [PHP] Save and Continue

2007-03-07 Thread Tijnema !

Hi,

i was more thinking about automatically going to save.php, and if checked
(the code u used) redirect back to your shop, cart, etc. using header
function.

Tijnema

On 3/7/07, Dan Shirah <[EMAIL PROTECTED]> wrote:


Hello All,

I am trying to think through my new forms process.  I want to allow a
customer to submit multiple orders using the same credit card.   At the
bottom of my form I will have a "Save" link and a "Save and Submit
Additional" link/checkbox.

Basically what I want to happen is that if the user clicks on "Save" it
processes the form and sends them back to my homepage.

But if the user clicks "Save and Submit Additional", I want it to submit
the
first payment, then return to the same screen with the credit card
information still populated to the fields and allow the user to enter in a
new transaction.

I think my process for this would be something along the lines of:

if (isset($_POST['submit_additional'])) {

  include save.php
}  //This would save the information just entered to the database


By building a save.php file and including it only if needed, this would
accomplish what I am trying to do, correct?

I'm open to any/all ideas :)



Re: [PHP] php and javascript error

2007-03-07 Thread Tijnema !

Open the page with IE 7, and open the source, if it doesn't show any  tags, then it is a IE problem..

Tijnema


On 3/7/07, Németh Zoltán <[EMAIL PROTECTED]> wrote:


2007. 03. 7, szerda keltezéssel 10.59-kor Ed Curtis ezt írta:
> I've just run into this problem this morning
>
> 
>
> This produces an "Error on Page" in IE 7, but works perfectly in Firefox
> and Netscape.
>
> I have several other javascript calls on the page where this call
> resides and all of them work perfectly except for this one. Does this
> error occur because I'm sending the variables to another script that
> does some logging then forwards the user to the URL or is it just a IE
> quirk?
>

I'm almost sure it has nothing to do with php
rather javascript, and maybe microsoft's special javascript
interpretations...

greets
Zoltán Németh

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




Re: [PHP] php and javascript error

2007-03-07 Thread Tijnema !

On 3/7/07, Ed Curtis <[EMAIL PROTECTED]> wrote:


Németh Zoltán wrote:
> 2007. 03. 7, szerda keltezéssel 10.59-kor Ed Curtis ezt írta:
>
>>I've just run into this problem this morning
>>
>>
>>
>>This produces an "Error on Page" in IE 7, but works perfectly in Firefox
>>and Netscape.
>>
>>I have several other javascript calls on the page where this call
>>resides and all of them work perfectly except for this one. Does this
>>error occur because I'm sending the variables to another script that
>>does some logging then forwards the user to the URL or is it just a IE
>>quirk?
>>
>
>
> I'm almost sure it has nothing to do with php
> rather javascript, and maybe microsoft's special javascript
> interpretations...

I know it's not the PHP but rather the JS that's causing it. What I fail
to understand is that there are 2 JS calls before, and 2 JS calls after
this one in my page and the other 4 work perfectly. They are basically
the same call too, just to different scripts. I just wondered if anyone
knew why this particular call doesn't work or had come across anything
like this.

Thanks



I think you're not at the right mailing list for this, and btw, it would be
a lot easier to find what is going wrong, if you post one of the working
ones...

Tijnema

--

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




Re: [PHP] Save and Continue

2007-03-07 Thread Tijnema !

But ofcourse you could add a lot of things to a shopping cart and checkout
once

btw, it's safer to use things like Paypal...

Tijnema

-- To the full PHP list now


On 3/7/07, Jochem Maas <[EMAIL PROTECTED]> wrote:


Robert Cummings wrote:
> On Wed, 2007-03-07 at 10:39 -0500, Dan Shirah wrote:
>> then return to the same screen with the credit card
>> information still populated
>
> You should treat credit card information like a hot potato... get rid of
> it as soon as possible. What happens if Johnny Forgetful forgets to log
> out of his session on a public computer? Then Jenny Fastfingers jumps on
> and notices the open session? Voila, Jenny Fastfingers just got Johnny
> Forgetful's credit information.

and don't forget the all the Bob Shitesters that'll sue you for every
penny you'll
ever have at the slightest opportunity regardless of what you
try/do/intend,
best not accept CC numbers or any of that jazz at all.

>
> Cheers,
> Rob.

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




Re: [PHP] Save and Continue

2007-03-07 Thread Tijnema !

So, what is your actual problem?

you can simple add all items to a session, and then when checking out,
getting all data from the session.

*means all data is lost when user leaves page...

Tijnema

On 3/7/07, Dan Shirah <[EMAIL PROTECTED]> wrote:


Rght, that is similar to what I am trying to do...let them inout several
items to be paid on and let them all be tied to the same credit card to be
charged.

On 3/7/07, Tijnema ! <[EMAIL PROTECTED]> wrote:
>
> But ofcourse you could add a lot of things to a shopping cart and
> checkout
> once
>
> btw, it's safer to use things like Paypal...
>
> Tijnema
>
> -- To the full PHP list now
>
>
> On 3/7/07, Jochem Maas <[EMAIL PROTECTED]> wrote:
> >
> > Robert Cummings wrote:
> > > On Wed, 2007-03-07 at 10:39 -0500, Dan Shirah wrote:
> > >> then return to the same screen with the credit card
> > >> information still populated
> > >
> > > You should treat credit card information like a hot potato... get
> rid of
> > > it as soon as possible. What happens if Johnny Forgetful forgets to
> log
> > > out of his session on a public computer? Then Jenny Fastfingers
> jumps on
> > > and notices the open session? Voila, Jenny Fastfingers just got
> Johnny
> > > Forgetful's credit information.
> >
> > and don't forget the all the Bob Shitesters that'll sue you for every
> > penny you'll
> > ever have at the slightest opportunity regardless of what you
> > try/do/intend,
> > best not accept CC numbers or any of that jazz at all.
> >
> > >
> > > Cheers,
> > > Rob.
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>




Re: [PHP] help with script needed

2007-03-07 Thread Tijnema !

On 3/7/07, Bruce Gilbert <[EMAIL PROTECTED]> wrote:


I have a little script that prints a number out from 1 to 100
[php]
";

}
?>
[/php]

I just need to add code to print something different, say "foo" if the
output is a multiple of 5 or 10 for example. How do I go about doing
this?

--
::Bruce::




I've seen that question a lot, what i use is fairly simple
if( intval($number / $multiple) == ($number / $multiple ) )

try that

Tijnema

--

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




Re: [PHP] help with script needed

2007-03-07 Thread Tijnema !

oops, ofcourse whe have the modular :)

On 3/7/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:


try this
if ($i%5 == 0) echo "foo";

-afan

> I have a little script that prints a number out from 1 to 100
> [php]
>  for( $i=1; $i<=100; $i++ )
> {
> echo $i;
> echo "";
>
> }
> ?>
> [/php]
>
> I just need to add code to print something different, say "foo" if the
> output is a multiple of 5 or 10 for example. How do I go about doing
> this?
>
> --
> ::Bruce::
>
> --
> 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] Is there a way to un include a file

2007-03-07 Thread Tijnema !

AFAIK there's no function to un include a file, but i don't see a problem
here, as when you include your second file, everything (all conflicting
variables) will be overwritten.
If you still have problems, you might want to use classes around your
functions and variables.

Tijnema


On 3/8/07, jekillen <[EMAIL PROTECTED]> wrote:


Hello;
Is there a way to un include a file once it has been included in a
script.
My concern is where two php files might be included in another php
file they might have code or variables that conflict. I am thinking
of including files with different names but follow the same pattern
of code and variables but may have different values for variables
or different versions of the same function.
If there is not a specific function for un including a file (I have not
seen any indication from my text books that there is), it seems like
it would be nice to have one.
Meanwhile I will be doing some experimentation.
Thanks in advance;
Jeff K

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




Re: [PHP] Monitoring download, detecting completion?

2007-03-07 Thread Tijnema !

Hi,

I think that cURL would do the job, starting the transfer with
curl_init ,curl_setopt and curl_exec
then you can get the info about the download with curl_getinfo
Also take a look at the other curl functions, and have a look at the
curl_setopt function page, as there are a lot of options that can be set.
cURL: http://www.php.net/curl

Hope this is what you need.

Tijnema


On 3/8/07, Skip Evans <[EMAIL PROTECTED]> wrote:


Hey all,

I have a need to monitor a download from the
server to the client's machine.

I'm not familiar with any mechanisms for doing so.

If anyone has any hints to point me towards I'll
get a' researching.
--
Skip Evans
Big Sky Penguin, LLC
61 W Broadway
Butte, Montana 59701
406-782-2240
http://bigskypenguin.com
=-=-=-=-=-=-=-=-=-=
Check out PHPenguin, a lightweight and
versatile PHP/MySQL development framework.
http://phpenguin.bigskypenguin.com/

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




Re: [PHP] php and javascript error

2007-03-07 Thread Tijnema !

Just a little side note, you said that firefox wasn't giving an error, i
think it does, but that it hides the error.
Open your page, and then go to Tools->javascript console.
There it will display all javascript errors. And gives a nice detailed
error.

Tijnema


Re: [PHP] server error or script error

2007-03-08 Thread Tijnema !

On 3/8/07, Ross <[EMAIL PROTECTED]> wrote:




I use this script but is had sudenly stop working. I think it is a config
change on the remote server. The porblem is the file either doesn't open
or
downloads as download.php

Can anyone suggest a way to improve this script or debug to fins out if it
is a script error or server error.


R.




Are you sure there isn't any data on the screen before you send the header?
and are you sure that all the vars coming from the database are correct
filled (content-type for example)

Tijnema

--

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




Re: [PHP] why did it stop working?

2007-03-08 Thread Tijnema !

On 3/8/07, Ross <[EMAIL PROTECTED]> wrote:



Can someone explain to me why this used to work but then stopped

header("Content-length: $size");
header("Content-type: $type");
header("Content-Disposition: attachment; filename=$name");

and this now works

header("Content-length: ".$size);
header("Content-type: ".$type);
header('Content-Disposition: attachment; filename="'.$name.'"');
echo $content;


Any suggestions?



PHP upgraded maybe?

Tijnema

--

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




Re: [PHP] Problem with script....

2007-03-08 Thread Tijnema !

On 3/8/07, Fabio Silva <[EMAIL PROTECTED]> wrote:


Hi all, i have a problem with this script... could anybody help me??



What is your problem? you are only posting your code here and whe have to
find the error?
What error comes up?

Tijnema


Regards,



Password change

";
   echo "";
   echo "Username:";
   echo "Old Password:";
   echo "New Password:";
   echo "";
   echo "New Password, again:";
   echo "";
   echo "";
   echo "";
   echo "";
   exit();
   }

if (! $oldpw ) {
   echo "Naoi fornecido a senha antiga!";
   $abort=1;
   }

if (! $newpw1 ) {
   echo "Nao foi fornecido a nova senha!";
   $abort=1;
   } else
   if (! $newpw1 == $oldpw ) {
   if ($newpw1 != $newpw2) {
   echo "Nova senha nao e igual!";
   $abort=1;
   }
   if (strlen($newpw1) < 6) {
   echo "Nova senha e menor que 6 caracteres!";
   $abort=1;
   }

   }

$ldap_session=ldap_connect($ldap_server);
$anon_session=ldap_bind($ldap_session);
$anon_search=ldap_search($anon_session,$base_dn,"uid=$user");
$uid_data=ldap_get_entries($anon_session,$anon_search);
if( $uid_data["count"] != 1) {
   echo "".$user." nao e valido!";
   $abort=1;
   }

$dn=$uid_data[0]["dn"];
$auth_session=ldap_bind($ldap_session,$dn,$oldpw);
if (! $auth_session) {
   echo "Senha antiga incorreto!";
   $abort=1;
   }

if ($abort == 1) {
   echo "Favor clique em voltar e corriga o(s) problema(s)";
   exit();
   }

srand((double)microtime()*100);

$alphabet=array("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o",

"p","q","r","s","t","u","v","w","x","y","z","A","B","C","D",

"E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S",

"T","U","V","W","X","Y","Z","2","3","4","5","6","7","8","9");
$salt=$alphabet[rand(0,58)].$alphabet[rand(0,58)];
$mod_data["userpassword"]="{crypt}".crypt($newpw1,$salt);
ldap_modify($auth_session,$dn,$mod_data);
ldap_unbind($ldap_session);
?>
Seu password foi alterado
http://www.terra.com.br";>Pagin principal



--
Fabio S. Silva

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




Re: [PHP] Any automated php email sending solution please?

2007-03-08 Thread Tijnema !

Or just get all email addresses from the database, and run a loop.

Tijnema


On 3/8/07, Rabih Tayyem <[EMAIL PROTECTED]> wrote:


check PHPmailer..
very easy to use..
http://phpmailer.sourceforge.net/

Regards,
Rabih


On 3/8/07, Chris Carter <[EMAIL PROTECTED]> wrote:
>
>
> Any software that anyone is aware of for sending automated emails. I
have
> some email addresses in my database, now I am looking forward to send
HTML
> Formatted emails to those email address without having to pick up each
> email
> address and send it.
>
> I am using php on my site and cPanel is where I am doing all this from.
>
> Thanks in advance,
>
> Chris
> --
> View this message in context:
>
http://www.nabble.com/Any-automated-php-email-sending-solution-please--tf3369137.html#a9374216
> Sent from the PHP - General mailing list archive at Nabble.com.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



Re: [PHP] Intro to PHP question

2007-03-08 Thread Tijnema !

Your probably created it from a windows machine. Try converting the file
first with dos2unix
dos2unix ../uri.php

Tijnema


On 3/8/07, Jonathan Kahan <[EMAIL PROTECTED]> wrote:


Hi all,

I am using a linux server. When the php file below (uri.php) is run from
the
command line I get the following error. Any ideas on what I could do
differently?

Thanks for any help,

Jonathan

../uri.php: line 1: syntax error near unexpected token `newline'
../uri.php: line 1: `'






Kind Regards
Jonathan Kahan

Systems Developer
Estrin Technologies, inc.
1375 Broadway, 3rd Floor, New York, NY, 10018

Email: [EMAIL PROTECTED]
Web: http://www.estrintech.com

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




Re: [PHP] Intro to PHP question

2007-03-08 Thread Tijnema !

I never work with PHP from the commandline,. but i think it is not possible
to use HTML in a php file, so try replacing this:

";
and replace this:
?>

with this:
echo "";
?>

I think that will fix it.

Tijnema


On 3/8/07, Jonathan Kahan <[EMAIL PROTECTED]> wrote:


 Unfortunately not. I used the vi editor within Linux to create the file.
I am using a windows machine locally but the server I am doing this all in
is a Linux server which I am accessing through putty.

- Original Message -
*From:* Tijnema ! <[EMAIL PROTECTED]>
*To:* Jonathan Kahan <[EMAIL PROTECTED]>
*Cc:* php-general@lists.php.net
*Sent:* Thursday, March 08, 2007 12:03 PM
*Subject:* Re: [PHP] Intro to PHP question


Your probably created it from a windows machine. Try converting the file
first with dos2unix
dos2unix ../uri.php

Tijnema


On 3/8/07, Jonathan Kahan <[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
> I am using a linux server. When the php file below (uri.php) is run from
> the
> command line I get the following error. Any ideas on what I could do
> differently?
>
> Thanks for any help,
>
> Jonathan
>
> ../uri.php: line 1: syntax error near unexpected token `newline'
> ../uri.php: line 1: `'
>
> 
>  $d=date("D");
> if ($d=="Fri")
> echo "Have a nice weekend!";
> else
> echo "Have a nice day!";
> ?>
> 
>
>
> Kind Regards
> Jonathan Kahan
> 
> Systems Developer
> Estrin Technologies, inc.
> 1375 Broadway, 3rd Floor, New York, NY, 10018
> 
> Email: [EMAIL PROTECTED]
> Web: http://www.estrintech.com
>
> --
> PHP General Mailing List ( http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



Re: [PHP] Intro to PHP question

2007-03-08 Thread Tijnema !

AFAIK you can't run a php file directly, or you need to add #!/bin/php or
something to the first line, but you can run it with
php ../uri.php
but i suggest you to run it from a webserver like apache.

*if you don't have it, i can give you a few MB to try PHP out

Tijnema


On 3/8/07, Jonathan Kahan <[EMAIL PROTECTED]> wrote:


 Hi all,

Dave,

I am attempting to use html for learning purposes. My goal is to begin
working on a website.

Tijnema,

I tried the below and got the following errors. I can't imagine the error
on line 3 is a tag issue.

Jonathan

[EMAIL PROTECTED] cgi-bin]# ./uri.php
./uri.php: line 2: ?php: No such file or directory
./uri.php: line 3: syntax error near unexpected token `"D"'
./uri.php: line 3: `$d=date("D");'
[EMAIL PROTECTED] cgi-bin]# vi uri.php
[EMAIL PROTECTED]  cgi-bin]# vi uri.php



- Original Message -
*From:* Dave Goodchild <[EMAIL PROTECTED]>
*To:* Tijnema ! <[EMAIL PROTECTED]>
*Cc:* Jonathan Kahan <[EMAIL PROTECTED]> ; php-general@lists.php.net
*Sent:* Thursday, March 08, 2007 12:43 PM
*Subject:* Re: [PHP] Intro to PHP question


If you are running that from the command line, why do you need html? Not
sure why you're doing that.




Re: [PHP] Intro to PHP question

2007-03-08 Thread Tijnema !

He wanted to use it for the web, so why should he try it out on CL first?

I can offer a few MBs for everyone that wants to get learning PHP.

Tijnema


On 3/8/07, Ben Ramsey <[EMAIL PROTECTED]> wrote:


On 3/8/07 12:59 PM, Dave Goodchild wrote:
> If you really want to run that on the command line, you will need the
path
> to php on the first line of the file.

Or, he can run it through the PHP CLI with:
$> php uri.php

> Please, forget the command line stuff unless you want to write command
line
> scripts, and get that file running in a web environment where it
belongs.
> happy to help if you need any more assistance doing that!

What's so wrong with learning PHP from the command line? If he's
comfortable with the command line, then he should be able to learn PHP
from the command line. Why else does PHP have a CLI?

--
Ben Ramsey
http://benramsey.com/



Re: [PHP] Re: $35 to the first person who can do this XML-parsing PHP script

2007-03-08 Thread Tijnema !

On 3/8/07, Ben Ramsey <[EMAIL PROTECTED]> wrote:


On 3/8/07 2:59 PM, Rob Gould wrote:
> 1)  Read XML data from an URL (
www.librarytools.com/events/sampledata.txt)
> 2)  Loop through all XML results and print to the screen the "eventname"
> and "eventnextoccurrencedate" (Just the date) values
>
> I'll probably kick myself once I see how easy it is, but I'm willing to
> pay to see it working.  Feel free to email me off-list.

If you're using PHP 5, take a look at SimpleXML. This is extremely easy
to do.

http://www.php.net/simplexml

Take a look at Example 2134 on that page to get you started, and see
http://www.php.net/simplexml_load_file to load XML from a URL.

Do I get the $35 anyway for the consultation? ;-)

--
Ben Ramsey
http://benramsey.com/



Well ben, now i can make the script for Rob :P

No i won't as i think he can do himself.

Tijnema

--

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




Re: [PHP] $35 to the first person who can do this XML-parsing PHP script

2007-03-08 Thread Tijnema !

On 3/8/07, Chris Shiflett <[EMAIL PROTECTED]> wrote:


Rob Gould wrote:
> I'll send $35 to someone via paypal who can create a PHP script that
> will do the following:
>
> 1)  Read XML data from an URL (
www.librarytools.com/events/sampledata.txt)
> 2)  Loop through all XML results and print to the screen the "eventname"
> and "eventnextoccurrencedate" (Just the date) values


   NameDate

http://librarytools.com/events/sampledata.txt'
);



here you are using a PHP 5 function, and he said he was only using PHP 4.4.4
So this script won't work for him.

foreach ($xml->source->result as $f) {

   $name = '?';
   $date = '?';

   foreach ($f as $event) {
   if ($event['n'] == 'eventname') {
   $name = $event;
   } elseif ($event['n'] == 'eventnextoccurrencedate') {
   $date = date('D, M d Y H:i:s', strtotime($event));
   }
   }

   echo "{$name}{$date}\n";
}

?>



Gotta love SimpleXML. :-)

--
Chris Shiflett
http://shiflett.org/

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




Re: [PHP] IE not uploading files

2007-03-08 Thread Tijnema !

Hi,

Can you post your HTML code of the form used?
I don't really think the problem is in PHP, as it looks like a client side
problem, and PHP is server side....


Tijnema


On 3/9/07, Skip Evans <[EMAIL PROTECTED]> wrote:


Hey all,

I have the following code uploading and image to a
directory from a form, and it works great on
FireFox, but not IE 6.0.

Does anyone have an suggestions?

Thanks,
Skip

 // get the image directory.

list($mats_img_path)=bsp_DB_row_fields("SELECT
mats_img_path FROM bsp_configuration");
// move the uploaded file from the temp dir to
permanent directory.
move_uploaded_file($_FILES['image']['tmp_name'],

$_SERVER['DOCUMENT_ROOT']."/$mats_img_path/".$image);

--
Skip Evans
Big Sky Penguin, LLC
61 W Broadway
Butte, Montana 59701
406-782-2240
http://bigskypenguin.com
=-=-=-=-=-=-=-=-=-=
Check out PHPenguin, a lightweight and
versatile PHP/MySQL development framework.
http://phpenguin.bigskypenguin.com/

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




Re: [PHP] Monitoring download, detecting completion?

2007-03-09 Thread Tijnema !

On 3/9/07, Skip Evans <[EMAIL PROTECTED]> wrote:


Hi Tijnema,

To be clear, this can work for the client
downloading say a music (mp3) file from the server
to their local hard drive? If so, that would be
great, but I just want to be clear I spelled out
the issue properly.

Thanks tons!
Skip



I'm sorry, i thought you meant you wanted to transfer from 1 server to your
own server.
With this i can't help you any further i think, The code posted by Nicholas
Yim isn't very succesfull too i think as it only shows you when the server
outputted the last piece of the file to the client, but that is NOT the same
as when download is completed.

I don't know if it is even possible in PHP, as i don't have a way to do it
now.

Tijnema

Tijnema ! wrote:

> Hi,
>
> I think that cURL would do the job, starting the transfer with
> curl_init ,curl_setopt and curl_exec
> then you can get the info about the download with curl_getinfo
> Also take a look at the other curl functions, and have a look at the
> curl_setopt function page, as there are a lot of options that can be
set.
> cURL: http://www.php.net/curl
>
> Hope this is what you need.
>
> Tijnema
>
>
> On 3/8/07, Skip Evans <[EMAIL PROTECTED]> wrote:
>>
>> Hey all,
>>
>> I have a need to monitor a download from the
>> server to the client's machine.
>>
>> I'm not familiar with any mechanisms for doing so.
>>
>> If anyone has any hints to point me towards I'll
>> get a' researching.
>> --
>> Skip Evans
>> Big Sky Penguin, LLC
>> 61 W Broadway
>> Butte, Montana 59701
>> 406-782-2240
>> http://bigskypenguin.com
>> =-=-=-=-=-=-=-=-=-=
>> Check out PHPenguin, a lightweight and
>> versatile PHP/MySQL development framework.
>> http://phpenguin.bigskypenguin.com/
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>

--
Skip Evans
Big Sky Penguin, LLC
61 W Broadway
Butte, Montana 59701
406-782-2240
http://bigskypenguin.com
=-=-=-=-=-=-=-=-=-=
Check out PHPenguin, a lightweight and
versatile PHP/MySQL development framework.
http://phpenguin.bigskypenguin.com/



Re: [PHP] Passing a class through an array

2007-03-09 Thread Tijnema !

On 3/9/07, Jeff Taylor <[EMAIL PROTECTED]> wrote:


Hey all,
I'm very new to programming and PHP.
I want to pass instances of a class through an array, and then use a
foreach
later to grab details of each class at once... but it returns a fatal
error

Code:

$me = new Toon('Toon1','1')
$him = new Toon('Toon2','0')

  $characterListing = array($me, $him);

  foreach ($characterListing as $name1)
  {
   if ($name1->GetIsPlayer())
   {
echo "Name:  ".$name1->$name;// etc etc etc



use $name1->name;instead of $name1->$name;
That's all.

Tijnema

  }

  }



the error I get is: Fatal error: Cannot access empty property in
c:\Inetpub\wwwroot\MyProjects\SecondOffering\htmlFns.php on line 140

Can anyone help?

Thanks, Jeff



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




Re: [PHP] Intro to PHP question

2007-03-09 Thread Tijnema !

On 3/8/07, Ben Ramsey <[EMAIL PROTECTED]> wrote:


On 3/8/07 1:44 PM, Tijnema ! wrote:
> He wanted to use it for the web, so why should he try it out on CL
first?

Because there are some advantages to being able to run something quickly
through the CLI without having to load it in a web browser. He was just
doing a simple test, so the PHP CLI was perfect for the job.

> I can offer a few MBs for everyone that wants to get learning PHP.

megabytes?



Yeah, a few megabytes is enough to test your PHP scripts out.

--

Ben Ramsey
http://benramsey.com/

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




Re: [PHP] url fopen() failed to open stream

2007-03-09 Thread Tijnema !

On 3/9/07, Michael Clayfield <[EMAIL PROTECTED]> wrote:


when i open up a url with fopen(), i get this error message:*

Warning*: fopen(http://sumurlhere.whatever/index.html) [function.fopen
<http://127.0.0.1/bots2/function.fopen>]: failed to open stream: A
connection attempt failed because the connected party did not properly
respond after a period of time, or established connection failed because
connected host has failed to respond. in
*C:\xampp\htdocs\bots2\main.php* on line *4
*
i believe this could because i am behind a proxy server, would someone
be able to confirm this? also if this is the problem, where would i set
the proxy server to be used?*
*



Maybe you could post your code, let's say line 1-5
I don't know a lot about proxy, but you might want to take a look at the
curl documentation, I don't know what your exactly gonna retrieve from the
server, but i think curl could do it.
curl documentation: www.php.net/curl

Tijnema

--

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




Re: [PHP] PHP Design View

2007-03-09 Thread Tijnema !

On 3/9/07, Chris <[EMAIL PROTECTED]> wrote:


Fred wrote:
> Hello What program whould i use to see a design view of php scripts not
on a
> server. Im running Windows XP Pro sp2. I thought Dreamweaver did but as
i
> was going to buy a friend told me it cant see design only the script.

PHP doesn't have a 'design view', your HTML controls that, maybe with
the help of PHP but HTML is what is given to the browser and that's what
you see.



As a PHP script differs in each output, it can't have a preview. If you want
to preview just save it and visit it with a browser.
If you have dreamwaver, you can also set up remote servers, and then a
CTRL+s action would automatically upload your file to the server.
example that it doesn't have the same preview each time:

Sometimes it will show you preview 1, and sometimes it wil show you preview
2.
Also, PHP can handle data from databases, files, browser, etc.
you can run a script like this: www.testserver.com/myscript.php?var=abc
now you would have $_GET['var'] set to abc, but once you go to
www.testserver.com/myscript.php?var=def $_GET['var'] is set to def, and so
you can choose to give it a total different look. So the only option is to
use a browser.

Tijnema

--

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] Help with captcha

2007-03-09 Thread Tijnema !

I'm not sure but i think that you need to place your javascript inside the
head tags, which you (i guess) output in header.php

Tijnema


On 3/9/07, Joker7 <[EMAIL PROTECTED]> wrote:


Im trying to use a captcha script from :
http://www.boutell.com/newfaq/creating/captcha.html
I can get it to work with plan HTML forms but not with this PHP form I
use.
Any help with this would be a great help.
Cheers
Chris



//<!--
// pop a windoid (Pictures)
function popWin(url, w, h)
{
  var madURL = url;
  var x, y, winStr;
  x=0; y=0;
  self.name="opener";
  winStr =

"height="+h+",width="+w+",screenX="+x+",left="+x+",screenY="+y+",top="+y+",channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=1,scrollbars=0,status=0,toolbar=0";
  lilBaby = window.open(madURL, "_blank", winStr);
}
//--> 


";
print "";
print "Name: ";
print "Country:";
print "Homepage";
print "E-mail:";
print "Aim:";
print "ICQ:";
print "Yahoo:";
print "MSN:";
print "Comment:";
print "";

print "";
print "";
print "Clickable Smilies";
print "
";
print "
";
print "
";
print " ";
print " ";
print " ";
print " ";
print " ";
print " ";
print " ";
print " ";
print "";
print "";
print "";
print "";
print "";
print "";
print "\n";
print "function addSmiley(textToAdd)\n";
print "{\n";
print "document.form.comment.value += textToAdd;";
print "document.form.comment.focus();\n";
print "}\n";
print "\n";
print "";
print "BBCode instructions";
  }




else if (isset($_POST['submit']))
{
   $name=$_POST['name'];
   $country=$_POST['country'];
   $email=$_POST['email'];
   $homepage=$_POST['homepage'];
   $aim=$_POST['aim'];
   $icq=$_POST['icq'];
   $yim=$_POST['yim'];
   $msn=$_POST['msn'];
   $comment=$_POST['comment'];
   if(!$name || !$comment)
   {
 print "Name or comment not entered, please go back
and sign again";
   }
  else
   {
$r=$_SERVER["REMOTE_ADDR"];
$day=date("D M d, Y H:i:s");
$timegone=date("U") ; //seconds since Jan 1st, 1970
$putinguestbook="INSERT INTO gbook(name, country, mail, homepage,
comment, realtime, aim, icq, yim, msn, time,IP)

VALUES('$name','$country','$email','$homepage','$comment','$day','$aim','$icq','$yim','$msn','$timegone','$r')";
mysql_query($putinguestbook);
print "Thanks for posting, you will now be redirected  ";
   }
}
}
?>






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




Re: [PHP] Help with the php bug in the Squirrelmail plugin's script

2007-03-09 Thread Tijnema !

If there are no people willing to, i am, but i don't have a lot of time.
I hope it isn't urgent.

Tijnema


On 3/9/07, Jevos, Peter <[EMAIL PROTECTED]> wrote:



Hi
I'd like to ask you for the help
I'm using Squirellmail with plugin Shared calendar. This is simple nice
plugin written by Paul Lesniewski
But I found the bug in this plugin. The bug seems to be related with
variable and memory.
The scripts are really slow and sometimes takes 20-30 seconds under some
conditions.
Unfortunately Paul is busy and has no time to examine it. Just told me
that it seems like there is a problem in that all files are inspected
even when it just needs to look for one file.
I found out what caused this delay and what action but I'm not good
programmer therefore I cannot repair it by myself
Can anybody look at this plugin and bug ? I can provide more information
Can anybody give me some advice how to proceed?

Thanks

Pet

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




Re: [PHP] Hive Dekoder

2007-03-09 Thread Tijnema !

Maybe you want to give an example of what you have, and what it should be
after decoding.
I have no idea what Hive Logic Enkoder exactly does, but somebody might give
you a help on how to decode.

Tijnema


On 3/9/07, Richard Lynch <[EMAIL PROTECTED]> wrote:


Short Version:
Anybody got a good quick clean hack to "crack" Hive Logic Enkoder?

CC me off-list on this one, please.


Long Version:
So this guy I'm working for has 55,000 web pages he built by hand, and
I need to scrape them into a database, to assimilate them into the new
system where all the new documents are db-driven.

In some of these documents, he used the Hive Logic Enkoder online to
create that gnarly JavaScript to obfuscate emails, and pasted it into
hist documents.
[And in some cases back in 2000 he didn't, which is one of the reasons
for importing and re-publishing all these documents, so we can control
email exposure much better.]

So what I need is a Hive Logic Dekoder.

I've found phpjs, which seemed like a winner, but it choked on my
first sample. :-(

I've found J4P5 (Javascript 4 (for) PHP 5) which requires PHP 5,
which, for complex reasons not relevant here, we're not using (yet).
If I absolutely HAVE to, I can probably convince gentoo to install PHP
5 CLI next to PHP 4, and run it via exec() from PHP4, just for this
one task.  Sounds pretty cumbersome, and I like to K.I.S.S.

Plus, it took me a week to figure out how to trick Gentoo into giving
me pcntl in PHP 4 CLI and not in APXS, and to have both installed at
the same time.  So getting PHP 5 without it assuming I'm trying to
upgrade and remove PHP 4 would probably take another week or two, just
to install. :-(

J4P5 references MetaPHP, which looks really nifty, but I don't want to
write my own PHP4-based JS interpreter in MetaPHP, as I'm a)
unqualified and b) under time constraints that make that *WAY* out of
scope.

I could, in theory, run Windows plus a COM object to fire up IE and
possibly hook into the DOM to get the result of the JS, as I have a
testing framework I hacked from a php|arch article that does that...
Except I'm not using Windows here, so I'd have to re-do the whole
thing with, errr, whatever is the moral equivalent...

I suppose I could attempt (again) to use Perl [shudder] and get that
Package thingie I've heard of that lets Perl execute JS, and then
exec() Perl to execute the JS, but that sounds awfully cumbersome, and
I'm a K.I.S.S. kind of guy.

At this point, I've got several unattractive options, and am hoping
somebody who has been down this road can help me eliminate some of
them, or, in an ideal world, point me to the perfect solution I've
managed to miss.

CC me on this one, please.

TIA!

--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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




Re: [PHP] DB_DataContainer

2007-03-10 Thread Tijnema !

In PHP 5 some things changed, and that's why they first check if PHP version
is 5 or greater, if so, it constructs this class and function in PHP5 style,
else it uses older syntax.
You might want to take a look at this manual page:
http://www.php.net/manual/en/migration5.php

Tijnema


On 3/10/07, php trainer <[EMAIL PROTECTED]> wrote:


Could someone explain what this does and why it's beneficial?

Thanks,

Ed

--

if (version_compare(phpversion(), '5.0.0', 'ge')) {

   class DB_DataContainer_Overload {
   function __call($method,$args) {
   $retval = null;
   $this->___call($method,$args,$retval);
   return($retval);
   }
   }

} else {

   eval('
   class DB_DataContainer_Overload {
   function __call($method,$args,&$retval) {
   return($this->___call($method,$args,$retval));
   }
   }
   ');

}



Re: [PHP] FW: looking for two remote functions

2007-03-10 Thread Tijnema !

On 3/10/07, Németh Zoltán <[EMAIL PROTECTED]> wrote:


2007. 03. 10, szombat keltezéssel 12.42-kor Riyadh S. Alshaeiq ezt írta:
> Actually if right click on any file or folder on a machine you will see
that
> there are two values (Size on disk & Size). Files and folders are stored
on
> the disk in what is called clusters (a group of disk sectors). Size on
disk
> refers to the amount of cluster allocation a file is taking up, compared
to
> file size which is an actual byte count.
>
> As I mentioned before what I want is a function for getting the result
for
> the Size no for Size on Disk

okay then what about this?

function real_filesize_linux($file) {
  @exec("filesize $file",$out,$ret);
  if ( $ret <> '0' ) return FALSE;
  else return($out[0]);
}

if you want it on a remote machine, you should use something like
ssh2_exec() instead of exec()

hope that helps
Zoltán Németh



He was interested on using it over HTTP, not over SSH...
I don't know if there are faster ways, but you could open a socket to the
host on port 80, get the file, and only read the header where it says
content-length: 400 for example, then you know the file is 400bytes when you
download it.
something like:
$socket = fsockopen($host,$port);
$size = 0;
while($size == 0)
{
$line = fgets($socket);
if(strlen($line) >= 17)
{
if(substr(strtolower($line),0,14) == "content-length")
{
$size = substr($line,16)
}
}

Now your remote file size is in $size.
It is not too fast, but everything in PHP is fast and so is this.

Tijnema



>
> Riyadh
>
> -Original Message-
> From: Németh Zolt?n [mailto:[EMAIL PROTECTED]
> Sent: 10/Mar/2007 12:27 PM
> To: Riyadh S. Alshaeiq
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] FW: looking for two remote functions
>
> I'm afraid I don't understand what you want. The size of a file is its
> size in bytes, that is its size on the disk. So what else?
>
> greets
> Zolt?n Németh
>
> 2007. 03. 10, szombat keltezéssel 06.07-kor Riyadh S. Alshaeiq ezt ?rta:
> > Thank you Mickey, but I have already looked in there and the function
> posted
> > in the notes is working just fine for getting the size on disk which I
am
> > not interested in..
> >
> > Riyadh
> >
> > -Original Message-
> > From: Mikey [mailto:[EMAIL PROTECTED]
> > Sent: 9/Mar/2007 2:57 PM
> > To: php-general@lists.php.net
> > Subject: Re: looking for two remote functions
> >
> > Riyadh S. Alshaeiq wrote:
> > > Hello everybody,
> > >
> > >  I am looking for an HTTP function for getting remote filesizes.
Keeping
> > in
> > > mind that I am NOT interested in getting the "size on disk" figure,
I
> need
> > > the actual size of the files when downloaded to a local machine.
Please
> > let
> > > me know if there are any..
> > >
> > > Another thing, I also need a remote function that gets the created
date
> > and
> > > last modified separately, if possible..
> > >
> > > Best regards
> > >
> > >
> > >
> > >
> >
> > Try looking here:
> >
> > http://uk.php.net/manual/en/function.filesize.php
> >
> > If the function itself isn't of use to you, look further down in the
> > notes and I am sure you will find something useful.
> >
> > Mikey
> >
>

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




Re: [PHP] Variable variables and references

2007-03-10 Thread Tijnema !

I must say, in all the years i am programming with PHP (about 5-6 years) i
NEVER used references.
So i don't find it useful, but well, if you want to give your variable
content more than one name, you can :)

I think you just need to start programming now, keeping in mind they are
available, but don't use them if it isn't needed.

Tijnema


On 3/10/07, Dave Goodchild <[EMAIL PROTECTED]> wrote:


Hi guys, I have just read 'Programming PHP' (O'Reilly) and although I
think
it's a great book, I am confused about variable variables and references -
not the mechanics, just where you would use them.

The subject of variable variables is explained but no examples are given
as
to why and where you would utilise them.

As for references, the examples given with regard to passing and returning
by reference in functions is clear, but no real examples are given as to
when this would be a preferred approcah - in fact, the authors stress that
due to PHP's copy-on-write mechanism, it is not a frequently-used
approcah.

So my question - are there any 'classic' situations in which either should
be used, and where and when do you guys use them in your real-world
efforts?
--
http://www.web-buddha.co.uk



Re: [PHP] Variable variables and references

2007-03-10 Thread Tijnema !

On 3/10/07, Matt Carlson <[EMAIL PROTECTED]> wrote:


I've used variable variables probably 5 times in 2 years.  They are great
when you need them, but don't usually have a day-to-day use for them.

Here is some sample code of the last time I used it.


if(isset($$key))
   {
   print($$key);
   continue;
   } else {
   $iquery = "SELECT * FROM `".ROSTER_ITEMSTABLE."` WHERE
`item_name` = '".$iname."' AND `member_id` = '".$row['member_id']."'";
   $iresult = $wowdb->query($iquery);
   $idata = $wowdb->fetch_assoc($iresult);
   $item = new item($idata);
   $$key = $item->out();
   print $$key;
   }

Basically, this is in a for-each loop, that steps through a list of keys
for certain dungeons in World of Warcraft.  Instead of putting the data into
an array, I used variable variables to stick the data into a single
variable.  The way it works is  $key = 'DM'; $$key = $data;  The literal
translation for $$key is $DM once the code executes.

Hope this helps.



In this case i should use an array, i think it's easier to use an array...
Array in an array in an array :)

But ofcourse sometimes you might (think you) need it.

Tijnema

- Original Message 

From: Dave Goodchild <[EMAIL PROTECTED]>
To: PHP-General 
Sent: Saturday, March 10, 2007 5:28:57 AM
Subject: [PHP] Variable variables and references

Hi guys, I have just read 'Programming PHP' (O'Reilly) and although I
think
it's a great book, I am confused about variable variables and references -
not the mechanics, just where you would use them.

The subject of variable variables is explained but no examples are given
as
to why and where you would utilise them.

As for references, the examples given with regard to passing and returning
by reference in functions is clear, but no real examples are given as to
when this would be a preferred approcah - in fact, the authors stress that
due to PHP's copy-on-write mechanism, it is not a frequently-used
approcah.

So my question - are there any 'classic' situations in which either should
be used, and where and when do you guys use them in your real-world
efforts?
--
http://www.web-buddha.co.uk




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




Re: [PHP] Back to security

2007-03-10 Thread Tijnema !

On 3/10/07, Alain Roger <[EMAIL PROTECTED]> wrote:


Hi,

I'm continuing to work on securing my administration part of the website.
based on previous posts and reading materials, I was thinking to use the
following process :

1. user has to logon through a standard "http://"; web page
2. login and encrypted password are compared with what is stored in
database, if it is the same, the user reach point 3. if not, an error
message is displayed.
3. after successful authentication, user is redirected to https:// pages,
a
session is opened in PHP and the sessionID is stored in database with user
data.
4. sessions holds encrypted password and every time that users do an
action,
sessionID is compared with the one in DB, as session encrypted password is
compared with the one stored in DB. if everything match, action is
performed. if not sessions is ended and user is redirected to logon page.

A. do you think is enough secured like that ?



To be even more secure, do the login part also through SSL (https://)

B. i still do not understand how to be sure that user still use https (SSL

protocol) ?

for point B, my first task in PHP page, is to check if port is 443. But
i'm
not sure that it is correct.



It looks like it is correct, but maybe some silly webserver would allow
http:// over port 443.

thanks a lot for your feedback.


--
Alain

Windows XP SP2
PostgreSQL 8.1.4
Apache 2.0.58
PHP 5.1.1



Re: [PHP] Array mysteries

2007-03-11 Thread Tijnema !

On 3/11/07, Otto Wyss <[EMAIL PROTECTED]> wrote:


I want to convert weekdays with a simple function like

  $wdays = array
(0 => "Sonntag"
,1 => "Montag"
,2 => "Dienstag"
,3 => "Mittwoch"
,4 => "Donnerstag"
,5 => "Freitag"
,6 => "Samstag"
  );

  function convert_from_weekday ($weekday) {
return $wdays[$weekday];
  }

but this doesn't work while

  $wdays[$weekday];

outside of the function works correct. Has anybody an idea where's my
mistake? I'd like to use a function so I may return substrings of the
weekday.

O. Wyss



$wdays is not defined inside the function, so you can do a few things:
- Pass the $wdays inside the function:
function convert_from_weekday ($weekday,$wdays) {
   return $wdays[$weekday];
 }
$day = convert_from_weekday(0,$wdays) // $day = "Sonntag"

- You could define $wdays inside the function
function convert_from_weekday ($weekday,$wdays) {
$wdays = array
   (0 => "Sonntag"
   ,1 => "Montag"
   ,2 => "Dienstag"
   ,3 => "Mittwoch"
   ,4 => "Donnerstag"
   ,5 => "Freitag"
   ,6 => "Samstag"
 );
   return $wdays[$weekday];
 }
$day = convert_from_weekday(0) // $day = "Sonntag"
- If you are working from inside a class, you could define $wdays as a
public variable.

I think this solved your problem, but don't hesitate to ask for more!

Tijnema




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




Re: [PHP] FW: looking for two remote functions

2007-03-11 Thread Tijnema !

On 3/11/07, Myron Turner <[EMAIL PROTECTED]> wrote:


Myron Turner wrote:
> Tijnema ! wrote:
>> On 3/10/07, Németh Zoltán <[EMAIL PROTECTED]> wrote:
>>
>>> 2007. 03. 10, szombat keltezéssel 12.42-kor Riyadh S. Alshaeiq ezt
>>> írta:
>>> > Actually if right click on any file or folder on a machine you
>>> will see
>>> that
>>> > there are two values (Size on disk & Size). Files and folders are
>>> stored
>>> on
>>> > the disk in what is called clusters (a group of disk sectors).
>>> Size on
>>> disk
>>> > refers to the amount of cluster allocation a file is taking up,
>>> compared
>>> to
>>> > file size which is an actual byte count.
>>> >
>>> > As I mentioned before what I want is a function for getting the
>>> result
>>> for
>>> > the Size no for Size on Disk
>>>
>>> okay then what about this?
>>>
>>
> Th
>
> I wrote a small perl script which returns the bytes read when a file
> is read from the disk and it, too, agrees with the filesize and header
> sizes.  In Windows, the actual filesize is also returned by filesize
> and stat, not the size on disk (filesize uses stat).   Also, in the
> PHP manual, the fread example uses filesize to set the number of bytes
> to read:
>   ||
> Here's the perl script:
> use strict;
> use Fcntl;
> sysopen (FH, "index.htm", O_RDONLY);
> my $buffer;
> my $len = sysread(FH, $buffer, 8192,0);
> print $len,"\n";
>
> If you are really anxious about size you can exec out to this script
> and get the file size.
>
> --
>
Sorry the above version of the script was hard-coded for a small test
file.  Here's the general version:

# get_len.pl
use strict;
use Fcntl;
sysopen (FH, $ARGV[0], O_RDONLY) or die "\n";
my $buffer;
my $bytes_read = 0;
my $offset;
while($bytes_read = sysread(FH, $buffer, 8192, $offset)) {
$offset+=$bytes_read ;
}
print $offset,"\n";

From an exec() you'd call it with the file name:
  perl get_len.pl 
$len = exec("perl get_len.pl $filename");



I'm not very familiar with PERL, so will this work with remote files?
As it seems that you are just reading from local hard drive...

Tijnema

_

Myron Turner
http://www.room535.org
http://www.bstatzero.org
http://www.mturner.org/XML_PullParser/





Re: [PHP] Array mysteries

2007-03-11 Thread Tijnema !

On 3/11/07, tedd <[EMAIL PROTECTED]> wrote:


At 10:05 AM +0100 3/11/07, Tijnema ! wrote:
>
>- You could define $wdays inside the function
>function convert_from_weekday ($weekday) {
>$wdays = array
>(0 => "Sonntag"
>,1 => "Montag"
>,2 => "Dienstag"
>,3 => "Mittwoch"
>,4 => "Donnerstag"
>,5 => "Freitag"
>,6 => "Samstag"
>  );
>return $wdays[$weekday];
>  }
>$day = convert_from_weekday(0) // $day = "Sonntag"

Tijnema:

That's also a shorter version of a simple switch statement.

I haven't thought of, or seen, that before -- thanks.

tedd



Yeah it is, but i just used moved his $wdays inside the function...

but well, there are ofcourse a lot of other options, as date("l") would also
return the day of the month :)

Tijnema

--

---
http://sperling.com  http://ancientstones.com  http://earthstones.com



Re: [PHP] php and javascript error

2007-03-11 Thread Tijnema !

On 3/11/07, tedd <[EMAIL PROTECTED]> wrote:


At 5:28 PM +0100 3/7/07, [EMAIL PROTECTED] wrote:
>  > PS: If you want your code to validate, change the & to &  Add the
>>  closing  tag too.
>>  PPS: It's advisable not to use the short tags, use in such a cases I usually use  instead . At
>least it's shorter. :)
>
>-afan

But, while it's shorter, it's still NOT advisable to use the shorter tags.

tedd



It does save space on your harddrive (Not much, but some :P)

and if it is for your own usage only, why not?

Tijnema

--

---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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




Re: [PHP] FW: looking for two remote functions

2007-03-11 Thread Tijnema !

On 3/11/07, Myron Turner <[EMAIL PROTECTED]> wrote:



Tijnema ! wrote:
>
> I'm not very familiar with PERL, so will this work with remote files?
> As it seems that you are just reading from local hard drive...
>
> Tijnema
It has to be on the machine from which the pages are being served.



He was looking for remote functions

There have been several workable suggestions for different

possibilities.  I think it would help if you gave the context for this.
Are these pages on your own web site?   Are you downloading pages from
third-party web sites using the browser?  Are you using the command line
to download pages from other servers?

Here is a script which will get the headers for any file you can
download from the web:

\n";
} else {
   $out = "HEAD http://www.example.org/any_page.html / HTTP/1.1\r\n";
   $out .= "Host: www.example.org\r\n";
   $out .= "Connection: Close\r\n\r\n";

   fwrite($fp, $out);

   $header = "";
   while (!feof($fp)) {
   $header .=  fgets($fp, 256);
   }
   fclose($fp);
   echo $header;
}
?>

In response you will get the headers:

HTTP/1.1 200 OK
Date: Sun, 11 Mar 2007 14:57:54 GMT
Server: Apache/2.0.51 (Fedora)
Last-Modified: Sun, 11 Mar 2007 13:00:03 GMT
ETag: "10eb0036-4d1-3c2bbac0"
Accept-Ranges: bytes
Content-Length: 1233
Connection: close
Content-Type: text/plain; charset=UTF-8


This includes the content-length, which is what you want.  This script
will download only the headers.

You will not get a content-length headers for php files, since they are
in effect scripts and their length is not know in advance.  The same
holds true for files which contain SSI.



This is exactly what my script also did, get the content-length from the
header.
But i don't see what the actual problem is, there have been a lot of
solutions around here but they are all wrong?

Tijnema



_
Myron Turner
http://www.room535.org
http://www.bstatzero.org
http://www.mturner.org/XML_PullParser/

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




Re: [PHP] FW: looking for two remote functions

2007-03-11 Thread Tijnema !

Not everyone checks his email 1000 times a day, last time he replied was
yesterday... so give him some time to read his email

Tijnema


On 3/11/07, Myron Turner <[EMAIL PROTECTED]> wrote:


I think we've been talking to ourselves.  The guy with the original
question seems to have folded his hand and gone home.

> This is exactly what my script also did, get the content-length from the
> header.
> But i don't see what the actual problem is, there have been a lot of
> solutions around here but they are all wrong?
>
> Tijnema
>
--

_
Myron Turner
http://www.room535.org
http://www.bstatzero.org
http://www.mturner.org/XML_PullParser/




Re: [PHP] Why won't this query go through?

2007-03-11 Thread Tijnema !

On 3/11/07, Mike Shanley <[EMAIL PROTECTED]> wrote:


Hi,

I am just not understanding what I could have possibly done wrong with
this query. All of the variables are good, without special characters in
any sense of the word... So why isn't it importing anything?

Thanks!

$q = "INSERT INTO

`visitors`(`username`,`password`,`email`,`firstname`,`lastname`,`birthdate`,`verifythis`)
   VALUES ('".$username."',
   '".md5($password1)."',
   '".$email."',
   '".$firstname."',
   '".$lastname."',
   '".$birthdate."',
   '".$verifythis."');";
mysql_query($q);



* me is gettings crazy!!! ALWAYS USE THE MYSQL_ERROR COMMAND!
mysql_query($q);
becomes
mysql_query($q) or die(mysql_error());
then post the result of the error, or fix it by yourself when you know where
the error is.

Tijnema

--

Mike Shanley

~you are almost there~

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




Re: [PHP] My help with adding captcha

2007-03-11 Thread Tijnema !

On 3/11/07, Joker7 <[EMAIL PROTECTED]> wrote:


Hi- as you know I have been working on adding a captcha image to my
guestbook.
Well I have managed to get a very basic one working ;) but !I have been
trying to get one that would make it more easy to use ,I have it working
until I add it to my form.

My form use's print see below and I need to add this to it:



Listen To This



Did you forget to add the semi-colom??


Listen To This

Tijnema




Any tip would be welcome.
Chris

{
print "";
print "";
print "Name: ";
print "Country:";
print "Homepage";
print "E-mail:";
print "Aim:";
print "ICQ:";
print "Yahoo:";
print "MSN:";
print "Comment:";
print "";

I need to add it here!!

print "";
print "";
print "Clickable Smilies";
print "
";
print "
";
print "
";
print " ";
print " ";
print " ";
print " ";
print " ";
print " ";
print " ";
print " ";
print "";
print "";
print "";
print "";
print "";
print "";
print "\n";
print "function addSmiley(textToAdd)\n";
print "{\n";
print "document.form.comment.value += textToAdd;";
print "document.form.comment.focus();\n";
print "}\n";
print "\n";
print "";
print "BBCode instructions";
  }


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




Re: [PHP] Array mysteries

2007-03-11 Thread Tijnema !

On 3/11/07, Satyam <[EMAIL PROTECTED]> wrote:



- Original Message -
From: "Edward Vermillion" <[EMAIL PROTECTED]>
To: "tedd" <[EMAIL PROTECTED]>
Cc: "Tijnema !" <[EMAIL PROTECTED]>; 
Sent: Sunday, March 11, 2007 8:57 PM
Subject: Re: [PHP] Array mysteries


>
> On Mar 11, 2007, at 1:59 PM, tedd wrote:
>
>> At 12:02 PM -0500 3/11/07, Edward Vermillion wrote:
>>> On Mar 11, 2007, at 10:02 AM, tedd wrote:
>>>
>>>> At 3:05 PM +0100 3/11/07, Tijnema ! wrote:
>>>>> On 3/11/07, tedd <<mailto:[EMAIL PROTECTED]>[EMAIL PROTECTED]
>  wrote:
>>>>>
>>>>> At 10:05 AM +0100 3/11/07, Tijnema ! wrote:
>>>>>>
>>>>>> - You could define $wdays inside the function
>>>>>> function convert_from_weekday ($weekday) {
>>>>>> $wdays = array
>>>>>>(0 => "Sonntag"
>>>>>>    ,1 => "Montag"
>>>>>>,2 => "Dienstag"
>>>>>>,3 => "Mittwoch"
>>>>>>,4 => "Donnerstag"
>>>>>>,5 => "Freitag"
>>>>>>,6 => "Samstag"
>>>>>>  );
>>>>>>return $wdays[$weekday];
>>>>>>  }
>>>>>> $day = convert_from_weekday(0) // $day = "Sonntag"
>>>>>
>>>>> Tijnema:
>>>>>
>>>>> That's also a shorter version of a simple switch statement.
>>>>>
>>>>> I haven't thought of, or seen, that before -- thanks.
>>>>>
>>>>> tedd
>>>>>
>>>>>
>>>>> Yeah it is, but i just used moved his $wdays inside the function...
>>>>>
>>>>> but well, there are ofcourse a lot of other options, as date ("l")
>>>>> would also return the day of the month :)
>>>>>
>>>>> Tijnema
>>>>
>>>>
>>>> It's the technique and not the specific data thing I was  addressing.
>>>> When I'm confronted with a case condition, I  typically use the
switch
>>>> statement. But, your solution provided  me with another way to look
at
>>>> that.
>>>>
>>>> Cheers,
>>>>
>>>> tedd
>>>
>>> But what's the cost of this in a loop, rebuilding the array
each  time,
>>> as compared to a switch statement? Just another thought...
>>>
>>
>>
>>
>> Ed
>>
>> It's just another way to look at a possible solution.
>>
>> As for the cost, what are we talking about? I doubt that a  "typical"
>> application would show any discernable difference in  execution times.
>>
>> One could test this easy enough by running both through 50k loops,  but
>> even then I doubt that the times would be that much different  -- but I
>> may be wrong, been there before.
>>
>> Cheers,
>>
>> tedd
>
> I don't know if there would be any difference either, which is why
it  was
> a question.
>
> Although Larry's suggestion of making the array static is something I
> hadn't thought of.
>
> Overall it is an interesting concept to use an array instead of
a  switch,
> and I do wonder at what point, if any, that the two would  start to
> diverge resource-wise.
>
> Would the array lookup be faster for a lesser-used option/key in a
> situation where there were quite a few options? (you wouldn't have
to  go
> through the whole switch to get to the option at the end (?) or  would
> you? I have no idea how that all works internally)
>
Yes, you would.  It goes sequentially through each case:.  The array, on
the
other hand, uses a hashing algorithm so it should be about even no matter
which option you pick.

Satyam



PHP is always fast, as long as you are not trying to do this 50k times, does
it make sense if a function takes 0.0056 or 0.0057 seconds to
execute?
I don't think so, so that means this is all going about users preference.

Tijnema


Re: [PHP] Using array_search I get error

2007-03-12 Thread Tijnema !

On 3/12/07, Richard Kurth <[EMAIL PROTECTED]> wrote:




Richard Kurth wrote:
>
>
> -Original Message-
> From: Stut [mailto:[EMAIL PROTECTED]
> Sent: Sunday, March 11, 2007 2:53 PM
> To: Richard Kurth
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] Using array_search I get error
>
> Richard Kurth wrote:
>> This array comes from  $_REQUEST of all data submitted
>>
>> $array='Array ( [id] => 17 [takeaction] => saveCustomFields [notes]
>> =>
>> -- Feb 4, 2007 @ 9:16 PM --fdsfdsfsdfdsfsfsfds -- Feb 4, 2007 @ 9:21
>> PM --fdfdsfsdffsd -- February 11, 2007, @ 9:31 PM -- This is a tes --
>> February 14, 2007, @ 10:10 PM -- jhafjhfa afjahfajfhda
>> kasjdaksdhADSKJL [firstname] => NANCY [lastname] => ADKINS  [phone2]
>> =>
> [address1] => 25 ALWARD CT.
>> [address2] => [city] => MARTINSVILLE [State] => AK [other] => [zip]
>> =>
>> 24112 [country] => US [date18] => 03-13-2007 [text19] => test1
>> [text20] => [rating] => 0 [status] => Active )';  when I use
>> array_search to find date18
>>
>> $key = array_search('date18', $array);  // $key = 1;
>>
>> I get Wrong datatype for second argument How come the array is wrong
>> datatype isn't a array an array or am I using this wrong
>
> $array is a string, and array_search is expecting an array, so it's
correct.
> Where did you get that "array"?
>
> -Stut
>
> This array comes from  $_REQUEST of all data submitted from a form

Yeah, you said that in your first post. What I meant was where did it come
from?

What you have there is the output from print_r($_REQUEST). How exactly are
you getting that string? Why are you creating it as a literal array rather
than using $_REQUEST directly?

What you have there is the output from print_r($_REQUEST). How exactly are
you getting that string? Why are you creating it as a literal array rather
than using $_REQUEST directly?

-Stut

This is for saving data from custom fields created by the user I don't
know
what they are named so I can't use $_REQUEST[name] to pull them from the
array.
I am submitting a form to a script that will search thru the array and
find
the fields that are in there date18 text19 text20 these are user custom
fields that I do not know what they are named. I what to compare what is
in
the array  with a database table and if they match then save the
information
in the array for that item to the database.



Somehow you managed to get an array become a string..., if your are using
$_REQUEST directly, or a copy of it, then you should have an array.
I also don't really understand what you are trying to do, as 'date18' is a
key, not a value, and array_search searches vor values, in this case it
searches for the value 'date18' and then try's to get the key of that value,
but date18 is a key, so it would probably return false.

Tijnema

--

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




Re: [PHP] FW: looking for two remote functions

2007-03-12 Thread Tijnema !

Just a little note, getting content-length and a lot of other stuff from
remote files is also possbiel with curl_getinfo()

www.php.net/curl_getinfo

Tijnema


On 3/11/07, Tijnema ! <[EMAIL PROTECTED]> wrote:


Not everyone checks his email 1000 times a day, last time he replied was
yesterday... so give him some time to read his email

Tijnema


On 3/11/07, Myron Turner <[EMAIL PROTECTED]> wrote:
>
> I think we've been talking to ourselves.  The guy with the original
> question seems to have folded his hand and gone home.
>
> > This is exactly what my script also did, get the content-length from
> the
> > header.
> > But i don't see what the actual problem is, there have been a lot of
> > solutions around here but they are all wrong?
> >
> > Tijnema
> >
> --
>
> _
> Myron Turner
> http://www.room535.org
> http://www.bstatzero.org
> http://www.mturner.org/XML_PullParser/
>
>



[PHP] Limiting speed when using CURL functions

2007-03-12 Thread Tijnema !

Hi,

Is there any way i can limit the transfer speed when using CURL?

I'm uploading a file to a server, and i don't want the script to f*** up all
bandwidth.

TIA

Tijnema


Re: [PHP] Limiting speed when using CURL functions

2007-03-12 Thread Tijnema !

On 3/12/07, Martin Marques  wrote:


Tijnema ! wrote:

> Hi,
>
> Is there any way i can limit the transfer speed when using CURL?
>
> I'm uploading a file to a server, and i don't want the script to f***
> up all
> bandwidth.


man renice

P.D.: This is not a PHP question.



I'm talking about the PHP functions, i know how to do it with the command
line version of CURL, but which settings to use in curl_setopt ??

Tijnema

--

21:50:04 up 2 days,  9:07,  0 users,  load average: 0.92, 0.37, 0.18
-
Lic. Martín Marqués |   SELECT 'mmarques' ||
Centro de Telemática|   '@' || 'unl.edu.ar';
Universidad Nacional|   DBA, Programador,
   del Litoral |   Administrador
-




Re: [PHP] PHP URL issues

2007-03-12 Thread Tijnema !

On 3/12/07, Don Don <[EMAIL PROTECTED]> wrote:


I've got the following url rewriting problem.

on page 1 i've got this

  See 

and on page 2 i've got this

$messageID = $_REQUEST["messageId"];
$userID = $_REQUEST["userId"];


when i check to see the values of these variables its says its empty, but
when i place my cursor on the link in
page 1 i can see both variables being show with their values in the
browser.  But on page 2 i cant get the values
Something seems wrong perharps ?

Cheers



I don't know if it matters, but if the variables are coming from the url,
you could also retrieve them with $_GET
$messageID = $_GET["messageId"];
$userID = $_GET["userId"];

And in your link, i see it is pointing to page1.php, i don't know if that is
just a typo in the example

Tijnema

-

Now that's room service! Choose from over 150,000 hotels
in 45,000 destinations on Yahoo! Travel to find your fit.


Re: [PHP] Using array_search I get error

2007-03-12 Thread Tijnema !

On 3/12/07, Richard Kurth <[EMAIL PROTECTED]> wrote:




-Original Message-
From: Tijnema ! [mailto:[EMAIL PROTECTED]
Sent: Monday, March 12, 2007 1:16 AM
To: Richard Kurth
Cc: Stut; php-general@lists.php.net
Subject: Re: [PHP] Using array_search I get error

On 3/12/07, Richard Kurth <[EMAIL PROTECTED]> wrote:
>
>
>
> Richard Kurth wrote:
> >
> >
> > -Original Message-
> > From: Stut [mailto:[EMAIL PROTECTED]
> > Sent: Sunday, March 11, 2007 2:53 PM
> > To: Richard Kurth
> > Cc: php-general@lists.php.net
> > Subject: Re: [PHP] Using array_search I get error
> >
> > Richard Kurth wrote:
> >> This array comes from  $_REQUEST of all data submitted
> >>
> >> $array='Array ( [id] => 17 [takeaction] => saveCustomFields [notes]
> >> =>
> >> -- Feb 4, 2007 @ 9:16 PM --fdsfdsfsdfdsfsfsfds -- Feb 4, 2007 @
> >> 9:21 PM --fdfdsfsdffsd -- February 11, 2007, @ 9:31 PM -- This is a
> >> tes -- February 14, 2007, @ 10:10 PM -- jhafjhfa afjahfajfhda
> >> kasjdaksdhADSKJL [firstname] => NANCY [lastname] => ADKINS
> >> [phone2] =>
> > [address1] => 25 ALWARD CT.
> >> [address2] => [city] => MARTINSVILLE [State] => AK [other] => [zip]
> >> =>
> >> 24112 [country] => US [date18] => 03-13-2007 [text19] => test1
> >> [text20] => [rating] => 0 [status] => Active )';  when I use
> >> array_search to find date18
> >>
> >> $key = array_search('date18', $array);  // $key = 1;
> >>
> >> I get Wrong datatype for second argument How come the array is
> >> wrong datatype isn't a array an array or am I using this wrong
> >
> > $array is a string, and array_search is expecting an array, so it's
> correct.
> > Where did you get that "array"?
> >
> > -Stut
> >
> > This array comes from  $_REQUEST of all data submitted from a form
>
> Yeah, you said that in your first post. What I meant was where did it
> come from?
>
> What you have there is the output from print_r($_REQUEST). How exactly
> are you getting that string? Why are you creating it as a literal
> array rather than using $_REQUEST directly?
>
> What you have there is the output from print_r($_REQUEST). How exactly
> are you getting that string? Why are you creating it as a literal
> array rather than using $_REQUEST directly?
>
> -Stut
>
> This is for saving data from custom fields created by the user I don't
> know what they are named so I can't use $_REQUEST[name] to pull them
> from the array.
> I am submitting a form to a script that will search thru the array and
> find the fields that are in there date18 text19 text20 these are user
> custom fields that I do not know what they are named. I what to
> compare what is in the array  with a database table and if they match
> then save the information in the array for that item to the database.


Somehow you managed to get an array become a string..., if your are using
$_REQUEST directly, or a copy of it, then you should have an array.
I also don't really understand what you are trying to do, as 'date18' is a
key, not a value, and array_search searches vor values, in this case it
searches for the value 'date18' and then try's to get the key of that
value,
but date18 is a key, so it would probably return false.

Then how would I search for the Key date18 and once I find it how would I
get the value of that key. Because even if I change the date18 to it's
value
03-13-2007 I still get the error Wrong datatype for second argument. I
have
also tried print_r(array_keys($array)); and I get The first argument
should
be an array.



if you know the name of a key, then u can just retrieve the value with
$value= $array[$key]

But your $array doesn't look like an array..
try var_dump($array);

Tijnema


Re: [PHP] PHP 5.2 + IE 7 = HTTP 304 in login procedure [SOLVED]

2007-03-12 Thread Tijnema !

On 3/12/07, Doctorrock <[EMAIL PROTECTED]> wrote:


2007/3/12, Yannick Warnier <[EMAIL PROTECTED]>:
>
> The problem wasn't quite there. The 304 response was correct and didn't
> really cause a problem in IE7.
>
> In fact, the problem was somewhere else. As mentioned by someone in the
> PHP doc comments (http://be.php.net/manual/en/ref.session.php#64125 ),
> IE is the only one to reject urls of the likes of
> http://example_demo.littleweb.com/ because of the "_" character.
>
> This means that basically IE will display the site without a problem,
> but will not register any cookie, and of course will not mention it, so
> it makes it all much easier to detect. The fact that FF and Opera get a
> session each does not help at all in finding the problem.
>
> Changing the URL to http://exampledemo.littleweb.com/ will work
perfectly.
>
> Yannick


According to RFC1033 (
http://www.camtp.uni-mb.si/books/Internet-Book/DNS_NameFormat.html ),
underscores are forbidden in DNS names, including subdomains.




Yeah, meaning that the program where you created the subdomain with is not
following the RFC standards.
Some programmers have hard time following standards...


Re: [PHP] Extract url from string

2007-03-12 Thread Tijnema !

On 3/12/07, Brad Fuller <[EMAIL PROTECTED]> wrote:


Hey guys,

I've been banging my head against the wall trying to figure out the right
pattern to use to extract a URL from a string using preg_match().

I've been STFW for a while now, and all the examples that I find are for
extracting URLs from within a  tag.

Here's what I need, and I'm sure it's quite common, especially with forums
etc.; hopefully someone has a code snippet they can share.

INPUT:

This is some text http://www.example.com/page.html this is some more text.

OUTPUT:

This is some text http://www.example.com/page.html";>http://www.example.com/page.html

this is some more text.

Thx in advance,

-B



I'm not very familiar with PCRE, but you should search for a pattern
starting with http: and ends with a space.

Tijnema

--

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




Re: [PHP] Redirecting in a PHP script

2007-03-12 Thread Tijnema !

On 3/12/07, Larry Bradley <[EMAIL PROTECTED]> wrote:


I need to "goto"  different PHP pages in my web site depending on what
happens within some PHP code.

For example, if the user is not logged in when he goes to a page, I want
to
send him to a LOGIN page.

I've have everything working fine, using the following Javascript code:
$location = 'login.php';
echo "\n";
echo "document.location.href = '" . $location . "';\n";
echo "\n";

I also played around with using the header("location: ...") function.

I understand that the header() function must be issued before any HMTL is
output.

But I'm not sure about the Javascript code. In every instance in my code,
I
use the Javascript before any HTML - this type of action normally occurs
in
PHP code called via a form POST.

I presume that the Javascript code really does the same as the PHP stuff,
and thus must obey the same rules, but I'm not sure.
Comments?

Larry Bradley
Orleans (Ottawa), Ontario, CANADA



There's a difference in them, as the php header function defines the
redirect in the header, meaning that all body is not even parsed. And it
works also if javascript is disabled.
I prefer the header function, but if you already have data parsed, the
javascript could to the job, but even then it needs to be inside the 
tags i believe, or else it won't get automatically executed.

Tijnema


Re: [PHP] dst and strtotime

2007-03-12 Thread Tijnema !

On 3/12/07, Jake McHenry <[EMAIL PROTECTED]> wrote:


Anyone know of anything I can check? I've been trying different things all
afternoon and I'm still getting the wrong date from strtotime. date()
works
fine.

Thanks,
Jake

- Original Message -
From: "Jake McHenry" <[EMAIL PROTECTED]>
To: "PHP-General" 
Sent: Monday, March 12, 2007 12:26 PM
Subject: Re: [PHP] dst and strtotime


> yepper
>
> date
> Mon Mar 12 12:25:33 EDT 2007



Is this from PHP or from bash?
Sometimes those differ...

Tijnema



>
> - Original Message -
> From: "Peter Lauri" <[EMAIL PROTECTED]>
> To: "'Jake McHenry'" <[EMAIL PROTECTED]>; "'PHP-General'"
> 
> Sent: Monday, March 12, 2007 5:23 PM
> Subject: RE: [PHP] dst and strtotime
>
>
>> Is your system time correct?
>>
>> Best regards,
>> Peter Lauri
>>
>> www.dwsasia.com - company web site
>> www.lauri.se - personal web site
>> www.carbonfree.org.uk - become Carbon Free
>>
>>
>>
>>
>>> -Original Message-
>>> From: Jake McHenry [mailto:[EMAIL PROTECTED]
>>> Sent: Monday, March 12, 2007 6:10 PM
>>> To: PHP-General
>>> Subject: [PHP] dst and strtotime
>>>
>>> Hi everyone,
>>>
>>> I was hoping a problem like this wouldn't arise, but it happened :(
>>>
>>> After the dst updates on my fedora box, this broke, and worked fine
>>> before..
>>> now gives me 3/10 instead of 3/11 for strtotime("last sunday")
>>> anyone
>>> know why? 3/10 was saturday!
>>>
>>>
>>>
>>> $recent_period = strtotime('last sunday');
>>> echo date("Y-m-d", $recent_period);
>>> print_r($periods);
>>> $test_recent_period = array_search($recent_period, $periods);
>>> if ($test_recent_period == '')
>>>   $recent_period = strtotime('last sunday', $recent_period);
>>>
>>>
>>>
>>>
>>>
>>> Thanks,
>>> Jake
>>>
>>> --
>>> 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




Re: [PHP] My help with adding captcha

2007-03-12 Thread Tijnema !

On 3/12/07, Joker7 <[EMAIL PROTECTED]> wrote:


In news: [EMAIL PROTECTED],
Chris  said:
>> Joker7 wrote:
>>> Hi- as you know I have been working on adding a captcha image to my
>>> guestbook.
>>> Well I have managed to get a very basic one working ;) but !I have
>>> been trying to get one that would make it more easy to use ,I have
>>> it working until I add it to my form.
>>>
>>> My form use's print see below and I need to add this to it:
>>>
>>>
>>> 
>>> Listen To This
>>
>> And what happens when you try?
>>
>> There's nothing in that snippet that shows an error (missing a
>> semi-colon won't stop it printing as Tijnema suggested).
>>
>>
>> --
>> Postgresql & php tutorials
>> http://www.designmagick.com/

When it "prints" it will print   http://site.com/
 and not the link formate
as
below.




I hope I have made my self clear.
Chris



I don't understand it completly i think, but you are printing PHP code.
I think you are printing it now like so:
echo '
Listen To This';
then you should change it to
echo '
Listen To This';

Tijnema




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




Re: [PHP] FW: looking for two remote functions

2007-03-13 Thread Tijnema !

Can you maybe explain why you want the exact size on the disk in blocks??
do you care if it differs 1KB?? what are you planning to write, the actual
filesize on the disk can only differ 1 block with real filesize, and so if
the blocksize is 1024bytes, it differes a max of 1024bytes...

And btw, the size it takes on your server in blocks might be different then
the size it takes on the server's disk...

I'm not totally sure how a hdd works, but i know it is split up in blocks,
and so you need to know the blocksize on the partition you are going to
place the file, using different filesystems on 1 system can mean that a file
is bigger/smaller on the same system.

So the way to calculate the block filesize would be by getting the real
filesize, and then round it until $filesize%$blocksize == 0

So, in PHP code it would like this.
$blocksize = 1024; // Default on Ext2/3 i believe
$filesize = filesize("http://server.com/file.rar";);
while($filesize%$blocksize != 0)
{
$filesize += 1;
}

I'm not sure if it's the size you were looking for, but keep in mind that it
depends on the block size. So different filesystems use different block
size.

Tijnema




On 3/13/07, Richard Lynch <[EMAIL PROTECTED]> wrote:


If PHP is returning that goofy Windows 'size on disk' number, I want
to see your script...

Because, no, I don't think it does that...

On Sat, March 10, 2007 4:42 am, Riyadh S. Alshaeiq wrote:
> Actually if right click on any file or folder on a machine you will
> see that
> there are two values (Size on disk & Size). Files and folders are
> stored on
> the disk in what is called clusters (a group of disk sectors). Size on
> disk
> refers to the amount of cluster allocation a file is taking up,
> compared to
> file size which is an actual byte count.
>
> As I mentioned before what I want is a function for getting the result
> for
> the Size no for Size on Disk
>
> Riyadh
>
> -Original Message-
> From: Németh Zolt?n [mailto:[EMAIL PROTECTED]
> Sent: 10/Mar/2007 12:27 PM
> To: Riyadh S. Alshaeiq
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] FW: looking for two remote functions
>
> I'm afraid I don't understand what you want. The size of a file is its
> size in bytes, that is its size on the disk. So what else?
>
> greets
> Zolt?n Németh
>
> 2007. 03. 10, szombat keltezéssel 06.07-kor Riyadh S. Alshaeiq ezt
> ?rta:
>> Thank you Mickey, but I have already looked in there and the
>> function
> posted
>> in the notes is working just fine for getting the size on disk which
>> I am
>> not interested in..
>>
>> Riyadh
>>
>> -Original Message-
>> From: Mikey [mailto:[EMAIL PROTECTED]
>> Sent: 9/Mar/2007 2:57 PM
>> To: php-general@lists.php.net
>> Subject: Re: looking for two remote functions
>>
>> Riyadh S. Alshaeiq wrote:
>> > Hello everybody,
>> >
>> >  I am looking for an HTTP function for getting remote filesizes.
>> Keeping
>> in
>> > mind that I am NOT interested in getting the "size on disk"
>> figure, I
> need
>> > the actual size of the files when downloaded to a local machine.
>> Please
>> let
>> > me know if there are any..
>> >
>> > Another thing, I also need a remote function that gets the created
>> date
>> and
>> > last modified separately, if possible..
>> >
>> > Best regards
>> >
>> >
>> >
>> >
>>
>> Try looking here:
>>
>> http://uk.php.net/manual/en/function.filesize.php
>>
>> If the function itself isn't of use to you, look further down in the
>> notes and I am sure you will find something useful.
>>
>> Mikey
>>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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




Re: [PHP] dst and strtotime

2007-03-13 Thread Tijnema !

does return the time() command the right date for you?

Tijnema


On 3/13/07, Jake McHenry <[EMAIL PROTECTED]> wrote:


A little more info:

strtotime("last monday")  or yesterday, is correct, but
strtotime("last
sunday") gives me 3/10 (saturday), strtotime("last saturday") gives me 3/9
(Friday), "last friday" gives me 3/8 thursday.. etc. maybe it will go
away after a week??


> anyone else have anything to add?
>
> thanks,
> Jake
>
>
>>
>>
>>> On 3/12/07, Jake McHenry <[EMAIL PROTECTED]> wrote:
>>>>
>>>> Anyone know of anything I can check? I've been trying different
things
>>>> all
>>>> afternoon and I'm still getting the wrong date from strtotime. date()
>>>> works
>>>> fine.
>>>>
>>>> Thanks,
>>>> Jake
>>>>
>>>> - Original Message -
>>>> From: "Jake McHenry" <[EMAIL PROTECTED]>
>>>> To: "PHP-General" 
>>>> Sent: Monday, March 12, 2007 12:26 PM
>>>> Subject: Re: [PHP] dst and strtotime
>>>>
>>>>
>>>> > yepper
>>>> >
>>>> > date
>>>> > Mon Mar 12 12:25:33 EDT 2007
>>>
>>>
>>> Is this from PHP or from bash?
>>> Sometimes those differ...
>>
>>
>>
>> 2007-03-12 17:34:22
>> 2007-03-12 17:34:22
>>
>>
>> > echo `date "+%Y-%m-%d %H:%M:%S"`;
>> echo date("Y-m-d H:i:s");
>> ?>
>>
>>
>>
>>>
>>> Tijnema
>>>
>>>>
>>>> >
>>>> > - Original Message -
>>>> > From: "Peter Lauri" <[EMAIL PROTECTED]>
>>>> > To: "'Jake McHenry'" <[EMAIL PROTECTED]>; "'PHP-General'"
>>>> > 
>>>> > Sent: Monday, March 12, 2007 5:23 PM
>>>> > Subject: RE: [PHP] dst and strtotime
>>>> >
>>>> >
>>>> >> Is your system time correct?
>>>> >>
>>>> >> Best regards,
>>>> >> Peter Lauri
>>>> >>
>>>> >> www.dwsasia.com - company web site
>>>> >> www.lauri.se - personal web site
>>>> >> www.carbonfree.org.uk - become Carbon Free
>>>> >>
>>>> >>
>>>> >>
>>>> >>
>>>> >>> -Original Message-
>>>> >>> From: Jake McHenry [mailto:[EMAIL PROTECTED]
>>>> >>> Sent: Monday, March 12, 2007 6:10 PM
>>>> >>> To: PHP-General
>>>> >>> Subject: [PHP] dst and strtotime
>>>> >>>
>>>> >>> Hi everyone,
>>>> >>>
>>>> >>> I was hoping a problem like this wouldn't arise, but it happened
:(
>>>> >>>
>>>> >>> After the dst updates on my fedora box, this broke, and worked
fine
>>>> >>> before..
>>>> >>> now gives me 3/10 instead of 3/11 for strtotime("last
sunday")
>>>> >>> anyone
>>>> >>> know why? 3/10 was saturday!
>>>> >>>
>>>> >>>
>>>> >>>
>>>> >>> $recent_period = strtotime('last sunday');
>>>> >>> echo date("Y-m-d", $recent_period);
>>>> >>> print_r($periods);
>>>> >>> $test_recent_period = array_search($recent_period, $periods);
>>>> >>> if ($test_recent_period == '')
>>>> >>>   $recent_period = strtotime('last sunday', $recent_period);
>>>> >>>
>>>> >>>
>>>> >>>
>>>> >>>
>>>> >>>
>>>> >>> Thanks,
>>>> >>> Jake
>>>> >>>
>>>> >>> --
>>>> >>> 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 General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
> --
> fedora-list mailing list
> [EMAIL PROTECTED]
> To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
>

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




Re: [PHP] dst and strtotime

2007-03-13 Thread Tijnema !

On 3/13/07, Jake McHenry <[EMAIL PROTECTED]> wrote:



>> -Original Message-
>> From: Jake McHenry [mailto:[EMAIL PROTECTED]
>> Sent: Tuesday, March 13, 2007 11:22 AM
>> To: For users of Fedora; PHP-General
>> Subject: Re: [PHP] dst and strtotime
>>
>> A little more info:
>>
>> strtotime("last monday")  or yesterday, is correct, but
>> strtotime("last
>> sunday") gives me 3/10 (saturday), strtotime("last saturday") gives me
>> 3/9
>> (Friday), "last friday" gives me 3/8 thursday.. etc. maybe it will go
>> away after a week??
>>
>
>
> What is the output of the below?
>
> echo date("Y-m-d g:i A T", time());
> echo date("Y-m-d g:i A T", strtotime("last sunday"));


2007-03-13 12:30 PM EDT
2007-03-10 11:00 PM EST


Hmm, EST and EDT ?
There's the problem i think, as it is 11PM, making it 12PM it means next day.
You could fix this with adding 24*60*60 to the result of strtotime() ,
or change it somehow ...

So this would give you the right date:
echo date("Y-m-d g:i A T", strtotime("last sunday") * 24*60*60);


Tijnema

Tijnema

--
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] dst and strtotime

2007-03-13 Thread Tijnema !

On 3/13/07, Robert Cummings <[EMAIL PROTECTED]> wrote:

On Tue, 2007-03-13 at 12:31 -0400, Jake McHenry wrote:
>
> >> -Original Message-
> >> From: Jake McHenry [mailto:[EMAIL PROTECTED]
> >> Sent: Tuesday, March 13, 2007 11:22 AM
> >> To: For users of Fedora; PHP-General
> >> Subject: Re: [PHP] dst and strtotime
> >>
> >> A little more info:
> >>
> >> strtotime("last monday")  or yesterday, is correct, but
> >> strtotime("last
> >> sunday") gives me 3/10 (saturday), strtotime("last saturday") gives me
> >> 3/9
> >> (Friday), "last friday" gives me 3/8 thursday.. etc. maybe it will go
> >> away after a week??
> >>
> >
> >
> > What is the output of the below?
> >
> > echo date("Y-m-d g:i A T", time());
> > echo date("Y-m-d g:i A T", strtotime("last sunday"));
>
>
> 2007-03-13 12:30 PM EDT
> 2007-03-10 11:00 PM EST

Funny stuff... I get the same under Ubuntu 6.10 with php 4.4.4 (manual
build).

Cheers,
Rob.

I live in The Netherlands, using CET, and the output is fine.

2007-03-13 5:49 PM CET
2007-03-11 12:00 AM CET

So the EDT/EST must cause the problem.

Tijnema

--
..
| 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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] dst and strtotime

2007-03-13 Thread Tijnema !

On 3/13/07, Jake McHenry <[EMAIL PROTECTED]> wrote:

Has or can anyone try this on PHP5 to see if it does the same? I'll upgrade
if needed, but didn't really want to at the current time..


Thanks
Jake

As i said before i don't think it has to do with PHP version, but with
your timezone setting.
Here the result is good, but i think that's because i'm in the
netherlands, but i AM using PHP 5.

Tijnema



> On Tue, 2007-03-13 at 12:31 -0400, Jake McHenry wrote:
>>
>> >> -Original Message-
>> >> From: Jake McHenry [mailto:[EMAIL PROTECTED]
>> >> Sent: Tuesday, March 13, 2007 11:22 AM
>> >> To: For users of Fedora; PHP-General
>> >> Subject: Re: [PHP] dst and strtotime
>> >>
>> >> A little more info:
>> >>
>> >> strtotime("last monday")  or yesterday, is correct, but
>> >> strtotime("last
>> >> sunday") gives me 3/10 (saturday), strtotime("last saturday") gives me
>> >> 3/9
>> >> (Friday), "last friday" gives me 3/8 thursday.. etc. maybe it will
>> >> go
>> >> away after a week??
>> >>
>> >
>> >
>> > What is the output of the below?
>> >
>> > echo date("Y-m-d g:i A T", time());
>> > echo date("Y-m-d g:i A T", strtotime("last sunday"));
>>
>>
>> 2007-03-13 12:30 PM EDT
>> 2007-03-10 11:00 PM EST
>
> Funny stuff... I get the same under Ubuntu 6.10 with php 4.4.4 (manual
> build).
>
> Cheers,
> Rob.
> --
> ..
> | 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 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] PHP URL issues

2007-03-13 Thread Tijnema !

On 3/13/07, Steve <[EMAIL PROTECTED]> wrote:


Instead of trying to call specific $_GET values, try printing out the
entire
$_GET variable.

echo '';
print_r($_GET);
echo '';

Anything else there?



I wanted to say that:P You can check if the data is really sended to the
second page by printing the whole $_GET array.
If it does, you could also see how they are named in the $_GET array. What i
also would recommend is to remove all captial letters, as they are very
confusing. But that is up to you.

Tijnema

"Don Don" <[EMAIL PROTECTED]> wrote in message

news:[EMAIL PROTECTED]
> $query_string = 'testId='. urlencode(trim($tmpTestId)) . '&userId=' .
> urlencode(trim($tmpUserId));
> print ' View
> Values ';
>
>  on view page i am trying to display the values using $_GET[value] and
it
> sill returns ""
>
> Satyam <[EMAIL PROTECTED]> wrote:
>  You should use urlencode() on variables that will go into URL
arguments.
> You might have a whitespace in any of those variables and the URL stops
at
> the first whitespace. If those spaces are at the ends and are not
> significant, you might want to use trim().
>
>
>
>
> - Original Message -
> From: "Don Don"
>
> To: "PHP List"
>
> Sent: Tuesday, March 13, 2007 11:37 AM
> Subject: Re: [PHP] PHP URL issues
>
>
>>
>> I've just noticed that if am passing only one value it works fine, but
>> when am passing in more than one none works.
>>
>> Why is that or what could be wrong ?
>>
>> e.g. this works
>> echo "$letter_value
>>  "; on test.php i can display the value of term but with this
>>
>> echo "> href='test.php
?term=$letter_value&type=$type_value'>$letter_value
>>  "; on test.php the values are empty.
>>
>> Nikola Stjelja wrote:
>> If you are going to insert variables like $var_name in a string you
need
>> to enclose that string with double qoutations marks, not single. PHP
will
>> replace var names with values only inside double qoutations.
>>
>> Hope that helps
>>
>> On 3/12/07, Don Don
> wrote: I've got the following
>> url rewriting problem.
>>
>> on page 1 i've got this
>>
>>   See
>
>>
>> and on page 2 i've got this
>>
>> $messageID = $_REQUEST["messageId"];
>> $userID = $_REQUEST["userId"];
>>
>>
>> when i check to see the values of these variables its says its empty,
but
>> when i place my cursor on the link in
>> page 1 i can see both variables being show with their values in the
>> browser. But on page 2 i cant get the values
>> Something seems wrong perharps ?
>>
>> Cheers
>>
>>
>> -
>> Now that's room service! Choose from over 150,000 hotels
>> in 45,000 destinations on Yahoo! Travel to find your fit.
>>
>>
>>
>> --
>> Please visit this site and play my RPG!
>>
>> http://www.1km1kt.net/rpg/Marinci.php
>>
>>
>>
>>
>> -
>> Don't get soaked. Take a quick peek at the forecast
>> with theYahoo! Search weather shortcut.
>
>
>

>
>
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.446 / Virus Database: 268.18.10/720 - Release Date:
> 12/03/2007
> 19:19
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
> -
> We won't tell. Get more on shows you hate to love
> (and love to hate): Yahoo! TV's Guilty Pleasures list.

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




Re: [PHP] dst and strtotime

2007-03-13 Thread Tijnema !

On 3/13/07, Robert Cummings <[EMAIL PROTECTED]> wrote:

On Tue, 2007-03-13 at 17:50 +0100, Tijnema ! wrote:
> On 3/13/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
> > On Tue, 2007-03-13 at 12:31 -0400, Jake McHenry wrote:
> > >
> > > >> -Original Message-
> > > >> From: Jake McHenry [mailto:[EMAIL PROTECTED]
> > > >> Sent: Tuesday, March 13, 2007 11:22 AM
> > > >> To: For users of Fedora; PHP-General
> > > >> Subject: Re: [PHP] dst and strtotime
> > > >>
> > > >> A little more info:
> > > >>
> > > >> strtotime("last monday")  or yesterday, is correct, but
> > > >> strtotime("last
> > > >> sunday") gives me 3/10 (saturday), strtotime("last saturday") gives me
> > > >> 3/9
> > > >> (Friday), "last friday" gives me 3/8 thursday.. etc. maybe it will 
go
> > > >> away after a week??
> > > >>
> > > >
> > > >
> > > > What is the output of the below?
> > > >
> > > > echo date("Y-m-d g:i A T", time());
> > > > echo date("Y-m-d g:i A T", strtotime("last sunday"));
> > >
> > >
> > > 2007-03-13 12:30 PM EDT
> > > 2007-03-10 11:00 PM EST
> >
> > Funny stuff... I get the same under Ubuntu 6.10 with php 4.4.4 (manual
> > build).
> >
> > Cheers,
> > Rob.
> I live in The Netherlands, using CET, and the output is fine.
>
> 2007-03-13 5:49 PM CET
> 2007-03-11 12:00 AM CET
>
> So the EDT/EST must cause the problem.

I have my doubts that incorrect output is the cause. It's more likely
the result. I'm ion the process of building PHP 4.4.6 to see if it has
the same problem.

Cheers,
Rob.

It is not a PHP problem, i just checked it on a server running
PHP4.4.4 in GMT timezone, output:
2007-03-13 4:55 PM GMT
2007-03-11 12:00 AM GMT

All working fine.

I see i made a mistake in my fix, i multiplied the value of strototime
with 24*60*60, i meant to add, so it would become
echo date("Y-m-d g:i A T", strtotime("last sunday") + 24*60*60);



--
..
| 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] dst and strtotime

2007-03-13 Thread Tijnema !

On 3/13/07, Tijnema ! <[EMAIL PROTECTED]> wrote:

On 3/13/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
> On Tue, 2007-03-13 at 17:50 +0100, Tijnema ! wrote:
> > On 3/13/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
> > > On Tue, 2007-03-13 at 12:31 -0400, Jake McHenry wrote:
> > > >
> > > > >> -Original Message-
> > > > >> From: Jake McHenry [mailto:[EMAIL PROTECTED]
> > > > >> Sent: Tuesday, March 13, 2007 11:22 AM
> > > > >> To: For users of Fedora; PHP-General
> > > > >> Subject: Re: [PHP] dst and strtotime
> > > > >>
> > > > >> A little more info:
> > > > >>
> > > > >> strtotime("last monday")  or yesterday, is correct, but
> > > > >> strtotime("last
> > > > >> sunday") gives me 3/10 (saturday), strtotime("last saturday") gives 
me
> > > > >> 3/9
> > > > >> (Friday), "last friday" gives me 3/8 thursday.. etc. maybe it 
will go
> > > > >> away after a week??
> > > > >>
> > > > >
> > > > >
> > > > > What is the output of the below?
> > > > >
> > > > > echo date("Y-m-d g:i A T", time());
> > > > > echo date("Y-m-d g:i A T", strtotime("last sunday"));
> > > >
> > > >
> > > > 2007-03-13 12:30 PM EDT
> > > > 2007-03-10 11:00 PM EST
> > >
> > > Funny stuff... I get the same under Ubuntu 6.10 with php 4.4.4 (manual
> > > build).
> > >
> > > Cheers,
> > > Rob.
> > I live in The Netherlands, using CET, and the output is fine.
> >
> > 2007-03-13 5:49 PM CET
> > 2007-03-11 12:00 AM CET
> >
> > So the EDT/EST must cause the problem.
>
> I have my doubts that incorrect output is the cause. It's more likely
> the result. I'm ion the process of building PHP 4.4.6 to see if it has
> the same problem.
>
> Cheers,
> Rob.
It is not a PHP problem, i just checked it on a server running
PHP4.4.4 in GMT timezone, output:
2007-03-13 4:55 PM GMT
2007-03-11 12:00 AM GMT

All working fine.

I see i made a mistake in my fix, i multiplied the value of strototime
with 24*60*60, i meant to add, so it would become
echo date("Y-m-d g:i A T", strtotime("last sunday") + 24*60*60);

still wrong lol,
really the good way to use it is:
echo date("Y-m-d g:i A T", strtotime("last sunday") + 60*60);

tijnema



> --
> ..
> | 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] dst and strtotime

2007-03-13 Thread Tijnema !

On 3/13/07, Tijnema ! <[EMAIL PROTECTED]> wrote:

On 3/13/07, Tijnema ! <[EMAIL PROTECTED]> wrote:
> On 3/13/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
> > On Tue, 2007-03-13 at 17:50 +0100, Tijnema ! wrote:
> > > On 3/13/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
> > > > On Tue, 2007-03-13 at 12:31 -0400, Jake McHenry wrote:
> > > > >
> > > > > >> -Original Message-
> > > > > >> From: Jake McHenry [mailto:[EMAIL PROTECTED]
> > > > > >> Sent: Tuesday, March 13, 2007 11:22 AM
> > > > > >> To: For users of Fedora; PHP-General
> > > > > >> Subject: Re: [PHP] dst and strtotime
> > > > > >>
> > > > > >> A little more info:
> > > > > >>
> > > > > >> strtotime("last monday")  or yesterday, is correct, but
> > > > > >> strtotime("last
> > > > > >> sunday") gives me 3/10 (saturday), strtotime("last saturday") 
gives me
> > > > > >> 3/9
> > > > > >> (Friday), "last friday" gives me 3/8 thursday.. etc. maybe it 
will go
> > > > > >> away after a week??
> > > > > >>
> > > > > >
> > > > > >
> > > > > > What is the output of the below?
> > > > > >
> > > > > > echo date("Y-m-d g:i A T", time());
> > > > > > echo date("Y-m-d g:i A T", strtotime("last sunday"));
> > > > >
> > > > >
> > > > > 2007-03-13 12:30 PM EDT
> > > > > 2007-03-10 11:00 PM EST
> > > >
> > > > Funny stuff... I get the same under Ubuntu 6.10 with php 4.4.4 (manual
> > > > build).
> > > >
> > > > Cheers,
> > > > Rob.
> > > I live in The Netherlands, using CET, and the output is fine.
> > >
> > > 2007-03-13 5:49 PM CET
> > > 2007-03-11 12:00 AM CET
> > >
> > > So the EDT/EST must cause the problem.
> >
> > I have my doubts that incorrect output is the cause. It's more likely
> > the result. I'm ion the process of building PHP 4.4.6 to see if it has
> > the same problem.
> >
> > Cheers,
> > Rob.
> It is not a PHP problem, i just checked it on a server running
> PHP4.4.4 in GMT timezone, output:
> 2007-03-13 4:55 PM GMT
> 2007-03-11 12:00 AM GMT
>
> All working fine.
>
> I see i made a mistake in my fix, i multiplied the value of strototime
> with 24*60*60, i meant to add, so it would become
> echo date("Y-m-d g:i A T", strtotime("last sunday") + 24*60*60);
still wrong lol,
really the good way to use it is:
echo date("Y-m-d g:i A T", strtotime("last sunday") + 60*60);

tijnema


Which returns fine on my PHP4 server in USA:
2007-03-13 1:02 PM EDT
2007-03-11 12:00 AM EST

Tijnema

>
>
> > --
> > ..
> > | 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] variables in CSS in PHP question/problems

2007-03-13 Thread Tijnema !

On 3/13/07, Bruce Gilbert <[EMAIL PROTECTED]> wrote:

I stumbled upon this article http://www.chrisjdavis.org/2005/10/16/php-in-css/

and was trying out variables with PGP, but can't get it to work. I
wanted to have a variable image that changes on refresh, and also set
the body color with PHP/CSS and maybe get that to change on refresh
too.

sp from the tutorial mentioned above I have:

[php]
*snip*
[/php]

*snip*

in my directory, I have a folder called images which is at the root
level with the index file and css, and the images are called
side_image1, side_image2, side_image3 etc.

can anyone see whay this isn't working? Neither the background body
color or the rotating image works.

thanks

--
::Bruce::


*I did not read your full email, sry...
But i think you are not right using PHP in this case, or atleast not
in this way.
There are 2 ways to solve this quite easy
1) use javascript to randomly select a image from a predefined array.
example:



var theImages = new Array()

theImages[0] = 'images/001.png'
theImages[1] = 'images/002.png'
theImages[2] = 'images/003.png'
theImages[3] = 'images/004.png'
theImages[4] = 'images/005.png'
theImages[5] = 'images/006.png'
theImages[6] = 'images/007.png'
theImages[7] = 'images/008.png'
theImages[8] = 'images/009.png'
theImages[9] = 'images/010.png'
theImages[10] = 'images/011.png'
theImages[11] = 'images/012.png'
theImages[12] = 'images/013.png'
theImages[13] = 'images/014.png'
theImages[14] = 'images/015.png'
theImages[15] = 'images/016.png'
theImages[16] = 'images/017.png'
theImages[17] = 'images/018.png'
theImages[18] = 'images/019.png'
theImages[19] = 'images/020.png'
theImages[20] = 'images/021.png'
theImages[21] = 'images/022.png'
theImages[22]= 'images/023.png'
theImages[23] = 'images/024.png'
theImages[24] = 'images/025.png'
theImages[25] = 'images/026.png'

var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
  preBuffer[i] = new Image()
  preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img src="'+theImages[whichImage]+'">');
}


2) or you could generate the images with PHP
so you would call your image with http://server.com/myimage.php";> (or maybe from CSS.
and your myimage.php would contain something like


And that should do the same

Tijnema

ps. I've written both codes out of my head, i didn't test so there
might be typo's...

$

--
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] dst and strtotime

2007-03-13 Thread Tijnema !

On 3/13/07, Robert Cummings <[EMAIL PROTECTED]> wrote:

On Tue, 2007-03-13 at 13:02 -0400, Robert Cummings wrote:
>
> Well that's strange since PHP4 and 5 both use the same ini file on my
> dev box. And so they both get the following ini setting:
>
> date.timezone="Canada/Eastern"
>
> And in php 4.4.4 I get the bad output, but in php 5.2.0 I get the good
> output.

FWIW PHP 4.4.6 has the same issue on my box. PHP5 does not, but PHP 5
also outputs the EST/EDT switch.

   PHP 4.4.6:

   2007-03-13 1:38 PM EDT
   2007-03-10 11:00 PM EST

   PHP 5.2.0:

   2007-03-13 1:38 PM EDT
   2007-03-11 12:00 AM EST

Cheers,
Rob.


As long as you are only interested in the day, there's no problem with
adding an extra hour to the strtotime() command, it would work on PHP4
and PHP5.

Tijnema

--
..
| 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] displaying image from MySQL DB using HTML/PHP

2007-03-13 Thread Tijnema !

On 3/13/07, Bruce Gilbert <[EMAIL PROTECTED]> wrote:

I am having some difficulty getting an image to display on a php that
I have added to MySQL DB.

Here is what I have tried so far

in the MySQL DB I have a table called image_holder and the fields are
id,mimename,filecontents...filecontents field is set to a type of blob
using PHPMyAdmin and I have uploaded the image in MySQL.

In the PHP code I have:

[php]
 


So you just need to set the content-type and output
add this to the bottom of the script:
header("Content-Type: ".$encodeddata);
echo $title;

If i understand you right.

Tijnema



and in the HTML code



I am probably way off base, so need some help!


--
::Bruce::

--
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] mail

2007-03-13 Thread Tijnema !

On 3/13/07, Dani Dws <[EMAIL PROTECTED]> wrote:

I just want to know if the mail function works from a localhost (local
server)?

I've checked my php.ini all the setting are right but the mail function is
not sending any mail, any idea?

best regards.


Sometimes ISP is blocking port 25, if so, you are not able to run a
mailserver, and you won't be able to send any email from PHP, for this
you should check out your ISP website, or contact the support desk of
your ISP.

_
Solve the Conspiracy and win fantastic prizes.
http://www.theconspiracygame.co.uk/

--
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] displaying image from MySQL DB using HTML/PHP

2007-03-13 Thread Tijnema !

On 3/13/07, Bruce Gilbert <[EMAIL PROTECTED]> wrote:

On 3/13/07, Tijnema ! <[EMAIL PROTECTED]> wrote:
> So you just need to set the content-type and output
> add this to the bottom of the script:
> header("Content-Type: ".$encodeddata);
> echo $title;
>
> If i understand you right.
>
> Tijnema
>
> >
Thanks,

I changed the code around some and now have:
[php]

[/php]

and in the HTML


but I am getting a MySQL error
"Error performing query: 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 '' at line 1"

--
::Bruce::

You changed your html code, you have id=1, and in your PHP code you
are requesting img, so change

to


But i must also say, it is NOT safe to input data from ?img= directly
into your database, someone could do a SQL injection right away with
this code!.

Then about this piece of code
while ( $row = @mysql_fetch_array($result) )
{
$imgid = $row["id"];
header("Content-Type: ".$encodeddata);
echo $title;
}
I hope for you that there's only one item with this id, if not, there
would come an error again, so a while loop is not needed, and second,
now you don't define $encodeddata and $title anymore, try this piece
of code instead of the one above:

$row = @mysql_fetch_array($result);
header("Content-Type: ".row['mimetype']);
echo $row['filecontents'];

ps. Reply to the full PHP list, not just me...

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



Re: [PHP] Redirecting in a PHP script

2007-03-13 Thread Tijnema !

On 3/13/07, Chris Shiflett <[EMAIL PROTECTED]> wrote:

Robert Cummings wrote:
> I've found clicking really fast can get you back :)

I, too, have successfully used this technique. :-)

Chris

Did you guys ever noted that little arrow down just right of the back
button, where you can go back 2 steps at once, so you don't have to
click very fast??

Tijnema


--
Chris Shiflett
http://shiflett.org/

--
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] 2 errors I can not understand

2007-03-13 Thread Tijnema !

On 3/13/07, Jonathan Kahan <[EMAIL PROTECTED]> wrote:

Hi all,

Please see my output  below followed by the code. I have been trying for
some to figure out why

1) I can not get a line feed to work in the web page that i am using to
display the output as I am not running from the commad line

Line feed in a browser is made with the HTML tag br
instead of printint "\r\n" you should try ""


2) Why my loop is only executing 3 times when i want it to execute 50

I don't see any error in that loop, on my test server it is executing
50 times...


Any help would be greatly appreciated.

Jonathan

The next line is all that displays on the output html page:

Output: The number 0 is 0 The number 1 is 0 The number 2 is 1 The number 3
is 1

php script:







"tjon2.php" 78L, 447C written

--
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] PHP Printer

2007-03-14 Thread Tijnema !

On 3/14/07, raaj sharma <[EMAIL PROTECTED]> wrote:

Sir,
I am trying to use printer functions in my script.pls. help me. The printer is 
working fine with other documents of ms-word etc.
pls. help me

Thanx
Raaj

The code is:



You should define which printer to open, or remove the ""


printer_write($handle, "Text to print");
printer_close($handle);
?>

It is giving errors like :

Warning: printer_open() [function.printer-open]: couldn't connect to the
printer [] in C:\apachefriends\xampp\htdocs\Project\Seekitall\printer.php
on line 2

Warning: printer_write(): supplied argument is
not a valid Printer Handle resource in
C:\apachefriends\xampp\htdocs\Project\Seekitall\printer.php on line
4

Warning: printer_close(): supplied argument is not a
valid Printer Handle resource in
C:\apachefriends\xampp\htdocs\Project\Seekitall\printer.php on line
5










Food fight? Enjoy some healthy debate
in the Yahoo! Answers Food & Drink Q&A.
http://answers.yahoo.com/dir/?link=list&sid=396545367


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



Re: [PHP] Redirecting in a PHP script

2007-03-14 Thread Tijnema !

On 3/14/07, Chris Shiflett <[EMAIL PROTECTED]> wrote:

Tijnema wrote:
> Did you guys ever noted that little arrow down just right of
> the back button, where you can go back 2 steps at once, so you
> don't have to click very fast?

I think we both remember browsing before that feature was invented.

Chris


How long ago is that? Was it before i came to earth? ... LOL
It was in Win95 right?

I never worked on Win3.x so maybe it was there :)

Tijnema


--
Chris Shiflett
http://shiflett.org/



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



Re: [PHP] PHP Printer

2007-03-14 Thread Tijnema !

On 3/14/07, raaj sharma <[EMAIL PROTECTED]> wrote:


$handle = printer_open();

again it is giving same errors.

i am trying it on localhost.
Is it needed to make any changes in php.ini. if so how it will work on the
server.

Thanx
Raaj

You have not set a default printer in php.ini, and php can't find one.
You could set the default printer in php.ini, or enter it inside the
printer_open function
look at the manual page, www.php.net/printer_open

Tijnema

ps. Include the PHP list(php-general@lists.php.net) in your CC when
replying to this list.








- Original Message 
From: Tijnema ! <[EMAIL PROTECTED]>
To: raaj sharma <[EMAIL PROTECTED]>
Cc: php-general@lists.php.net
Sent: Wednesday, March 14, 2007 2:04:12 PM
Subject: Re: [PHP] PHP Printer

On 3/14/07, raaj sharma <[EMAIL PROTECTED]> wrote:
> Sir,
> I am trying to use printer functions in my script.pls. help me. The
printer is working fine with other documents of ms-word etc.
> pls. help me
>
> Thanx
> Raaj
>
> The code is:
>
>  $handle = printer_open("");

You should define which printer to open, or remove the ""

> printer_write($handle, "Text to print");
> printer_close($handle);
> ?>
>
> It is giving errors like :
>
> Warning: printer_open() [function.printer-open]: couldn't connect to the
> printer [] in
C:\apachefriends\xampp\htdocs\Project\Seekitall\printer.php
> on line 2
>
> Warning: printer_write(): supplied argument is
> not a valid Printer Handle resource in
>
C:\apachefriends\xampp\htdocs\Project\Seekitall\printer.php
on line
> 4
>
> Warning: printer_close(): supplied argument is not a
> valid Printer Handle resource in
>
C:\apachefriends\xampp\htdocs\Project\Seekitall\printer.php
on line
> 5
>
>
>
>
>
>
>
>
>
>

> Food fight? Enjoy some healthy debate
> in the Yahoo! Answers Food & Drink Q&A.
> http://answers.yahoo.com/dir/?link=list&sid=396545367



TV dinner still cooling?
Check out "Tonight's Picks" on Yahoo! TV.


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



Re: [PHP] PLS HELP ME

2007-03-14 Thread Tijnema !

On 3/14/07, raaj sharma <[EMAIL PROTECTED]> wrote:

Sir,
I am trying to use printer functions in my script.pls. help me. The printer is 
working fine with other documents of ms-word etc.

i am trying it on localhost.
Is it needed to make any changes in php.ini. if so how it will work on the 
server.

pls. help me

Thanx
Raaj

The code is:



It is giving errors like :
Warning:  printer_open() [function.printer-open]: couldn't connect to the 
printer [HP PSC 1400series] in 
C:\apachefriends\xampp\htdocs\Project\Seekitall\printer.php on line 2


It just means that your printer is NOT named HP PSC 1400series, find
out what the real name of the device is!




Warning:  printer_write(): supplied argument is not a valid Printer Handle 
resource in C:\apachefriends\xampp\htdocs\Project\Seekitall\printer.php on line 
4



Warning:  printer_close(): supplied argument is not a valid Printer Handle 
resource in C:\apachefriends\xampp\htdocs\Project\Seekitall\printer.php on line 
5





These errors are because first command failed...




Never miss an email again!
Yahoo! Toolbar alerts you the instant new Mail arrives.
http://tools.search.yahoo.com/toolbar/features/mail/


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



Re: [PHP] Limiting speed when using CURL functions

2007-03-14 Thread Tijnema !

On 3/12/07, Richard Lynch <[EMAIL PROTECTED]> wrote:

On Mon, March 12, 2007 7:14 am, Tijnema ! wrote:
> Is there any way i can limit the transfer speed when using CURL?
>
> I'm uploading a file to a server, and i don't want the script to f***
> up all
> bandwidth.

I don't recall ever seeing that in curl, but check on the curl site,
linked from here:
http://php.net/curl

It's not on there, but i also contacted the CURL list, and they told
me that libcurl (7.16) accepts the constants
CURLOPT_MAX_SEND_SPEED_LARGE and CURLOPT_MAX_RECV_SPEED_LARGE, having
the integer value of 145 and 146. In PHP those constants have not been
defined (I check CVS, and it isn't there in PHP6). But even when using
the integer values of those constants, it does not work. On the CURL
list they can't help me really because they think it is a PHP problem.

Tijnema

ps. Installing PHP6 snapshot now to see if it differs.


--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?




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



Re: [PHP] 2 errors I can not understand

2007-03-14 Thread Tijnema !

On 3/14/07, Myron Turner <[EMAIL PROTECTED]> wrote:

Richard Lynch wrote:
> On Tue, March 13, 2007 6:04 pm, Jonathan Kahan wrote:
>
>> This did fix the problem but I am amazed that
>>
>> $s%$d=0 would be interpereted as a statement assigning d to 0 since
>> there is
>> some other stuff in front of d... I would think that would produce an
>> error
>> at compile time since $s%$d is an illegal variable name. Normally when
>> my
>> php script errors at compile time nothing will display to the screen.
>>
>
> You still have not correctly puzzled out what $s % $d = 0 is doing...
>
> The = operator takes precedence, and $d is set to 0.
>
But why?  According to the manual, the modulus operator has precedence
over the equals!  So shouldn't this expression  resolve to:
  ($s % $d) = 0
which gives an error?

Might it be that it generates only an error in specific error levels?

Tijnema


--

_
Myron Turner
http://www.room535.org
http://www.bstatzero.org
http://www.mturner.org/XML_PullParser/

--
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] dst and strtotime

2007-03-14 Thread Tijnema !

On 3/14/07, Jake McHenry <[EMAIL PROTECTED]> wrote:

> He meant  + 24 * 60 * 60 not * 24 * 60 * 60
>
> The idea is to ADD the number of seconds in one day to shift your time
> over by one day, not to multiply the time by the number of seconds in
> one day, which is just plain ridiculously high number beyond the scale
> of Unix time stamp.
>
> I would recommend checking the OS for recent DST related patches, and
> figuring out why one function thinks your computer us in EST but the
> other one thinks your computer is in EDT, because adding a day is just
> a band-aid, not medicine.
>


I agree, already said this but the dst update seems fine on the system,
and its kinda hard to mess up. And it only needs an hour to kick it back
into the right date I found.

time() and date() return correctly, its just strtotime that pulls from EST
instead of EDT for some reason

Quite strange, but it is fixed in PHP5, so nothing to worry about i think.
If you don't want to upgrade, you can use the fix i provided, It
doesn't harm. Also you might be able to set the timezone to something
outside a EST/EDT region. (like the netherlands (CET))
but of course when doing that, time and date wouldn't return the right values...

Tijnema




> On Tue, March 13, 2007 11:52 am, Jake McHenry wrote:
>>> On 3/13/07, Jake McHenry <[EMAIL PROTECTED]> wrote:
>>>>
>>>>
>>>> >> -Original Message-
>>>> >> From: Jake McHenry [mailto:[EMAIL PROTECTED]
>>>> >> Sent: Tuesday, March 13, 2007 11:22 AM
>>>> >> To: For users of Fedora; PHP-General
>>>> >> Subject: Re: [PHP] dst and strtotime
>>>> >>
>>>> >> A little more info:
>>>> >>
>>>> >> strtotime("last monday")  or yesterday, is correct, but
>>>> >> strtotime("last
>>>> >> sunday") gives me 3/10 (saturday), strtotime("last saturday")
>>>> gives me
>>>> >> 3/9
>>>> >> (Friday), "last friday" gives me 3/8 thursday.. etc. maybe
>>>> it will
>>>> >> go
>>>> >> away after a week??
>>>> >>
>>>> >
>>>> >
>>>> > What is the output of the below?
>>>> >
>>>> > echo date("Y-m-d g:i A T", time());
>>>> > echo date("Y-m-d g:i A T", strtotime("last sunday"));
>>>>
>>>>
>>>> 2007-03-13 12:30 PM EDT
>>>> 2007-03-10 11:00 PM EST
>>>>
>>> Hmm, EST and EDT ?
>>> There's the problem i think, as it is 11PM, making it 12PM it means
>>> next
>>> day.
>>> You could fix this with adding 24*60*60 to the result of strtotime()
>>> ,
>>> or change it somehow ...
>>>
>>> So this would give you the right date:
>>> echo date("Y-m-d g:i A T", strtotime("last sunday") * 24*60*60);
>>>
>>>
>>> Tijnema
>>>
>>
>>
>> That gives me this:
>>
>>
>> 1903-11-13 2:32 AM EST
>>
>>
>> Thanks,
>> Jake
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
>
> --
> Some people have a "gift" link here.
> Know what I want?
> I want you to buy a CD from some starving artist.
> http://cdbaby.com/browse/from/lynch
> Yeah, I get a buck. So?
>

--
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] "cannot load mysql extension" - PHP Installation on Vista/Apache

2007-03-14 Thread Tijnema !

On 3/14/07, Rahul Sitaram Johari <[EMAIL PROTECTED]> wrote:

Ave,

I recently configured & Installed PHP on my Windows Vista PC, running Apache
2.2 Web Server. MySQL 5 was also installed.

Apache is running fine ­ mySQL is running fine ­ PHP is running fine.
The problem is, I¹m getting this error when I try to run a PHP page which
needs to connect to the mySQL Server:

'cannot load mysql extension, please check PHP Configuration'.

I¹ve installed PHP on XP computers hundreds of times, so I¹m not exactly a
newbie to this, but I¹m not sure if it¹s Vista causing the problem or I¹m
doing something wrong.

In my PHP.INI, I have the modules/extensions directory set to ³C:\php\ext²
which contains all my modules (including the mySQL DLL and others). I also
uncommented the mySQL Extension load from the PHP.INI file. I just can¹t
figure out what the problem is.

Do I need to copy the DLL files somewhere else in the system to make this
work? Anyone else has this problem?

Thanks.


First of all i would NOT recommend for using Vista as a server, but of
course that's your own choice. I think the problem you are facing has
to do something with administrator rights, but i'm not sure..
In Vista a lot of security has been added, and so a non priviliged
user cannot do a lot of things. Apache/Mysql are running from
unprivilged user i think, and they probabky have problems accessing
files due to the new security in vista.
I don't know a lot of Apache/PHP/MySQL on Windows, as i'm using a
Linux server. But you could, for testing only, run PHP/Apache from the
administrator account.
I believe the DLL is in the right place, i don't see why you should move it.

Tijnema


~~~
Rahul Sitaram Johari
CEO, Twenty Four Seventy Nine Inc.

W: http://www.rahulsjohari.com
E: [EMAIL PROTECTED]

³I morti non sono piu soli ... The dead are no longer lonely²




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



Re: [PHP] Environment variables...

2007-03-14 Thread Tijnema !

On 3/14/07, David BERCOT <[EMAIL PROTECTED]> wrote:

Hi,

I'd like to read an environment variable with PHP.
I've tried with :
   exec ('echo $CONTEXTE_D_EXECUTION',$result);
$result is empty !!!

I've put the variable in /etc/environment, in /etc/profile,
in /etc/bash.bashrc but nothing worked...

Do you have any idea ?

If it is not possible, I suppose I can put a variable in php.ini ?

Thank you very much.

David.

PHP is running from apache, which is running probably from the nobody
user. This user hasn't loaded any variables i think.
So, why are you not just reading /etc/profile from php?

Tijnema





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



Re: [PHP] Referring URL Authentication

2007-03-14 Thread Tijnema !

On 3/14/07, Matthew Vickery <[EMAIL PROTECTED]> wrote:

The situation is as follows:
I wish to protect the entire Website http://www.example.com from
direct URL access. i.e. if someone enters http://www.example.com into
their browser they get a message stating that they are not authorised
to access the site.  The only way to access http://www.example.com
should be to log into a second site http://www.intranet.com and follow
a link from within to http://www.example.com.

The problem:
I initially thought I should use the predefined PHP variable
$_SERVER['HTTP_REFERER'], but the PHP website explains that this
"cannot really be trusted"
(http://uk2.php.net/manual/en/reserved.variables.php).

Next I thought about HTTP authentication.  If I password protect the
the Website using .htaccess and .htpasswd as follows:
Code:

AuthName "Login to access the Website"
AuthType Basic
AuthUserFile /var/www/vhosts/example.com/httpdocs/.htpasswd
Require user username


Then my link within http://www.intranet.com could simply be:
Code:

http://username:[EMAIL PROTECTED]">Link to example.com


However this doesn't seem secure.  The username and password are
visible to anyone who views the source of the page with the link.
Also as these are not encrypted is it not possible for them to be
intercepted?

I could of course write my own authentication code on
http://www.example.com and pass a variable via a GET or POST from
http://www.intranet.com, which would cause a login and a cookie to be
set there.  But this is basically the same as above and still seems
insecure!

Is there a better/standard way to do this kind of thing?

Any help will be most appreciated,

Matthew


I don't know about a standard way of doing this, and the biggest part
of this problem is on the users side, the side that you cannot change
with a PHP code.

AFAIK browsers as IE, FireFox and Mozilla just set the referer header
fine, but some other silly browsers might not, and thereby might not
be able to access your protected site. Also, this is quite easy to
hack, as some browsers even support defining what referer to use.

But i see you really care that a user is authenticated, so a login
system is recommended. .htaccess files would do the job sometimes, but
not always, so i think you'd be better off using cookies/sessions.

Tijnema


--
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: [!! SPAM] [PHP] Parse

2007-03-14 Thread Tijnema !

On 3/14/07, Andrei <[EMAIL PROTECTED]> wrote:

al phillips wrote:
> I keep getting a parse error line x
>   when trying view php info()
>   Can you help please?
>
>
> -
> Be a PS3 game guru.
> Get your game face on with the latest PS3 news and previews at Yahoo! Games.
> .
>
>
Or maybe you should try with phpinfo() ?

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



Looks like a simple typo :)

if it isn't a typo, post the part of the code you are executing
phpinfo() and of course post a copy of the error

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



Re: [PHP] PHP Printer

2007-03-14 Thread Tijnema !

On 3/14/07, Jim Lucas <[EMAIL PROTECTED]> wrote:

raaj sharma wrote:
> Sir,
> I am trying to use printer functions in my script.pls. help me. The printer 
is working fine with other documents of ms-word etc.
> pls. help me
>
> Thanx
> Raaj
>
> The code is:
>
>  $handle = printer_open("");
> printer_write($handle, "Text to print");
> printer_close($handle);
> ?>
>
> It is giving errors like :
>
> Warning: printer_open() [function.printer-open]: couldn't connect to the
> printer [] in C:\apachefriends\xampp\htdocs\Project\Seekitall\printer.php
> on line 2
>
> Warning: printer_write(): supplied argument is
> not a valid Printer Handle resource in
> C:\apachefriends\xampp\htdocs\Project\Seekitall\printer.php on line
> 4
>
> Warning: printer_close(): supplied argument is not a
> valid Printer Handle resource in
> C:\apachefriends\xampp\htdocs\Project\Seekitall\printer.php on line
> 5
>
>
>
>
>
>
>
>
>
> 

> Food fight? Enjoy some healthy debate
> in the Yahoo! Answers Food & Drink Q&A.
> http://answers.yahoo.com/dir/?link=list&sid=396545367
You do realize this is going to print to a printer connected to the
server, not the client right?

--
Enjoy,

Jim Lucas


Quite smart question... people always try to combine server side code
(PHP) with client side..

Tijnema


Different eyes see different things. Different hearts beat on different
strings. But there are times for you and me when all such things agree.

- Rush

--
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] PHP Printer

2007-03-14 Thread Tijnema !

On 3/14/07, Jim Lucas <[EMAIL PROTECTED]> wrote:

Tijnema ! wrote:
> On 3/14/07, Jim Lucas <[EMAIL PROTECTED]> wrote:
>> raaj sharma wrote:
>> > Sir,
>> > I am trying to use printer functions in my script.pls. help me. The
>> printer is working fine with other documents of ms-word etc.
>> > pls. help me
>> >
>> > Thanx
>> > Raaj
>> >
>> > The code is:
>> >
>> > > > $handle = printer_open("");
>> > printer_write($handle, "Text to print");
>> > printer_close($handle);
>> > ?>
>> >
>> > It is giving errors like :
>> >
>> > Warning: printer_open() [function.printer-open]: couldn't connect to
>> the
>> > printer [] in
>> C:\apachefriends\xampp\htdocs\Project\Seekitall\printer.php
>> > on line 2
>> >
>> > Warning: printer_write(): supplied argument is
>> > not a valid Printer Handle resource in
>> > C:\apachefriends\xampp\htdocs\Project\Seekitall\printer.php on line
>> > 4
>> >
>> > Warning: printer_close(): supplied argument is not a
>> > valid Printer Handle resource in
>> > C:\apachefriends\xampp\htdocs\Project\Seekitall\printer.php on line
>> > 5
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> 
____
>>
>> > Food fight? Enjoy some healthy debate
>> > in the Yahoo! Answers Food & Drink Q&A.
>> > http://answers.yahoo.com/dir/?link=list&sid=396545367
>> You do realize this is going to print to a printer connected to the
>> server, not the client right?
>>
>> --
>> Enjoy,
>>
>> Jim Lucas
>
> Quite smart question... people always try to combine server side code
> (PHP) with client side..
>
> Tijnema
>>
>> Different eyes see different things. Different hearts beat on different
>> strings. But there are times for you and me when all such things agree.
>>
>> - Rush
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
goes along with the question of "How do I open a new window with PHP?"

Isn't going to happen!... :)

--
Enjoy,

Jim Lucas

And a lot of other questions, like "How do I make a file browser in
PHP?", "How do I update the page once a second with PHP?"

If you can do that, i wanna see :)

Tijnema


Different eyes see different things. Different hearts beat on different
strings. But there are times for you and me when all such things agree.

- Rush






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



Re: [PHP] $_POST array order

2007-03-14 Thread Tijnema !

On 3/14/07, Tim <[EMAIL PROTECTED]> wrote:

Hi,

Quick question regarding $_POST array element order, first the situation:

I am submitting a form with x first fields and the post value returns the
last element as being the submit button name and value

Is it safe to consider that the last element in the $_POST array will ALWAYS
be the submit element (it is always last in form)?

I would like to array_pop($_POST) to get rid of that last element for
various reasons (validation scheme) later on..

Regards,

Tim

No, it isn't always the latest element, they are stored in the way the
were submit, and browsers like IE do this in order they are placed on
the page.
for example this form:




would return a $_POST array like this:
Array
(
   [submit] => Go!
   [go] => test
)
And so is submit the first element in the array and not the last one.

Tijnema


--
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



  1   2   3   4   5   6   7   8   >