RE: [PHP] html editor written in PHP

2005-05-19 Thread Murray @ PlanetThoughtful
 Has anyone seen an example of a HTML editor written in PHP (no JS)?
 You know the ones - for adding HTML tags to a text field, etc.
 
 Thanks!

You've already received a number of responses indicating that it's not
possible to have a pure PHP browser enabled HTML editor, mainly due to the
fact that the editing itself takes place on the client (which requires a
client-side language, such as JavaScript), while PHP is only run at the
server.

One lateral solution, however, would be using something like the PHP ports
of either the Markdown or Textile classes to provide HTML markup using a
simpler syntax.

Using Markdown as an example, you would type:

_This sentence will be displayed with emphasis_

When you next retrieve this content and pass it through the Markdown class,
it automatically becomes:

emThis sentence will be displayed with emphasis/em

The differences between the two classes is that Textile is more featured,
but in my personal opinion less intuitive, while Markdown is obviously less
featured, but easier to use 'without thinking about it' as you go about
generating content. [1]

Both of these classes are used extensively to provide content markup in
blogging systems such as MovableType and WordPress, etc. There may be
similar classes out there (another one is BBCode, which is popular on forum
applications such as Invision PowerBoard).

PHP Markdown: http://www.michelf.com/projects/php-markdown/

PHP Textile: http://jimandlissa.com/project/textilephp

Hope this helps,

Murray

[1] Note: which one you might use would depend on how comfortable you are
with their applicable syntaxes and how varied your markup needs are.

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



Re: [PHP] Class function calling another function in class

2005-05-19 Thread Chris
You keep on appending $this-str to itself. Comments are inline.
Charles Kline wrote:
Hi all,
Not sure if I am doing this right and I can't figure it out, was  
hoping someone here can help.

I have an organization table in mySQL. Pretty standard. My first  
function getDepts() is working as I intend and returning the tree  
just as I like it. The new piece I added in there that is not working  
now is the call to getPositions() within the first function. What I  
am trying to do is once I get a Department, I want to loop through  
the Positions table and get the positions that are under that  
Department. This code goes haywire and loops for ever printing a huge  
list to the screen. Eventually I need to return this data not to the  
screen but into an array. Anyone see what I might have wrong in my  
logic?

I have a class and it contains these two functions.
function getDepts ( $parent = 0, $level = 1 ) {
$sql = 'SELECT BudgetedOrganization.* ';
$sql .= 'FROM BudgetedOrganization ';
$sql .= 'WHERE BudgetedOrganization.boSuperiorOrgID = ' .  
$parent;

$rs = $this-retrieveData($sql);
if ($rs)
{
while($row = mysql_fetch_array($rs)){
$num = 1;
while ($num = $level) {
$this-str .= \t;
$num++;
}
$this-str .= $row['boOrgID'] . ,  . $row 
['boOrgName'] . \n;

   // just added this and it ain't working
$this-str .= $this-getPositions($row['boOrgID']);
here you are appending the result of ::getPostions() to -str
$this-getDepts($row['boOrgID'],$level+1);
}
}
return($this-str);
}
function getPositions ( $org = 0 ) {
$sql = 'SELECT BudgetedPosition.* ';
$sql .= 'FROM BudgetedPosition ';
$sql .= 'WHERE BudgetedPosition.bp_boOrgID = ' . $org;
//echo $sql;
$rs = $this-retrieveData($sql);
if ($rs)
{
while($row = mysql_fetch_array($rs)){
$this-str .=  -  . $row['bpPositionID'] . \n;
appending the row to -str
}
}
return($this-str);
from getPositions you are returning -str , so getPositions is appending 
each row to -str , then returning -str , which is then being appended 
to -str

}
Later
$depts = $org-getDepts();
echo pre . $depts . /pre;
Thanks,
Charles
I'd say just don't append what ::getPositions() is returning.. and 
remove the return call if it makes sense to do so.

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


Re: [PHP] multiple inserts into a db

2005-05-19 Thread Richard Lynch
On Wed, May 18, 2005 9:47 pm, mayo said:
 $ses_basket_items  is the total number of items
 $orderID = the orderID which these items are a part of
 $ses_basket_id = is the itemID number

Which item ID number?

Cuz, like, you've got FOUR different itemID numbers.

Something isn't making sense here...

 for ($i=0;$i$ses_basket_items;$i++){

 $query = INSERT INTO orderedItems (orderID,itemID) VALUES
 ('$orderID','$ses_basket_id');

echo $query, hr /\n;

You probably have an ARRAY of itemID numbers.  You need to get each itemID
number out of that array and get it into your query.

 mysql_query($query) or die('Error, insert query failed');

 }

 mysql_close($conn);

You really do need to re-read the PHP Manual section about arrays and what
they are and how they work...

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] array_diff odities

2005-05-19 Thread Richard Lynch
On Wed, May 18, 2005 8:03 pm, Pablo Gosse said:
 Howdy folks.  I'm running into something strange with array_diff that
 I'm hoping someone can shed some light on.

If you are running PHP 4.0.4, the manual states that the function was
broken...

 I have two tab-delimited text files, and need to find the lines in the
 first that are not in the second, and vice-versa.

 There are 794 records in the first, and 724 in the second.

 Simple enough, I thought.  The following code should work:

 $tmpOriginalGradList = file('/path/to/graduate_list_original.txt');
 $tmpNewGradList = file('/path/to/graduate_list_new.txt');

 $diff1 = array_diff($tmpOriginalGradList, $tmpNewGradList);
 $diff2 = array_diff($tmpNewGradList, $tmpOriginalGradList);

 I expected that this would set $diff1 to have all elements of
 $tmpOriginalGradList that did not exist in $tmpNewGradList, but it
 actually contains many elements that exist in both.

Exactly what all is *IN* the records?

Phone numbers, addresses, email addresses, birthdates...

Most of which can change from year to year, and then the two records will
not print out the same, eh?

 The same is true for $diff2, in that many of its elements exist in both
 $tmpOriginalGradList and $tmpNewGradList as well.

Give us example data.

We really can't do much without data.

What are the first 10 lines of each file (change their names or whatever)

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Class function calling another function in class

2005-05-19 Thread Richard Lynch
On Wed, May 18, 2005 5:04 pm, Charles Kline said:
 I have an organization table in mySQL. Pretty standard. My first
 function getDepts() is working as I intend and returning the tree
 just as I like it. The new piece I added in there that is not working
 now is the call to getPositions() within the first function. What I
 am trying to do is once I get a Department, I want to loop through
 the Positions table and get the positions that are under that
 Department. This code goes haywire and loops for ever printing a huge
 list to the screen. Eventually I need to return this data not to the
 screen but into an array. Anyone see what I might have wrong in my
 logic?

What is in the huge list?...

Actually...

If your organization and/or its budget positions is at all large, this is
an incredibly inefficient way to do it.

You're hammering your database with query after query, and you are using
PHP to do all the iteration and ordering.

SQL was *designed* to handle large amounts of data efficiently.

You would be better served with something not unlike:

$query = select boOrgId, boOrgName, bpPositionID ;
$query .=  from BudgetedOrganization, BudgetedPosition ;
$query .=  where BudgetedOrganization.boOrgID =
BudgetedPosition.bp_boOrgID ;
$query .=  order by boSuperiorOrgID ;
$rs = $this-retrieveData($query);
if ($rs){
  while ($row = mysql_fetch_array($rs)){
//Store $row in your array or whatever you want to do with it.
  }
}

 I have a class and it contains these two functions.

  function getDepts ( $parent = 0, $level = 1 ) {
  $sql = 'SELECT BudgetedOrganization.* ';
  $sql .= 'FROM BudgetedOrganization ';
  $sql .= 'WHERE BudgetedOrganization.boSuperiorOrgID = ' .
 $parent;

  $rs = $this-retrieveData($sql);
  if ($rs)
  {
  while($row = mysql_fetch_array($rs)){
  $num = 1;

  while ($num = $level) {
  $this-str .= \t;
  $num++;
  }
  $this-str .= $row['boOrgID'] . ,  . $row
 ['boOrgName'] . \n;

 // just added this and it ain't working
  $this-str .= $this-getPositions($row['boOrgID']);
  $this-getDepts($row['boOrgID'],$level+1);
  }
  }
  return($this-str);
  }

  function getPositions ( $org = 0 ) {
  $sql = 'SELECT BudgetedPosition.* ';
  $sql .= 'FROM BudgetedPosition ';
  $sql .= 'WHERE BudgetedPosition.bp_boOrgID = ' . $org;
  //echo $sql;
  $rs = $this-retrieveData($sql);
  if ($rs)
  {
  while($row = mysql_fetch_array($rs)){
  $this-str .=  -  . $row['bpPositionID'] . \n;
  }
  }
  return($this-str);
  }


 Later

 $depts = $org-getDepts();
 echo pre . $depts . /pre;


 Thanks,
 Charles

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




-- 
Like Music?
http://l-i-e.com/artists.htm

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



RE: [PHP] Re: novice: char to varchar

2005-05-19 Thread Kim Madsen
 -Original Message-
 From: tony yau [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, May 18, 2005 9:03 PM

 found the answer sorry about this

But You don´t wanna share the solution with the rest of the class?

--
Med venlig hilsen / best regards
ComX Networks A/S
Kim Madsen
Systemudvikler/Systemdeveloper

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



RE: [PHP] html editor written in PHP

2005-05-19 Thread Warren Vail
 PHP is server side.  

I know this is conventional wisdom, but your answer ignores the fine
work being done with PHP-GTK.

In this case the PHP executes on the client machine (although not
imbedded in a browser), as an application.  However I don't know of any
Editors that work with PHP-GTK, stay tuned, however.

http://gtk.php.net/

Warren Vail

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



Re: [PHP] Responses in my email.

2005-05-19 Thread Rasmus Lerdorf
Rob Agar wrote:
 
From: Rory Browne 
This is primarly a mailing list. Not a news group. The whole idea of a
mailing list is that you get every message mailed to you.
 
 
 uh, I think the OP is complaining about the emails that *don't* go via
 the list, because this list is set up so that hitting reply goes to the
 poster, not the list.  Thought I'd stick my oar in because remembering
 to hit reply-to-all gets on my nerves too..

Which won't change.  Check the archives, we have been over this several
times.  We error on the side of safety and correctness here.

-Rasmus

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



[PHP] Problem With System Call

2005-05-19 Thread Michael Stearne
I am having the strangest problem using system() or exec() or any
variation.  None of them work on the Fedora Core 3 system that was
just loaded.  The PHP is Version 4.3.9 with Apache 2.0.52, the default
installation for Fedora Core 3.  Everything in PHP works as expected
except when trying a system call.  If I run :

?
system(/bin/ls /tmp);
?
  
on my OS X (Apache/1.3.33 (Darwin) PHP/4.3.4) this returns the desired
results, a listing of the tmp directory.  On the Fedora box I get
nothing, a blank page.  There is content in the /tmp directory on the
Fedora box.

Please help!

Michael

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



[PHP] problem with multiple fields

2005-05-19 Thread Vinss
sorry for my poor english, i'll try to be understood
 so i want to represent an informatic parc but have a problem
 for example a pc can have 2 or more memory slot filled how to stock 
the different id in a list in my database and how extract it
for the moment i just have an external key referencing one memory.
 Have you an idea to help me please?


RE: [PHP] Class function calling another function in class

2005-05-19 Thread Mark Rees
You might find this interesting if you are working with hierarchies in
SQL

http://www.intelligententerprise.com/001020/celko.jhtml?_requestid=72430
3

-Original Message-
From: Richard Lynch [mailto:[EMAIL PROTECTED] 
Sent: 19 May 2005 07:35
To: Charles Kline
Cc: php-general@lists.php.net
Subject: Re: [PHP] Class function calling another function in class


On Wed, May 18, 2005 5:04 pm, Charles Kline said:
 I have an organization table in mySQL. Pretty standard. My first 
 function getDepts() is working as I intend and returning the tree just

 as I like it. The new piece I added in there that is not working now 
 is the call to getPositions() within the first function. What I am 
 trying to do is once I get a Department, I want to loop through the 
 Positions table and get the positions that are under that Department. 
 This code goes haywire and loops for ever printing a huge list to the 
 screen. Eventually I need to return this data not to the screen but 
 into an array. Anyone see what I might have wrong in my logic?

What is in the huge list?...

Actually...

If your organization and/or its budget positions is at all large, this
is an incredibly inefficient way to do it.

You're hammering your database with query after query, and you are using
PHP to do all the iteration and ordering.

SQL was *designed* to handle large amounts of data efficiently.

You would be better served with something not unlike:

$query = select boOrgId, boOrgName, bpPositionID ;
$query .=  from BudgetedOrganization, BudgetedPosition ; $query .= 
where BudgetedOrganization.boOrgID = BudgetedPosition.bp_boOrgID ;
$query .=  order by boSuperiorOrgID ; $rs =
$this-retrieveData($query); if ($rs){
  while ($row = mysql_fetch_array($rs)){
//Store $row in your array or whatever you want to do with it.
  }
}

 I have a class and it contains these two functions.

  function getDepts ( $parent = 0, $level = 1 ) {
  $sql = 'SELECT BudgetedOrganization.* ';
  $sql .= 'FROM BudgetedOrganization ';
  $sql .= 'WHERE BudgetedOrganization.boSuperiorOrgID = ' . 
 $parent;

  $rs = $this-retrieveData($sql);
  if ($rs)
  {
  while($row = mysql_fetch_array($rs)){
  $num = 1;

  while ($num = $level) {
  $this-str .= \t;
  $num++;
  }
  $this-str .= $row['boOrgID'] . ,  . $row 
 ['boOrgName'] . \n;

 // just added this and it ain't working
  $this-str .= $this-getPositions($row['boOrgID']);
  $this-getDepts($row['boOrgID'],$level+1);
  }
  }
  return($this-str);
  }

  function getPositions ( $org = 0 ) {
  $sql = 'SELECT BudgetedPosition.* ';
  $sql .= 'FROM BudgetedPosition ';
  $sql .= 'WHERE BudgetedPosition.bp_boOrgID = ' . $org;
  //echo $sql;
  $rs = $this-retrieveData($sql);
  if ($rs)
  {
  while($row = mysql_fetch_array($rs)){
  $this-str .=  -  . $row['bpPositionID'] . \n;
  }
  }
  return($this-str);
  }


 Later

 $depts = $org-getDepts();
 echo pre . $depts . /pre;


 Thanks,
 Charles

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




-- 
Like Music?
http://l-i-e.com/artists.htm

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

Gamma Global : Suppliers of HPCompaq, IBM, Acer, EPI, APC, Cyclades, D-Link, 
Cisco, Sun Microsystems, 3Com

GAMMA GLOBAL (UK) LTD IS A RECOGNISED 'INVESTOR IN PEOPLE' AND AN 'ISO 9001 
2000' REGISTERED COMPANY

**

CONFIDENTIALITY NOTICE:

This Email is confidential and may also be privileged. If you are not the
intended recipient, please notify the sender IMMEDIATELY; you should not
copy the email or use it for any purpose or disclose its contents to any
other person.

GENERAL STATEMENT:

Any statements made, or intentions expressed in this communication may not
necessarily reflect the view of Gamma Global (UK) Ltd. Be advised that no 
content
herein may be held binding upon Gamma Global (UK) Ltd or any associated company
unless confirmed by the issuance of a formal contractual document or
Purchase Order,  subject to our Terms and Conditions available from 
http://www.gammaglobal.com

EOE

**
**


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



RE: [PHP] Problem With System Call

2005-05-19 Thread Kim Madsen
 -Original Message-
 From: Michael Stearne [mailto:[EMAIL PROTECTED]
 Sent: Thursday, May 19, 2005 9:10 AM

 I am having the strangest problem using system() or exec() or any
 variation.  None of them work on the Fedora Core 3 system that was
 just loaded.  The PHP is Version 4.3.9 with Apache 2.0.52, the default
 installation for Fedora Core 3.  Everything in PHP works as expected
 except when trying a system call.  If I run :
 
 ?
 system(/bin/ls /tmp);
 ?
 
 on my OS X (Apache/1.3.33 (Darwin) PHP/4.3.4) this returns the desired
 results, a listing of the tmp directory.  On the Fedora box I get
 nothing, a blank page.  There is content in the /tmp directory on the
 Fedora box.

Are You perhaps running SElinux?

--
Med venlig hilsen / best regards
ComX Networks A/S
Kim Madsen
Systemudvikler/Systemdeveloper

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



Re: [PHP] problem with multiple fields

2005-05-19 Thread Tom Rogers
Hi,

Thursday, May 19, 2005, 6:07:53 PM, you wrote:
V sorry for my poor english, i'll try to be understood
V  so i want to represent an informatic parc but have a problem
V  for example a pc can have 2 or more memory slot filled how to stock
V the different id in a list in my database and how extract it
V for the moment i just have an external key referencing one memory.
V  Have you an idea to help me please?

It is probably best to put the individual items in a separate table
and link their keys, as an example with 3 tables

table items
itemid
name

table item_list
pcid
itemid

table pc
pcid
location


then these could contain
items
itemid  name
1   memory module
2   floppy drive

pc
pcid location
1reception

item_list
pcid itemid
11
11
12

so reception pc contains 2 memory modules and 1 floppy

Hope that helps

-- 
regards,
Tom

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



Re: [PHP] problem with multiple fields

2005-05-19 Thread Vinss
but in fact for example:
pc reception have two memory module but i do the gestion of the individual 
pieces too
 for example in a table i have
 id name ref hs? 
1 sdram256 22055 True 
2 sdrram512 22056 True
 so i need to keep the informations of the reference too 


2005/5/19, Tom Rogers [EMAIL PROTECTED]: 
 
 Hi,
 
 Thursday, May 19, 2005, 6:07:53 PM, you wrote:
 V sorry for my poor english, i'll try to be understood
 V so i want to represent an informatic parc but have a problem
 V for example a pc can have 2 or more memory slot filled how to stock
 V the different id in a list in my database and how extract it
 V for the moment i just have an external key referencing one memory.
 V Have you an idea to help me please?
 
 It is probably best to put the individual items in a separate table
 and link their keys, as an example with 3 tables
 
 table items
 itemid
 name
 
 table item_list
 pcid
 itemid
 
 table pc
 pcid
 location
 
 then these could contain
 items
 itemid name
 1 memory module
 2 floppy drive
 
 pc
 pcid location
 1 reception
 
 item_list
 pcid itemid
 1 1
 1 1
 1 2
 
 so reception pc contains 2 memory modules and 1 floppy
 
 Hope that helps
 
 --
 regards,
 Tom
 
 


-- 
Ne sois pas trop prompt en parole réfléchis
aux conséquences de tes mots.
Derrière un pc il y a toujours un humain


Re: [PHP] problem with multiple fields

2005-05-19 Thread Vinss
but don't worry it helps a bit just i don't see how to keep this ref.

2005/5/19, Vinss [EMAIL PROTECTED]: 
 
 but in fact for example:
 pc reception have two memory module but i do the gestion of the individual 
 pieces too
  for example in a table i have
  id name ref hs? 
 1 sdram256 22055 True 
 2 sdrram512 22056 True
  so i need to keep the informations of the reference too 
 
 
 2005/5/19, Tom Rogers [EMAIL PROTECTED]: 
  
  Hi,
  
  Thursday, May 19, 2005, 6:07:53 PM, you wrote:
  V sorry for my poor english, i'll try to be understood 
  V so i want to represent an informatic parc but have a problem
  V for example a pc can have 2 or more memory slot filled how to stock
  V the different id in a list in my database and how extract it
  V for the moment i just have an external key referencing one memory.
  V Have you an idea to help me please?
  
  It is probably best to put the individual items in a separate table
  and link their keys, as an example with 3 tables 
  
  table items
  itemid
  name
  
  table item_list
  pcid
  itemid
  
  table pc
  pcid
  location
  
  then these could contain
  items
  itemid name
  1 memory module
  2 floppy drive
  
  pc
  pcid location
  1 reception
  
  item_list
  pcid itemid
  1 1
  1 1
  1 2
  
  so reception pc contains 2 memory modules and 1 floppy
  
  Hope that helps
  
  --
  regards,
  Tom
  
  
 
 
 -- 
 Ne sois pas trop prompt en parole réfléchis
 aux conséquences de tes mots.
 Derrière un pc il y a toujours un humain 




-- 
Ne sois pas trop prompt en parole réfléchis
aux conséquences de tes mots.
Derrière un pc il y a toujours un humain


Re: [PHP] Re: novice: char to varchar

2005-05-19 Thread Satyam
My guess is that the solution is that MySql, though it supports the syntax 
for standard SQL and thus takes char and varchar, it actually doesn't have a 
specific storage type for each, all chars are stored in varchar fields, just 
as all boolean or bit fields are stored in integer fields.

Though this would be a quite acceptable optimization on the part of the SQL 
engine, the problem is that it reports what the optimization did, not what 
you asked for.  I mean, if I ask for char, report to me a char, no matter 
what is it that you stored it in.

I actually reported this as a 'feature request' in the MySql site: 
http://bugs.mysql.com/bug.php?id=3350.  I first discovered it when I 
migrated a 'form creator' which I made years ago and is already in its third 
incarnation of language/database, which makes forms based on the structure 
of a database table.  Depending on the field type it creates an appropriate 
input field with validation, normal input for char or varchar fields, 
textareas if the field length is longer than a configurable size, calendar 
controls for dates, select listboxes if you indicate a lookup table and, 
checkboxes if the field is boolean.  The problem is that MySql does not 
report booleans as such but as the storage type, which might be different 
from the declared type, so I didn't get my checkboxes.  So I am forced to 
explicitly declare to the form creator which fields are actually boolean 
since it cannot pick it from the database structure.

Satyam







Kim Madsen [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 -Original Message-
 From: tony yau [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, May 18, 2005 9:03 PM

 found the answer sorry about this

But You don´t wanna share the solution with the rest of the class?

--
Med venlig hilsen / best regards
ComX Networks A/S
Kim Madsen
Systemudvikler/Systemdeveloper 

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



[PHP] Re: multiple inserts into a db

2005-05-19 Thread Satyam
You are missing loading the $i item of the  $Session_variable_with_itemID 
into $ses_basket_id' before doing the insert.

Satyam

Mayo [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 I'm putting ordered items into a db. The information is stored in
 session variables.

 Session_variable_with_itemID_has(1001,1002,1003,1004) however when
 inserted into the db only 0,0,0,0 is recorded.

 Assuming that this was the 40th recorded order the table should look
 like this

 TABLE: orderedItems

 orderedItemsID -- orderID - itemID

 159 - 40 - 1001
 160 - 40 - 1002
 161 - 40 -- 1003
 162 - 40 - 1004

 What comes out is:

 orderedItemsID -- orderID - itemID

 159 - 40 - 0
 160 - 40 - 0
 161 - 40 -- 0
 162 - 40 - 0


 The loop itself works as intended. However it is not inserting this
 variable.

 $ses_basket_items  is the total number of items
 $orderID = the orderID which these items are a part of
 $ses_basket_id = is the itemID number



for ($i=0;$i$ses_basket_items;$i++){

$query = INSERT INTO orderedItems (orderID,itemID) VALUES
 ('$orderID','$ses_basket_id');

mysql_query($query) or die('Error, insert query failed');

}

mysql_close($conn);

 thx

 

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



Re: [PHP] novice: char to varchar

2005-05-19 Thread Jon Hill
You can't mix CHAR and VARCHAR types in the same table.

jon

On Wednesday 18 May 2005 19:15, tony yau wrote:
 Hi all,

 I try to do the following:

 CREATE TABLE IF NOT EXISTS Invoice(
   PKey INTEGER,
   Received DATETIME,
   Cost DECIMAL(10,2),
   FileName VARCHAR(50),
   RefNum CHAR(10),

   PRIMARY KEY (PKey)
 ) TYPE=MyISAM COMMENT='Invoice Data';

 but it keep generating  RefNum VARCHAR(10)  instead of CHAR(10)

 I don't understand, please help (or point me to RTFM page)
 Tony Yau

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



[PHP] Uploading files?

2005-05-19 Thread rory walsh
Hi list, I am having a little problem with the code below. It just won't 
seem to work? Even though I always select a jpeg my mime content type 
test is never true? Have I made a silly mistake somewhere? I also run 
the test to see if the 'mime_content_type()' function exists first 
before I do any checking.

$uploaddir = 'Uploads/';
$basename = basename($_FILES['userfile']['name']);
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
if (!function_exists('mime_content_type')) {
   function mime_content_type($f) {
   $f = escapeshellarg($f);
   return trim( `file -bi $f` );
   }
}
if(mime_content_type($uploadfile)==image/jpeg)
{
  if(move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile))
	{
   	$_SESSION['UPLOAD_STRING']  = \.$basename.\. is a valid 		 
file type and was successfully uploaded.;
	}
	else if(strlen($basename)1)
	{
	$_SESSION['UPLOAD_STRING'] = No file specified, please try 			again;
	}
}
else $_SESSION['UPLOAD_STRING'] = File extension not supported, please 
make sure you use a valid extension.;

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


Re: [PHP] Refresh (F5) adds another SQL record.

2005-05-19 Thread Satyam

Marek Kilimajer [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Robert Meyer wrote:
 Hello,

 Scenario:
 1) User is presented a blank form.
 2) User fills in form.
 3) User submits form.
 4) Record is added to database.
 5) Back to 1).

 Go really back to 1) - use redirect. After the record is added to the 
 database, use something like:
 header('Location: http://yourserver.com/form.php');
 exit;


Or, in general, redirect to any page as soon as you made the insert.  It can 
be back to the begining or to a confirmation page, so the user gets a 
feedback of what has just been done.  The point is, don't show the 
confirmation or the new input form right in the same page as you did the 
insert, redirect to it in some way.

I use to process my data in a single form per operation.  I make each page 
like this:

if ($_REQUEST['confirm'] == 'true') {
// show the confirmation of the last operation
}
if ($_REQUEST['submit'] == 'Save') {
// do the insert here
header('Location: http://yourserver.com/form.php?confirm=true');
}

// here, show the input form which will show either for the first time or 
after the confirmation
// which ends with:
input type=submit name=submit value=Save /
/form

You might add to the redirect header some more arguments to be more explicit 
about what is it that you are confirming.  Anyway, the point is that the 
browser will store the redirected-to address with all its arguments, not the 
one with the form data, so, a refresh will give you the confirmation page, 
not the insert one.

Satyam



 All is fine to here.
 6) User clicks refresh.
 7) Another record is added, same data except auto-increment field.
 How do I prevent these last two steps, or at least prevent a record
 from being added when refresh is clicked?

 You should see a message from your browser that data is being reposted. 

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



Re: [PHP] Refresh (F5) adds another SQL record.

2005-05-19 Thread Satyam
Aren't we oversimplifying the issue assuming that the records inserted 
cannot have everything duplicated but the autoincrement field?

If you are taking an order and the customer says 'hey, add another of this', 
with the code below the system will reject it because it assumes that it is 
a refresh and not a new addition to the order.

You are in the supermarket line and the teller is scaning your purchase for 
the barcodes.  You wouldn't be able to buy more than one of each! (I know 
that you wouldn't use a browser in that environment, but for the purpose of 
the database analysis, it just shows the point)

NO, some tables do have records which are basically duplicate of one another 
except for the autoincrement field, and those cannot be checked this way.

And, besides, as mentioned elsewhere in this thread (myself included) there 
are easier ways which do not even involve database access.

Satyam

Marcus Joyce [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Why dont you check that data isnt being duplicated?

 $query = SELECT auto_col FROM table where col1 = $var1  col2 = $var 
 3.;
 $call_query = mysql_query($query,...
 $query_data = mysql_assoc($call_query);

 if(!$query_data) { do form }

 else echo information already exists in database;


 Pierce

 Robert Meyer wrote:

Hello,

Scenario:
1) User is presented a blank form.
2) User fills in form.
3) User submits form.
4) Record is added to database.
5) Back to 1).
All is fine to here.
6) User clicks refresh.
7) Another record is added, same data except auto-increment field.
How do I prevent these last two steps, or at least prevent a record
from being added when refresh is clicked?

Regards,

Robert
 

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



[PHP] Re: array_diff odities

2005-05-19 Thread Jason Barnett
Pablo Gosse wrote:
Howdy folks.  I'm running into something strange with array_diff that
I'm hoping someone can shed some light on.
I have two tab-delimited text files, and need to find the lines in the
first that are not in the second, and vice-versa.
There are 794 records in the first, and 724 in the second.  

Simple enough, I thought.  The following code should work:
$tmpOriginalGradList = file('/path/to/graduate_list_original.txt');
$tmpNewGradList = file('/path/to/graduate_list_new.txt');
$diff1 = array_diff($tmpOriginalGradList, $tmpNewGradList);
$diff2 = array_diff($tmpNewGradList, $tmpOriginalGradList);
I expected that this would set $diff1 to have all elements of
$tmpOriginalGradList that did not exist in $tmpNewGradList, but it
actually contains many elements that exist in both.
The same is true for $diff2, in that many of its elements exist in both
$tmpOriginalGradList and $tmpNewGradList as well.
Since this returns $diff1 as having 253 elements and $diff2 as having
183, it sort of makes sense, since the difference between those two
numbers is 70, which is the difference between the number of lines in
the two files.  But the bottom line is that both $diff1 and $diff2
contain elements common to both files, which using array_diff simply
should not be the case.
Hard to say what happened here.  If I had to take a guess I might say 
that you're getting line wrapping in the middle of 183 different records.

However, when I loop through each file and strip out all the tabs:
And really since you have tab-delimited records you should be exploding 
on those tabs in order to get the data set.  But because I'm slightly 
paranoid I would do it on the entire string of the file.

?php
$str_OriginalGradList = 
file_get_contents('/path/to/graduate_list_original.txt');
$ary_OriginalGradList = explode(chr(9), $str_OriginalGradList);
$str_NewGradList = file_get_contents('/path/to/graduate_list_new.txt');
$ary_NewGradList = explode(chr(9), $str_OriginalGradList);

$diff1 = array_diff($ary_OriginalGradList, $ary_NewGradList);
$diff2 = array_diff($ary_NewGradList, $ary_OriginalGradList);
echo 'pre';
var_dump($diff1);
var_dump($diff2);
echo '/pre';
?
foreach ($tmpOriginalGradList as $k=$l) {
$tmp = str_replace(chr(9), '', $l);
$tmpOriginalGradList[$k] = $tmp;
}
foreach ($tmpNewGradList as $k=$l) {
$tmp = str_replace(chr(9), '', $l);
$tmpNewGradList[$k] = $tmp;
}
I get $diff1 as having 75 elements and $diff2 as having 5, which also
sort of makes sense since there numerically there are 70 lines
difference between the two files.
I also manually replaced the tabs and checked about 20 of the elements
in $diff1 and none were found in the new text file, and none of the 5
elements in $diff2 were found in the original text file.
75 / 5 is probably the right mix.  Programmatically you can check this 
by comparing the diffs with each list.

However, if in the code above I replace the tabs with a space instead of
just stripping them out, then the numbers are again 253 and 183.
I'm inclined to think the second set of results is accurate, since I was
unable to find any of the 20 elements I tested in $diff1 in the new text
file, and none of the elements in $diff2 are in the original text file.
Does anyone have any idea why this is happening?  The tab-delimited
files were generated from Excel spreadsheets using the same script, so
there wouldn't be any difference in the formatting of the files.
The sad truth is that this is quite possibly the root cause of your 
problem.  I have had many many problems caused by MS Excel conversion 
to/from other types of data.  I don't completely understand the escaping 
process in Excel, but double quotes have always been a problem.  And 
occasionally it seems like Excel just barfs on a tab / comma.  Why it 
does that is completely beyond me.  I can't count the number of times 
that I have opened up a comma delimited file in Excel, just *looked* at 
the file, saved it, and when I view the source it's been mangled a bit.

Moral of the story: I don't ever use Excel to view tab or comma 
delimited types of data unless I have a backup someplace.

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


Re: [PHP] Refresh (F5) adds another SQL record.

2005-05-19 Thread Satyam
I did something pretty similar to this but not with an MD5 hash.  I used a 
table which had just two fields, one autoincrement and another one a 
boolean.  When doing a form, I added one record to this table and the ID I 
got from it is the one I sent in the form, the other field served to 
indicate that the ID had been used, as you mention.  Later on I read about 
redirecting out of the update page, as Marek Kilimajer replied above and 
never bothered to do it again.

Satyam


Richard Lynch [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 On Tue, May 17, 2005 2:24 pm, Robert Meyer said:
 Hello,

 Scenario:
 1) User is presented a blank form.

 with an MD5 hash which is stored in the database as fresh

 2) User fills in form.
 3) User submits form.
 4) Record is added to database.

 That particular MD5 has is marked as used

 5) Back to 1).
 All is fine to here.
 6) User clicks refresh.
 7) Another record is added, same data except auto-increment field.
 How do I prevent these last two steps, or at least prevent a record
 from being added when refresh is clicked?

 The used MD5 hash tells you they are re-submitting the exact same form.

 Now, if the real problem is that the user has a fresh new form, and fills
 in the same data again by hand, then there are only two possibilities:

 1. In the real world, they actually NEED two of the same thing in the
 database, and your application should allow it.

 2. In the real world, users are likely to lose track of where they are in
 their data entry, and you need to provide them the context to help avoid
 that. When you go back to 1) present a message like added blah blah blah
 at the top of the screen.  Now they *KNOW* they just did blah blah blah,
 and can move on to blah blah bleh.  Data entry is a sucky job.  Make it
 nicer for them, eh?  You STILL need to code for the dual entry, and do
 something intelligent when they mess up, but you can improve efficiency
 and decrease errors (where 2 not-quite-the-same-but-really-are-the-same
 entries pass your tests) if you make your application nicer to the user.

 -- 
 Like Music?
 http://l-i-e.com/artists.htm 

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



[PHP] PHP5 qne MySQL

2005-05-19 Thread Terrence Mullin
 I have been trying to set an area at home to run and
 test php and MySQL applications. I used the tutorial
 on http://www.ricocheting.com/server/cgi.html 
 to install Apache, PHP, and MySQL. Everything is
 working great except for trying to test a simple
 connection to the MySQL database through php. I have
 seen some other people quote on how PHP5 no longer
has
 a direct link to MySQL. My platform is Windows XP at
 the moment. I will shortly be partitioning two hard
 drives for use of Linux on one of them. I would like
 to know if there is a solution for WIndows XP. I
have
 seen people just go back to php4 to correct this. I
 was wondering if there is a simple way I can stick
 with PHP5 and make my connections. I receive this
 error right now:
 
 Fatal error: Call to undefined function
 mysql_connect() in C:\public_html\MySQLphptry.php on
 line 18
 
 Where line 18, is just the mydsql_connect ();
command.
 Thank you for your help in this I know myself as
well
 as other forums out there would like to know a
simple
 solution if there is one.

SIncerely,
Terry Mullin

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



Re: [PHP] Image Verification - Problems in Safari, Mac OS X

2005-05-19 Thread Rahul S. Johari

On 5/18/05 7:19 PM, Richard Lynch [EMAIL PROTECTED] wrote:

 Your image is *NOT* a DOCTYPE HTML PUBLIC blah blah!!!
 
 It's a *IMAGE*
 
 Get rid of all the HMTL stuff.
 
 You actually need to separate this into two different files.
 
 One has all the HTML in it, with a SRC=/URL/to/image.php/image.png
 
 The other is JUST the image stuff.
 
 If IE actually displays it as-is, that's pretty broken...  But IE is
 pretty broken as it is, so one more broken-ness shouldn't surprise
 anybody.


Ave,

Here's the problem.
I completely understand what's going on and that actually it was IE screwing
it up and Safari was actually doing the right thing. But my problem only
deepens right now with IE.

I did actually remove the Header which declared it as a Image/PNG and
everything seemed to work in both the browsers.

Here's my situation though... I can't separate out these two files because
when a user is on the verification page, where the Image exists, in case he
reloads or refreshes the page, a new image should be generated and
displayed, so that the verification code is different each time you reach
the verification page. If I was to keep the image code in a different page,
the verification page will pick up the same PNG image and display the same
security code over and over without changing it.

Removing the header with image/PNG actually was working for both browsers, I
could keep both the codes on one page and the page could be
refreshed/reloaded to display new security code... Or reached from anywhere
and you'd still have a new security code.

But here's the problem that came afterwards in IE !
IE is storing the image in it's cache.. And it's displaying the same image
on the verification page whether you use the BACK button, FORWARD button, or
actually go through the website and land back on the verification page. So
in IE, right now, unless you actually HIT the REFRESH button, it's not
changing the image as it's picking up the image from the Cache.

Now I'm not sure what exactly I should do to fix this whole situation.

Thanks all,

Rahul S. Johari
Coordinator, Internet  Administration
Informed Marketing Services Inc.
251 River Street
Troy, NY 12180

Tel: (518) 266-0909 x154
Fax: (518) 266-0909
Email: [EMAIL PROTECTED]
http://www.informed-sources.com

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



Re: [PHP] Image Verification - Problems in Safari, Mac OS X

2005-05-19 Thread Rahul S. Johari

On 5/18/05 6:23 PM, Marek Kilimajer [EMAIL PROTECTED] wrote:

 BTW, you might not be concerned about it much, but you have a race
 condition in your script.

Ave,

What do you mean by race condition ?


Rahul S. Johari
Coordinator, Internet  Administration
Informed Marketing Services Inc.
251 River Street
Troy, NY 12180

Tel: (518) 266-0909 x154
Fax: (518) 266-0909
Email: [EMAIL PROTECTED]
http://www.informed-sources.com

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



Re: [PHP] PHP5 qne MySQL

2005-05-19 Thread Charles FENDT
Terrence Mullin a écrit :
I have been trying to set an area at home to run and
test php and MySQL applications. I used the tutorial
on http://www.ricocheting.com/server/cgi.html 
to install Apache, PHP, and MySQL. Everything is
working great except for trying to test a simple
connection to the MySQL database through php. I have
seen some other people quote on how PHP5 no longer
   

has
 

a direct link to MySQL. My platform is Windows XP at
the moment. I will shortly be partitioning two hard
drives for use of Linux on one of them. I would like
to know if there is a solution for WIndows XP. I
   

have
 

seen people just go back to php4 to correct this. I
was wondering if there is a simple way I can stick
with PHP5 and make my connections. I receive this
error right now:
Fatal error: Call to undefined function
mysql_connect() in C:\public_html\MySQLphptry.php on
line 18
Where line 18, is just the mydsql_connect ();
   

command.
 

Thank you for your help in this I know myself as
   

well
 

as other forums out there would like to know a
   

simple
 

solution if there is one.
   

SIncerely,
Terry Mullin
 

Try to edit your PHP.INI file
check if PHP_MYSQL.DLL in declared as module...
if the file is in the path...
But try to use MySQLi or PDO (PHP 5.1 or PECL modules for PHP 5.0)
This is a must better way to acces mysql Database...
regards,
FENDT Charles
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: novice: char to varchar

2005-05-19 Thread tony yau
Hi Kim,

I've found the same article that Philip Hallstrom [EMAIL PROTECTED]
had posted

Tony

Kim Madsen [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 -Original Message-
 From: tony yau [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, May 18, 2005 9:03 PM

 found the answer sorry about this

But You don´t wanna share the solution with the rest of the class?

--
Med venlig hilsen / best regards
ComX Networks A/S
Kim Madsen
Systemudvikler/Systemdeveloper

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



[PHP] novice: table design FOREIGN key

2005-05-19 Thread tony yau
Hi All

Thanks for all your comments on my previous mail, very much appreciated.
I'm stuck again!
I've created the following lookup table for m - m relationship between
a Group and a Contact table.

CREATE TABLE Group_Contact(
  GroupID INT NOT NULL,
  ContactID INT NOT NULL,

  Index (GroupID),
  FOREIGN KEY (GroupID) REFERENCES Group (PKey) ON DELETE CASCADE,
  Index (ContactID),
  FOREIGN KEY (ContactID) REFERENCES Contact (PKey) ON DELETE CASCADE
) TYPE=InnoDB COMMENT='Group to Contact lookup';

what do I need to do to ensure only unique (GroupID,ContactID) pair can be
inserted into the table?

Thanks
Tony Yau

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



[PHP] setting browscap.ini

2005-05-19 Thread Ross
Hi,

My isp won't give me access to the php.ini file and they insist you can set 
browscap.ini up using the .htaccess file.

I don't reeally believe this is possible. any ideas?

R. 

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



[PHP] Re: Responses in my email.

2005-05-19 Thread Robert Meyer
Thanks for your responses.

I've set up a filter on [PHP] to redirect email.

I just prefer to read it all on the newsgroup.

Regards,

Robert

Robert Meyer [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 Hello,

 When I post a question here, I get an email for every response posted.  I 
 only want the response posted, not emailed to me.  The other newsgroups I 
 belong to don't send me an email.  What are my options if any and how do I 
 implement them?

 Regards,

 Robert 

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



Re[2]: [PHP] problem with multiple fields

2005-05-19 Thread Tom Rogers
Hi,

Thursday, May 19, 2005, 8:12:45 PM, you wrote:
V but in fact for example:
V pc reception have two memory module but i do the gestion of the individual
V pieces too
V  for example in a table i have
V  id name ref hs? 
V 1 sdram256 22055 True 
V 2 sdrram512 22056 True
V  so i need to keep the informations of the reference too 


V 2005/5/19, Tom Rogers [EMAIL PROTECTED]: 


In that case use the reference as the key to the item

id name hs
22055 sdram256 true
22056 sdram512 true

then the item list table would be

pc id
1  22055
1  22056

--
regards,
Tom

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



Re: [PHP] Problem With System Call

2005-05-19 Thread Michael Stearne
No.  It's RedHat Fedora Core 3.

Michael


On 5/19/05, Kim Madsen [EMAIL PROTECTED] wrote:
  -Original Message-
  From: Michael Stearne [mailto:[EMAIL PROTECTED]
  Sent: Thursday, May 19, 2005 9:10 AM
 
  I am having the strangest problem using system() or exec() or any
  variation.  None of them work on the Fedora Core 3 system that was
  just loaded.  The PHP is Version 4.3.9 with Apache 2.0.52, the default
  installation for Fedora Core 3.  Everything in PHP works as expected
  except when trying a system call.  If I run :
 
  ?
  system(/bin/ls /tmp);
  ?
 
  on my OS X (Apache/1.3.33 (Darwin) PHP/4.3.4) this returns the desired
  results, a listing of the tmp directory.  On the Fedora box I get
  nothing, a blank page.  There is content in the /tmp directory on the
  Fedora box.
 
 Are You perhaps running SElinux?
 
 --
 Med venlig hilsen / best regards
 ComX Networks A/S
 Kim Madsen
 Systemudvikler/Systemdeveloper
 
 --
 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] Image Verification - Problems in Safari, Mac OS X

2005-05-19 Thread Murray @ PlanetThoughtful
 But here's the problem that came afterwards in IE !
 IE is storing the image in it's cache.. And it's displaying the same image
 on the verification page whether you use the BACK button, FORWARD button,
 or
 actually go through the website and land back on the verification page. So
 in IE, right now, unless you actually HIT the REFRESH button, it's not
 changing the image as it's picking up the image from the Cache.
 
 Now I'm not sure what exactly I should do to fix this whole situation.

Try forcing the browser to bypass the cache by adding the lines at the
following link to your page:

http://www.faqts.com/knowledge_base/view.phtml/aid/21068/fid/51

Regards,

Murray

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



Re: [PHP] Image Verification - Problems in Safari, Mac OS X

2005-05-19 Thread Rahul S. Johari

On 5/19/05 10:59 AM, Murray @ PlanetThoughtful
[EMAIL PROTECTED] wrote:


 Try forcing the browser to bypass the cache by adding the lines at the
 following link to your page:
 
 http://www.faqts.com/knowledge_base/view.phtml/aid/21068/fid/51

I thought this would definitely work because it looks like exactly what I
need. IE is picking up the image from the cache no matter what.. And it
seemed this piece of code is exactly for that, so that IE doesn't pick up
images/data from the cache. But it's still not working! IE is still indeed
picking up the image from the cache.

This is how the beginning of my php page looks like:

?php
session_start(); 
header (Expires: Mon, 26 Jul 1997 05:00:00 GMT); // Date in the past
header (Last-Modified:  . gmdate(D, d M Y H:i:s) .  GMT);
header (Cache-Control: no-cache, must-revalidate); // for HTTP/1.1
header (Pragma: no-cache); // for HTTP/1.0
?

Stll... IE is displaying the image that has already been displayed on first
login attempt... It won't display new Image untill you actually physically
hit the REFRESH button on the browser.

Any suggestions? 

Rahul S. Johari
Coordinator, Internet  Administration
Informed Marketing Services Inc.
251 River Street
Troy, NY 12180

Tel: (518) 266-0909 x154
Fax: (518) 266-0909
Email: [EMAIL PROTECTED]
http://www.informed-sources.com

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



Re: [PHP] novice: table design FOREIGN key

2005-05-19 Thread John Nichel
tony yau wrote:
Hi All
snip
Even though some people on this list were nice enough to answer your 
first OT question, this is still not a MySQL list.

http://lists.mysql.com/
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] setting browscap.ini

2005-05-19 Thread Chris
Ross wrote:
Hi,
My isp won't give me access to the php.ini file and they insist you can set 
browscap.ini up using the .htaccess file.

I don't reeally believe this is possible. any ideas?
R. 
 

Well, this page says it can't be done in .htaccess
http://www.php.net/manual/en/ini.php
says that browscap can be used in PHP_INI_SYSTEM (which doesn't include 
.htaccess)

Though I haven't tried it.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] System Call Troubles

2005-05-19 Thread Michael Stearne
I am having the strangest problem using system() or exec() or any
variation.  None of them work on the Fedora Core 3 system that was
just loaded.  The PHP is Version 4.3.11 with Apache 2.0.52, the default
installation for Fedora Core 3.  Everything in PHP works as expected
except when trying a system call.  If I run :

?
system(/bin/ls /tmp);
?

on my OS X (Apache/1.3.33 (Darwin) PHP/4.3.4) this returns the desired
results, a listing of the tmp directory.  On the Fedora box I get
nothing, a blank page.  There is content in the /tmp directory on the
Fedora box.

Please help!

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



[PHP] Getting info about a domain's status

2005-05-19 Thread Napolean Bonaparte


 Hello,
 I'm developing a PHP application for a web hosting company.  My
 requirement is that I need to check whether a domain name is
 registered or not. At the moment, I don't need any extra information
 other than the domain's status(registered or unregistered). I'd be
 happy if I get a true/false value from a function which does all the
 dirty work for me. 
 
 I tried several scripts, but none of them work with .co.in.  I
 basically need to check
 with .com, .org, .net, .info, .gov, .biz, .edu, .in, .co.in,  .name .
 There's nothing like it if I get a script which works with all the
 domains.  
 
 There is little support from my registrar regarding this. Is there any
 function/class to check whether a domain name is registered? 
 
 
 I'm more or less directionless. Any pointer would be appreciated.
 
 Regards,
 Sudheer. S


Re: [PHP] Problem With System Call

2005-05-19 Thread Brandon Ryan
I think what Kim is asking is, on your copy of RedHat Fedora Core 3,
is are the SELinux security features enabled?

On 5/19/05, Michael Stearne [EMAIL PROTECTED] wrote:
 No.  It's RedHat Fedora Core 3.
 
 Michael
 
 
 On 5/19/05, Kim Madsen [EMAIL PROTECTED] wrote:
   -Original Message-
   From: Michael Stearne [mailto:[EMAIL PROTECTED]
   Sent: Thursday, May 19, 2005 9:10 AM
 
   I am having the strangest problem using system() or exec() or any
   variation.  None of them work on the Fedora Core 3 system that was
   just loaded.  The PHP is Version 4.3.9 with Apache 2.0.52, the default
   installation for Fedora Core 3.  Everything in PHP works as expected
   except when trying a system call.  If I run :
  
   ?
   system(/bin/ls /tmp);
   ?
  
   on my OS X (Apache/1.3.33 (Darwin) PHP/4.3.4) this returns the desired
   results, a listing of the tmp directory.  On the Fedora box I get
   nothing, a blank page.  There is content in the /tmp directory on the
   Fedora box.
 
  Are You perhaps running SElinux?
 
  --
  Med venlig hilsen / best regards
  ComX Networks A/S
  Kim Madsen
  Systemudvikler/Systemdeveloper
 
  --
  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] novice: table design FOREIGN key

2005-05-19 Thread Michael Satterwhite
tony yau wrote:
| Hi All
|
| Thanks for all your comments on my previous mail, very much
appreciated.
| I'm stuck again!
| I've created the following lookup table for m - m relationship
between
| a Group and a Contact table.
|
| CREATE TABLE Group_Contact(
|   GroupID INT NOT NULL,
|   ContactID INT NOT NULL,
|
|   Index (GroupID),
|   FOREIGN KEY (GroupID) REFERENCES Group (PKey) ON DELETE CASCADE,
|   Index (ContactID),
|   FOREIGN KEY (ContactID) REFERENCES Contact (PKey) ON DELETE CASCADE
| ) TYPE=InnoDB COMMENT='Group to Contact lookup';
|
| what do I need to do to ensure only unique (GroupID,ContactID) pair can be
| inserted into the table?
This question is really a MySQL question. You might want to join their
mailing list as you'll get better answers for this type of question there.
That said: The easiest way would be to make GroupId, ContactID a unique
index. In this case, primary key would be OK. Add the statement
Primary Key(GroupID, ContactId),
just before the first Index statement.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Looking for a developer's weblog/cms system?

2005-05-19 Thread Philip Hallstrom
Hi folks -
 	Over the years I've collected and done some things (tips, howtow, 
code snippets, etc.) that I think might be useful to others.  Heck, I'd 
like to have them nicely organized too as now they are spread across 
machines, in email, etc.

I'm thinking it might be nice to have an easy to use web-based cms system 
that I could post this sort of stuff too and assign it to a category and 
then let google index it.

My problem is that there are hundreds of apps that do this.  And a lot of 
them don't do what I need.  A lot of them seem geared toward diary type 
applications, I want more of a this is my stuff which you might find 
useful.

Mostly I want something that has a decent look so I dont' have to think 
about that part.

So, I'm asking you all for any recommendations you might have so I don't 
have to try dozens of these things out.  I figure some of you must be 
doing the same thing and I'm hoping I can leverage your experience :-)

Basically, I want a way to post things I think others might find useful. 
I'm not interested in user comments.  I don't care about RSS.  I would 
like to easily be able to mark things as code or type this at a shell 
prompt as well as link to entire source files, etc.

Anyway, I'm hoping some of you can point me in the direction of some apps 
that might help me out.  Either your own, or sites you visit...

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


Re: [PHP] System Call Troubles

2005-05-19 Thread Philip Hallstrom
I am having the strangest problem using system() or exec() or any
variation.  None of them work on the Fedora Core 3 system that was
just loaded.  The PHP is Version 4.3.11 with Apache 2.0.52, the default
installation for Fedora Core 3.  Everything in PHP works as expected
except when trying a system call.  If I run :
?
system(/bin/ls /tmp);
?
on my OS X (Apache/1.3.33 (Darwin) PHP/4.3.4) this returns the desired
results, a listing of the tmp directory.  On the Fedora box I get
nothing, a blank page.  There is content in the /tmp directory on the
Fedora box.
Compare the output of phpinfo() on each machine.  Investigate any 
differences...

Also maybe this will help:
http://us4.php.net/features.safe-mode
-philip
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] System Call Troubles

2005-05-19 Thread Michael Stearne
Thanks.  Neither have helped.  I have no idea what the deal is.  I
think it might be some restriction set by Fedora or Apache.

Michael


On 5/19/05, Philip Hallstrom [EMAIL PROTECTED] wrote:
  I am having the strangest problem using system() or exec() or any
  variation.  None of them work on the Fedora Core 3 system that was
  just loaded.  The PHP is Version 4.3.11 with Apache 2.0.52, the default
  installation for Fedora Core 3.  Everything in PHP works as expected
  except when trying a system call.  If I run :
 
  ?
  system(/bin/ls /tmp);
  ?
 
  on my OS X (Apache/1.3.33 (Darwin) PHP/4.3.4) this returns the desired
  results, a listing of the tmp directory.  On the Fedora box I get
  nothing, a blank page.  There is content in the /tmp directory on the
  Fedora box.
 
 Compare the output of phpinfo() on each machine.  Investigate any
 differences...
 
 Also maybe this will help:
 
 http://us4.php.net/features.safe-mode
 
 -philip
 


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



Re: [PHP] Problem With System Call

2005-05-19 Thread Michael Stearne
I noticed that.  I don't believe SELinux is installed.  Is these known
to disable system calls?

Thanks,
Michael


On 5/19/05, Roger B.A. Klorese [EMAIL PROTECTED] wrote:
 On Thu, 19 May 2005, Michael Stearne wrote:
 
  No.  It's RedHat Fedora Core 3.
 
 SElinux isn't a distribution -- it's a capability set, and Fedora Core 3
 has it in it.
 
 


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



[PHP] upload videos (might be a bit 0T)

2005-05-19 Thread Ryan A
Hey,
I dont really know if this is a good idea so need more advise than anything.

My cousins in the US and Canada want to send us some home movies (not that I
like home movies ##yuck##)
but the rest of my family wants to see them.

We have a dedicated server which will easily handle a couple of gigs...I was
thinking of allowing them to upload
the movies to the server and download it here (Sweden)

Any suggestions on how to do this?
Normal upload form with PHP and increase timeout on server?
or some P2P method?
I dont think they know much about FTP or i would have given them a directory
on the server to upload to.

Thanks,
Ryan



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.322 / Virus Database: 266.11.12 - Release Date: 5/17/2005

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



Re: [PHP] System Call Troubles

2005-05-19 Thread Rasmus Lerdorf
Michael Stearne wrote:
 I am having the strangest problem using system() or exec() or any
 variation.  None of them work on the Fedora Core 3 system that was
 just loaded.  The PHP is Version 4.3.11 with Apache 2.0.52, the default
 installation for Fedora Core 3.  Everything in PHP works as expected
 except when trying a system call.  If I run :
 
 ?
 system(/bin/ls /tmp);
 ?
 
 on my OS X (Apache/1.3.33 (Darwin) PHP/4.3.4) this returns the desired
 results, a listing of the tmp directory.  On the Fedora box I get
 nothing, a blank page.  There is content in the /tmp directory on the
 Fedora box.

These sorts of problems are easy to debug.  Switch to your web server
user id and issue the same command.  You will most often find you have a
permission problem, or in the Fedora/Redhat world you will find that
SELinux is yanking your chain.  You may want to read through:

  http://fedora.redhat.com/docs/selinux-faq-fc3/

-Rasmus

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



[PHP] Re: System Call Troubles

2005-05-19 Thread Luis
maybe you should check your php safe_mode config
cheers
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Looking for a developer's weblog/cms system?

2005-05-19 Thread Matthew Weier O'Phinney
* Philip Hallstrom [EMAIL PROTECTED]:
   Over the years I've collected and done some things (tips, howtow, 
 code snippets, etc.) that I think might be useful to others.  Heck, I'd 
 like to have them nicely organized too as now they are spread across 
 machines, in email, etc.

 I'm thinking it might be nice to have an easy to use web-based cms system 
 that I could post this sort of stuff too and assign it to a category and 
 then let google index it.

 My problem is that there are hundreds of apps that do this.  And a lot of 
 them don't do what I need.  A lot of them seem geared toward diary type 
 applications, I want more of a this is my stuff which you might find 
 useful.

I can think of a couple of things:

* A wiki. This would likely require some reformatting on your part,
  but even that could probably be scripted. The nice thing about a
  wiki is that you can either have it wide open so others may
  comment and contribute, or you can lock it down so only you or
  others you appoint may contribute. Additionally, each page gets
  its own URL, and most wikis worth their salt have search
  functionality.

* A blog. Many blog packages allow you to add code snippets and will
  even hilight them for you; you usually also get search
  functionality and the possiblity of static URLs for content.

 Mostly I want something that has a decent look so I dont' have to think 
 about that part.

 So, I'm asking you all for any recommendations you might have so I don't 
 have to try dozens of these things out.  I figure some of you must be 
 doing the same thing and I'm hoping I can leverage your experience :-)

I've used a variety of wikis; you just have to choose one and run with
it. I'm not familiar with many blog packages, but do use Serendipity
(http://www.s9y.org), and have played a little with Jaws
(http://www.jaws-project.com/index.php); they have some nice features
and are relatively easy to set up.

 Basically, I want a way to post things I think others might find useful. 
 I'm not interested in user comments.  I don't care about RSS.  I would 
 like to easily be able to mark things as code or type this at a shell 
 prompt as well as link to entire source files, etc.

If you'r interested in posting things I think others might find
useful, why are you not interested in RSS? How will *others* know when
you've posted something new? I find that RSS is a great tool for me to
keep track of developers, projects, and other sundries. I rarely use my
bookmarks anymore.

Anyways -- the blog packages I've indicated above all utilize RSS, and
may wikis do as well, so if you use one of the above solutions, you'll
likely get that 'for free'.

If all else fails... you're a PHP developer -- code your own!

-- 
Matthew Weier O'Phinney   | WEBSITES:
Webmaster and IT Specialist   | http://www.garden.org
National Gardening Association| http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org
mailto:[EMAIL PROTECTED] | http://vermontbotanical.org

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



[PHP] Excellent language PHP5 is!

2005-05-19 Thread Robert Meyer
Hello All,

Just a comment on PHP5.  I never used PHP until just over two weeks ago, 
though I have been a software engineer since 1975.  What one can do with 
PHP5 is awesome.

I have just developed and tested a function where all SIMPLE access to the 
MySQL database is contained therein.  I just pass to this function the 
appropriate parameters.  I do INSERTs, UPDATEs, DELETEs, and SELECTs with 
it.  What makes this all possible are the following abilities of the PHP5 
language (not in any particular order):

1) explode
2) isset
3) variable variables (subscripted even): ${$_O[1]}
4) ability to make variable variables global: global ${$_O[1]};
5) variable number of parameters: func_num_args(), func_get_arg()
6) the passing of arrays as parameters
7) dynamically create PHP5 code to execute with the eval() function

Example usage of my function:

1) if 
(MySQL_Action('I,0,3','MyTable','','Fld1Name','Fld1Value,'Fld2Name','Fld2Value'))
 
{ . . . }
The above inserts two fields into MyTable and returns True if it succeeds.

2) if (MySQL_Action('S,0,3','MyTable','RecId = 
'.$RecId,'Fld1Name','GlobalVar4Value')) { . . . }
The above selects the record where RecId = $RecId and assigns the value in 
Fld1Name to the global variable $GlobalVar4Value and returns True if it 
succeeds.

3) if (MySQL_Action('U,0,3','MyTable',RecId = $RecId,'Fld1Name','Fld1Value')) 
{ . . . }
The above updates the record where RecId = $RecId SETting Fld1Name = 
Fld1Value and returns True if it succeeds.

4) if (MySQL_Action('S:R,0,3','MyTable','1 ORDER BY OrderIt, RecId','*')) 
{ . . . }
The above SELECTs all fields (*) from MyTable in the order of OrderIt, RecId 
and assigns the result of the mysql_query to the global variable $R and 
returns True if it succeeds.  The R in 'S:R' can be anything, such as 
'S:MyResult' and is used for other mysql functions such as 
mysql_num_rows($R) or mysql_fetch_row($MyResult) after calling this 
function.

This function turns several lines of code into one line and takes care of 
correctly formatting the SQL statement.

There is one thing I hope is implemented in PHP soon.  That is the ability 
to pass by reference and receive the reference in variable parameter lists. 
You can pass by reference to a function taking a variable number of 
parameters, but func_get_arg() only returns the value and therefore, any 
changes to that variable do not change the variable as seen by the caller. 
Maybe a func_get_refarg() could be implemented.

Over all, an Excellent language PHP5 is!

Regards,

Robert

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



Re: [PHP] System Call Troubles

2005-05-19 Thread Michael Stearne
Thank you!

setsebool httpd_disable_trans true
/etc/init.d/httpd restart

did it.

Michael

On 5/19/05, Rasmus Lerdorf [EMAIL PROTECTED] wrote:
 Michael Stearne wrote:
  I am having the strangest problem using system() or exec() or any
  variation.  None of them work on the Fedora Core 3 system that was
  just loaded.  The PHP is Version 4.3.11 with Apache 2.0.52, the default
  installation for Fedora Core 3.  Everything in PHP works as expected
  except when trying a system call.  If I run :
 
  ?
  system(/bin/ls /tmp);
  ?
 
  on my OS X (Apache/1.3.33 (Darwin) PHP/4.3.4) this returns the desired
  results, a listing of the tmp directory.  On the Fedora box I get
  nothing, a blank page.  There is content in the /tmp directory on the
  Fedora box.
 
 These sorts of problems are easy to debug.  Switch to your web server
 user id and issue the same command.  You will most often find you have a
 permission problem, or in the Fedora/Redhat world you will find that
 SELinux is yanking your chain.  You may want to read through:
 
   http://fedora.redhat.com/docs/selinux-faq-fc3/
 
 -Rasmus
 


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



RE: [PHP] RSS news feed (slightly 0T)

2005-05-19 Thread Reynier Perez Mira
Exists some RSS for PHP but in spanish language?
Thanks

Reynier Pérez Mira
3ero. Ing. Informática
Entre más inteligente me siento, más me doy cuenta de lo ignorante que soy.
-Mensaje original-
De: Jared Williams [mailto:[EMAIL PROTECTED] 
Enviado el: Wednesday, May 18, 2005 12:27 PM
Para: 'Ryan A'; 'php'
Asunto: RE: [PHP] RSS news feed (slightly 0T)

 
 Hey,
 
 Can anyone suggest a few places where i can get some decent 
 tech/programming/php news feeds?
 
 I presently have the PHP.net feed (but its not too good 
 because the news does not change much in days) and I am using 
 yahoo's feeds for software, digital music and internet.
 
 I was using slashdot, but the articles are generally really 
 small, and its more of a forum based...but worst of all their 
 feed is having problems and sometimes i get it (i cache the 
 feed and update every 8 hours) sometimes i dont get it.
 
 To be fair, taking into consideration the above categories 
 please try to refrain from posting your own feed unless you 
 think it would really help me.
 
 Also cc the list your answer coz it would help if not 
 everyone told me to check out site x
 :-),
 i'll reply to the list and you.

Er
www.planet-php.net even :)

Jared

-- 
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] Re: Excellent language PHP5 is!

2005-05-19 Thread Matthew Weier O'Phinney
* Robert Meyer [EMAIL PROTECTED]:
 There is one thing I hope is implemented in PHP soon.  That is the ability 
 to pass by reference and receive the reference in variable parameter lists. 
 You can pass by reference to a function taking a variable number of 
 parameters, but func_get_arg() only returns the value and therefore, any 
 changes to that variable do not change the variable as seen by the caller. 
 Maybe a func_get_refarg() could be implemented.

Indeed, there's a comment on the func_get_arg() manual page to this very
effect.

One possibility is to wrap the reference into an array:

// in functioncall():
function functioncall() {
$args = func_get_arg(0);
$arg = $args[0]; // retrieving reference from array
$arg++;
}

$arg = 1;
functioncall(array($arg)); // passing an array with a ref
echo $arg;

I tested this, and it works. Requires a bit more work in the function,
but a little architecting could get it working.

Another possiblity is to pass associative arrays to your functions;
then, in your function, check for the existence of keys you need. The
beauty of this approach is that you don't have to muck about with the
func_get_arg() calls, you still get a variable number of arguments, and
you can easily pass references.

-- 
Matthew Weier O'Phinney   | WEBSITES:
Webmaster and IT Specialist   | http://www.garden.org
National Gardening Association| http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org
mailto:[EMAIL PROTECTED] | http://vermontbotanical.org

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



Re: [PHP] Problem With System Call

2005-05-19 Thread Michael Stearne
Yes, SELinux is enabled by default on Fedora Core 3.  So What I did was:

setsebool httpd_disable_trans true
/etc/init.d/httpd restart

That seems to work!  It removed all SELinux enhancements to the httpd though.

Michael



On 5/19/05, Brandon Ryan [EMAIL PROTECTED] wrote:
 I think what Kim is asking is, on your copy of RedHat Fedora Core 3,
 is are the SELinux security features enabled?
 
 On 5/19/05, Michael Stearne [EMAIL PROTECTED] wrote:
  No.  It's RedHat Fedora Core 3.
 
  Michael
 
 
  On 5/19/05, Kim Madsen [EMAIL PROTECTED] wrote:
-Original Message-
From: Michael Stearne [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 19, 2005 9:10 AM
  
I am having the strangest problem using system() or exec() or any
variation.  None of them work on the Fedora Core 3 system that was
just loaded.  The PHP is Version 4.3.9 with Apache 2.0.52, the default
installation for Fedora Core 3.  Everything in PHP works as expected
except when trying a system call.  If I run :
   
?
system(/bin/ls /tmp);
?
   
on my OS X (Apache/1.3.33 (Darwin) PHP/4.3.4) this returns the desired
results, a listing of the tmp directory.  On the Fedora box I get
nothing, a blank page.  There is content in the /tmp directory on the
Fedora box.
  
   Are You perhaps running SElinux?
  
   --
   Med venlig hilsen / best regards
   ComX Networks A/S
   Kim Madsen
   Systemudvikler/Systemdeveloper
  
   --
   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



Re: [PHP] upload videos (might be a bit 0T)

2005-05-19 Thread Philip Hallstrom
Hey,
I dont really know if this is a good idea so need more advise than anything.
My cousins in the US and Canada want to send us some home movies (not 
that I like home movies ##yuck##) but the rest of my family wants to see 
them.

We have a dedicated server which will easily handle a couple of gigs...I 
was thinking of allowing them to upload the movies to the server and 
download it here (Sweden)

Any suggestions on how to do this? Normal upload form with PHP and 
increase timeout on server? or some P2P method? I dont think they know 
much about FTP or i would have given them a directory on the server to 
upload to.
Can't think of an obvious reason why it isn't a good idea.  It's at least 
as secure as plain FTP.  And if you can put it under HTTPS should be fine 
for what you want to do.

Take a look here for apps.  There's a couple in the FTP section that say 
they do exactly what you want.

http://www.zend.com/apps.php?CID=257
-philip
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] upload videos (might be a bit 0T)

2005-05-19 Thread Leif Gregory
Hello Ryan,

Thursday, May 19, 2005, 10:57:55 AM, you wrote:
R Any suggestions on how to do this? Normal upload form with PHP and
R increase timeout on server? or some P2P method? I dont think they
R know much about FTP or i would have given them a directory on the
R server to upload to.

Have them burn it to a CD and mail it to you, then you put it on the
server for download.

Most people's upstream rates are abysmal unless you paid extra for
synchronous DSL / Cable. If they're sitting on a T1 or something maybe
a different story.


-- 
Leif (TB lists moderator and fellow end user).

Using The Bat! 3.5 Return RC9 under Windows XP 5.1
Build 2600 Service Pack 2 on a Pentium 4 2GHz with 512MB

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



Re: [PHP] PHPMAILER and sockets

2005-05-19 Thread Richard Lynch
On Thu, May 19, 2005 11:15 am, Fernando Cosso said:
 Hello
 I have 3 accounts at http://100webspace.com/, and I use the phpmailer
 class to send mails through smtp.yahoo.com.ar (Argentina). The problem
 is that the script works fine at freefronhost.com and also in
 goldeye.com, but when I use it in coconia.net It has the following
 error:

 Warning: fsockopen(): unable to connect to smtp.mail.yahoo.com.ar:25
 in /home/www/htdocs/cemz/includes/class.smtp.php on line 105

 I checked the phpinfo and it says that sockets are enabled.
 So I wrote to the support and they said me:

 Hello,
 Your plan hava a restriction for sending mails. SMTP is not allowed.

 :| :S

 But all the accounts are free.

Is the non-working account newer?

They may have changed policies, or they may just have gotten smarter at
configuring PHP and their servers to not let you do what they don't want
you to do.


-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] Re: Looking for a developer's weblog/cms system?

2005-05-19 Thread Philip Hallstrom
* Philip Hallstrom [EMAIL PROTECTED]:
[snip]
I'm thinking it might be nice to have an easy to use web-based cms system
that I could post this sort of stuff too and assign it to a category and
then let google index it.
[snip]
I've used a variety of wikis; you just have to choose one and run with
it. I'm not familiar with many blog packages, but do use Serendipity
(http://www.s9y.org), and have played a little with Jaws
(http://www.jaws-project.com/index.php); they have some nice features
and are relatively easy to set up.
Thanks, I'll take a look at those...
Basically, I want a way to post things I think others might find useful.
I'm not interested in user comments.  I don't care about RSS.  I would
like to easily be able to mark things as code or type this at a shell
prompt as well as link to entire source files, etc.
If you'r interested in posting things I think others might find
useful, why are you not interested in RSS? How will *others* know when
you've posted something new? I find that RSS is a great tool for me to
keep track of developers, projects, and other sundries. I rarely use my
bookmarks anymore.
Hmm... well, I guess what I meant to say is I'm not interested in all that 
trackback/ping stuff.  I have no delusions that my site will get about 1 
visitor a day... me.  I just want a place to put things that I can point 
people to if it's relevant... so in that regards, RSS isn't a feature I 
need... I'd rather have a really clean way to post blocks of code...

If all else fails... you're a PHP developer -- code your own!
Heh.  I was afraid you were going to say that :-)  if it comes to that 
I'll hack up one of the existing ones to do what I want... there's already 
too many of them out there :)

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


[PHP] Empty string problem

2005-05-19 Thread Kristen G. Thorson
Following is a snippet of code that I am trying to debug.  Most of the 
time, the variable $sn (set on the last line), correctly contains the 
variable $this_customer_num.  On some occasions, however, it does not 
contain $this_customer_num.  I cannot figure out what may be happening 
that this value is missing around 1-10% of the time.

?php
$memberchecker=mysql_query(SELECT id, password, customer_num FROM 
logins WHERE email = '$email' );
//email is unique and not null

if (!$memberchecker) {
  
   //handle error

} else {
   if (mysql_num_rows($memberchecker) = 1) {
   while ($row = mysql_fetch_array($memberchecker)) {
   $this_login_password=$row[password];
   if ($this_login_password==$password) {
   //$password is a form variable (yes register_globals is 
on...*sigh*)

   $this_customer_num=$row[customer_num];
   $companycheck=mysql_query(SELECT priority, cash_price 
FROM customers WHERE customer_num='$this_customer_num'); //customer_num 
is primary key, so unique and not null

   if (!$companycheck) {
   //handle error
   } else {
   if (mysql_num_rows($companycheck) == 1) {
   while ($cow = mysql_fetch_array($companycheck)) {
   $id=$row[id];
   $priority=$cow[priority];
   $cp=$cow[cash_price];
   $sn=date(Sz).$this_customer_num.time();
?
Before anyone yells at me, no I did not write this code.  I first 
thought there might be a problem with the array keys not being quoted, 
but if that were the case, and an empty string were assigned to 
$this_customer_num, then I should not be able to pass the second query, 
since there are no empty string customer_num entries (all of them are at 
least 9 characters in length).

I have been unable to reproduce an instance where $sn is missing the 
$this_customer_num variable, and I'm stuck in a kind of political 
situation where I can only make recommendations, and not change the code 
myself.

Suggestions on where to start looking? Thanks in advance.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] System Call Troubles

2005-05-19 Thread José Luis Palacios Vergara
[EMAIL PROTECTED]

- Original Message - 
From: Rasmus Lerdorf [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; php-general@lists.php.net
Sent: Thursday, May 19, 2005 12:57 PM
Subject: Re: [PHP] System Call Troubles


 Michael Stearne wrote:
  I am having the strangest problem using system() or exec() or any
  variation.  None of them work on the Fedora Core 3 system that was
  just loaded.  The PHP is Version 4.3.11 with Apache 2.0.52, the default
  installation for Fedora Core 3.  Everything in PHP works as expected
  except when trying a system call.  If I run :
  
  ?
  system(/bin/ls /tmp);
  ?
  
  on my OS X (Apache/1.3.33 (Darwin) PHP/4.3.4) this returns the desired
  results, a listing of the tmp directory.  On the Fedora box I get
  nothing, a blank page.  There is content in the /tmp directory on the
  Fedora box.
 
 These sorts of problems are easy to debug.  Switch to your web server
 user id and issue the same command.  You will most often find you have a
 permission problem, or in the Fedora/Redhat world you will find that
 SELinux is yanking your chain.  You may want to read through:
 
   http://fedora.redhat.com/docs/selinux-faq-fc3/
 
 -Rasmus
 
 -- 
 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] Image Verification - Problems in Safari, Mac OS X

2005-05-19 Thread Marek Kilimajer
Rahul S. Johari wrote:
On 5/18/05 6:23 PM, Marek Kilimajer [EMAIL PROTECTED] wrote:

BTW, you might not be concerned about it much, but you have a race
condition in your script.

Ave,
What do you mean by race condition ?
If more then one user is accesing the page, you might overwrite the 
first one's verify.png image. Simple and sufficient solution is to 
append a random string to the filename:

$image_filename= 'verify_' . md5(rand()) . '.png';
ImagePNG($im, $image_filename);
?
img src=?php echo $image_filename; ? width=200 height=40
?php
Just remember to add some way to remove old images.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Image Verification - Problems in Safari, Mac OS X

2005-05-19 Thread Rory Browne
if you have an image generated by
http://www.example.com/createimage.php , you could always refer to it
as http://www.example.com/createimage.php/{no_of_seconds_since_unix_epoch}.png

On 5/19/05, Rahul S. Johari [EMAIL PROTECTED] wrote:
 
 On 5/19/05 10:59 AM, Murray @ PlanetThoughtful
 [EMAIL PROTECTED] wrote:
 
 
  Try forcing the browser to bypass the cache by adding the lines at the
  following link to your page:
 
  http://www.faqts.com/knowledge_base/view.phtml/aid/21068/fid/51
 
 I thought this would definitely work because it looks like exactly what I
 need. IE is picking up the image from the cache no matter what.. And it
 seemed this piece of code is exactly for that, so that IE doesn't pick up
 images/data from the cache. But it's still not working! IE is still indeed
 picking up the image from the cache.
 
 This is how the beginning of my php page looks like:
 
 ?php
 session_start();
 header (Expires: Mon, 26 Jul 1997 05:00:00 GMT); // Date in the past
 header (Last-Modified:  . gmdate(D, d M Y H:i:s) .  GMT);
 header (Cache-Control: no-cache, must-revalidate); // for HTTP/1.1
 header (Pragma: no-cache); // for HTTP/1.0
 ?
 
 Stll... IE is displaying the image that has already been displayed on first
 login attempt... It won't display new Image untill you actually physically
 hit the REFRESH button on the browser.
 
 Any suggestions?
 
 Rahul S. Johari
 Coordinator, Internet  Administration
 Informed Marketing Services Inc.
 251 River Street
 Troy, NY 12180
 
 Tel: (518) 266-0909 x154
 Fax: (518) 266-0909
 Email: [EMAIL PROTECTED]
 http://www.informed-sources.com
 
 --
 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] OT - Help creating Tables

2005-05-19 Thread kevin
Hi,

 

I am working on a program for a clothing manufacture and need some help
designing the tables for the database. I have to track the inventory levels
of each style by color and size and can not figure the tables out. Here is
the information I need to track.

 

Style number

Color

Size (can have from 1 to 10 different sizes)

 

Also need to track the transactions. Receipt Number for incoming inventory
and Invoice number for outgoing. 

 

Can anyone help me figure out how to setup the tables? Once that is done, I
think I can get the rest working.

 

Thanks!!!

Kevin

 

 



[PHP] OT - Table help needed~ PLEASE

2005-05-19 Thread kevin
Hi,

I am working on a program for a clothing manufacture and need some help
designing the tables for the database. I have to track the inventory levels
of each style by color and size and can not figure the tables out. Here is
the information I need to track.

Style number
Color
Size (can have from 1 to 10 different sizes)

Also need to track the transactions. Receipt Number for incoming inventory
and Invoice number for outgoing. 

Can anyone help me figure out how to setup the tables? Once that is done, I
think I can get the rest working.

Thanks!!!
Kevin

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



[PHP] PHP and SSH

2005-05-19 Thread Pablo Gosse
Hi, folks.  Has anyone had any issues using PHP with the libssh2
library?

I had my sysadmin install it, but he's not certain we should be
developing against it in a production environment since it's still alpha
(0.10).

I'm looking for opinions as to whether anyone out there has run into
problems developing against it, or if the general consensus is that
there are no critical concerns about using it as a core part of a large
project.

I personally don't think there are, since I don't think that PHP would
have bindings to this library if it weren't, but I want to have some
other feedback to give to my sysadmin?

Anyone have any opinions?

Cheers and TIA,

Pablo   

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