[PHP] Is this possible with php

2006-03-06 Thread Mace Eliason


Hi,

I really don't think this is possible from what I know of php, but I 
thought I would as the experts.


Is it possible to have php create directories and move files on a local 
machine. I have created a web portal for a client and now they would 
like it to upload files to an server, no a problem. But they would like 
it to also move temp files on the users computer to new directories and 
then upload the file to the server with no user interation other than 
clicking go.


I have thought of doing this in vb or c# but I have done very little 
with these languages, and php just rocks.


Thanks

Scandog

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



Re: [PHP] is this possible in PHP?

2005-05-04 Thread Richard Collyer
[EMAIL PROTECTED] wrote:
I'd make a script that went through the httpd.conf file with DOM and
pulled out all the virtual hosts.  Either that or looked at the home
directory listings for each site.  If this is what you were getting at
(seeing as you mentioned root access and what-not), then read the next
paragraph.  If not, you can skip the next paragraph.
This is quite a dangerous thing to do.  Giving PHP root access to your
server is like giving a homeless guy your credit card.  Anyone can
access the resources that PHP uses if they try hard enough.  You might
as well just hand every hacker on the web a little Post-It note with
your root password on it.
Indeed it is. Why don't you have the httpd.conf then the virtual domains 
in another file (which is included into the httpd.conf). You can then 
use a cron to copy this (the vir doms) to another file (say the dir 
above webroot) and chown it to www:www for use with apache. PHP can then 
read this parse the ServerNames without having it read the root dirs or 
giving it special access rights.

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


Re: [PHP] is this possible in PHP?

2005-05-04 Thread disguised.jedi
> I want a script that can display a list of all the websites currently
> hosted on my server.. (i have root access to the server)
>
> Say I have a page sitesonmyserver.php..it shud show a list of all the
> websites hosted on my server..eg:
> abc.com
> xyz.om
>
> And any additional info if possible?

I'd make a script that went through the httpd.conf file with DOM and
pulled out all the virtual hosts.  Either that or looked at the home
directory listings for each site.  If this is what you were getting at
(seeing as you mentioned root access and what-not), then read the next
paragraph.  If not, you can skip the next paragraph.

This is quite a dangerous thing to do.  Giving PHP root access to your
server is like giving a homeless guy your credit card.  Anyone can
access the resources that PHP uses if they try hard enough.  You might
as well just hand every hacker on the web a little Post-It note with
your root password on it.

> Is such a thing possible in PHP.. or does any such script exists?

Definitely.  If you take the right approach!  I'd use a database.  You
could certainly find a class or script that could accomplish the
database lookup that would get what you wanted.

I'd start by reading the manual sections on mySQL database queries.

http://us4.php.net/mysql

Hope this helps!

--
The Disguised Jedi
[EMAIL PROTECTED]

Now you have my $0.02.  Or .01 Pounds, .014 Euros, or $0.025 CAN.  I'm
world-wide BABY!
PHP rocks!
"Knowledge is Power.  Power Corrupts.  Go to school, become evil"

Disclaimer: Any disclaimer attached to this message may be ignored.
However, I must say that the ENTIRE contents of this message are
subject to other's criticism, corrections, and speculations.

This message is Certified Virus Free

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



Re: [PHP] is this possible in PHP?

2005-05-03 Thread Rasmus Lerdorf
Dasmeet Singh wrote:
Hi!
I want a script that can display a list of all the websites currently 
hosted on my server.. (i have root access to the server)

Say I have a page sitesonmyserver.php..it shud show a list of all the 
websites hosted on my server..eg:
abc.com
xyz.om

And any additional info if possible?
Is such a thing possible in PHP.. or does any such script exists?
Generally, no.  You would need some black magic that probed the guts of 
your web server for this information.  And by black magic I mean some 
low-level C code.

A bit of grey magic I wrote almost exactly 9 years ago now! (May 1, 
1996) in the form of Apache's mod_info module might help you out a 
little bit.  If you define all your vhosts in your httpd.conf file and 
not in included files, then you can enable mod_info in your Apache 
config, and restrict access to the information to localhost with 
something like:

  
SetHandler server-info
Order deny,allow
Deny from all
Allow from 127.0.0.1
  
Then your PHP code would hit your server's local /server-info link and 
parse it with something along the lines of:

  $info = file_get_contents('http://localhost/server-info?http_core.c');
  preg_match_all('/.*servername <.*?>(\S+?)<.*/i',$info,$reg);
  $vhosts = $reg[1];
You may need to doublecheck that regex.  I didn't actually test it.
-Rasmus
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] is this possible in PHP?

2005-05-03 Thread Kim Madsen

> -Original Message-
> From: Dasmeet Singh [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, May 03, 2005 9:03 AM


> I want a script that can display a list of all the websites currently
> hosted on my server.. (i have root access to the server)
> 
> Say I have a page sitesonmyserver.php..it shud show a list of all the
> websites hosted on my server..eg:
> abc.com
> xyz.om
> 
> And any additional info if possible?
> 
> Is such a thing possible in PHP.. or does any such script exists?

If You´re running Apache, parse the httpd.conf and echo the line containing 
ServerName?


--
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] is this possible in PHP?

2005-05-03 Thread Dasmeet Singh
Hi!
I want a script that can display a list of all the websites currently 
hosted on my server.. (i have root access to the server)

Say I have a page sitesonmyserver.php..it shud show a list of all the 
websites hosted on my server..eg:
abc.com
xyz.om

And any additional info if possible?
Is such a thing possible in PHP.. or does any such script exists?
Thanks in advance!
Dasmeet
SayOrange.com
How to choose the best web hosting?
http://www.sayorange.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Is this possible ?

2004-01-19 Thread Dagfinn Reiersøl
An object-oriented way of doing it: keep the extra result in a member variable and
get it separately. You might not find this necessary, but it gets more useful
in more complex cases.
class MyClass {
 var $num;
 Function MyFunc(){
   if(isset($_POST['var'])){
 $sql = mysql_query("select * from table_name where field=\"$_POST[var]\"
 ");
 $this->num = mysql_num_rows($sql); 

   $returnsomething ="blah blah";
   }
   return $returnsomething;
 }
 function getCount() { return $this->num; }

}



Dave Carrera wrote:

Hi List,

I have a function that makes a call to mysql based on certain vars.

---example

Function MyFunc(){
if(isset($_POST[var])){
$sql = mysql_query("select * from table_name where field=\"$_POST[var]\"
");
$returnsomething ="blah blah";
}
return $returnsomething;
}
And that all works fine no probs here but.

I want to use a result somewhere in my script that is not returned by
return. Let me show you...
---example

Function MyFunc(){
if(isset($_POST[var])){
$sql = mysql_query("select * from table_name where field=\"$_POST[var]\"
");
$num = mysql_num_rows($sql); // I want to use this result outside this
function.
$returnsomething ="blah blah";
}
return $returnsomething;
}
So $num contains a number that I want to use outside the function which is
not covered by return.
I know return stops a script and returns what I want it to return but how do
I send out of the function the var I want.
I have tried $GLOBAL[var]=$num; but that don’t work, but I thought I
would'nt anyway just tried it and yes I know I have to declare it inside my
new function using global $var; to use it.
So I ask is this achiveable or how can I do this.

Thank you in advance

Dave C

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.560 / Virus Database: 352 - Release Date: 08/01/2004


 

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


RE: [PHP] Is this possible ?

2004-01-18 Thread Larry Brown
Toby's solution still holds in this scenario.  Actually exactly has you have
rem'ed out.  You get back two components to the array, first array[0] holds
the concatenated string you made with the while loop and the second array[1]
holds the total number of result rows from your query.

Larry

-Original Message-
From: Dave Carrera [mailto:[EMAIL PROTECTED]
Sent: Sunday, January 18, 2004 6:11 AM
To: 'Toby Irmer'
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Is this possible ?


Thanks Toby,

But I forgot to mention something that makes retuning an array not usable in
the context of my needs.



As you can see with my ammeded example I am already returning and array.

I thought I could cast the result $num into the $GLOBAL array for use later
but that dose not seem to work or be do able.

I could relicate the function and call it something else say MyFunc2() but
that seems a waste of code and mysql connection load when I am already
retrieving the var I want to use.

Any further ideas are appreciated.

Dave C

-Original Message-
From: Toby Irmer [mailto:[EMAIL PROTECTED]
Sent: 18 January 2004 10:29
To: Dave Carrera; [EMAIL PROTECTED]
Subject: Re: [PHP] Is this possible ?


One way:



hth

toby

- Original Message -
From: "Dave Carrera" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, January 18, 2004 11:22 AM
Subject: [PHP] Is this possible ?


Hi List,

I have a function that makes a call to mysql based on certain vars.

---example

Function MyFunc(){
 if(isset($_POST[var])){
 $sql = mysql_query("select * from table_name where field=\"$_POST[var]\"
");  $returnsomething ="blah blah";  }  return $returnsomething; }

And that all works fine no probs here but.

I want to use a result somewhere in my script that is not returned by
return. Let me show you...

---example

Function MyFunc(){
 if(isset($_POST[var])){
 $sql = mysql_query("select * from table_name where field=\"$_POST[var]\"
");

 $num = mysql_num_rows($sql); // I want to use this result outside this
function.

$returnsomething ="blah blah";
 }
 return $returnsomething;
}

So $num contains a number that I want to use outside the function which is
not covered by return.

I know return stops a script and returns what I want it to return but how do
I send out of the function the var I want.

I have tried $GLOBAL[var]=$num; but that don’t work, but I thought I
would'nt anyway just tried it and yes I know I have to declare it inside my
new function using global $var; to use it.

So I ask is this achiveable or how can I do this.

Thank you in advance

Dave C


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.560 / Virus Database: 352 - Release Date: 08/01/2004



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



---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.560 / Virus Database: 352 - Release Date: 08/01/2004


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.560 / Virus Database: 352 - Release Date: 08/01/2004


--
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 this possible ?

2004-01-18 Thread Dave Carrera
Hi Again,

Fixed it.

Took my code inside the function that needed to return two vars / values for
use and made it a standard if else statement.

Amended other areas and all works as I wanted it.

I would still appreciate comments about what I was trying to do with the
function approach.

Thank you 

Dave C


-Original Message-
From: Toby Irmer [mailto:[EMAIL PROTECTED] 
Sent: 18 January 2004 10:29
To: Dave Carrera; [EMAIL PROTECTED]
Subject: Re: [PHP] Is this possible ?


One way:



hth

toby

- Original Message -
From: "Dave Carrera" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, January 18, 2004 11:22 AM
Subject: [PHP] Is this possible ?


Hi List,

I have a function that makes a call to mysql based on certain vars.

---example

Function MyFunc(){
 if(isset($_POST[var])){
 $sql = mysql_query("select * from table_name where field=\"$_POST[var]\"
");  $returnsomething ="blah blah";  }  return $returnsomething; }

And that all works fine no probs here but.

I want to use a result somewhere in my script that is not returned by
return. Let me show you...

---example

Function MyFunc(){
 if(isset($_POST[var])){
 $sql = mysql_query("select * from table_name where field=\"$_POST[var]\"
");

 $num = mysql_num_rows($sql); // I want to use this result outside this
function.

$returnsomething ="blah blah";
 }
 return $returnsomething;
}

So $num contains a number that I want to use outside the function which is
not covered by return.

I know return stops a script and returns what I want it to return but how do
I send out of the function the var I want.

I have tried $GLOBAL[var]=$num; but that don’t work, but I thought I
would'nt anyway just tried it and yes I know I have to declare it inside my
new function using global $var; to use it.

So I ask is this achiveable or how can I do this.

Thank you in advance

Dave C


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.560 / Virus Database: 352 - Release Date: 08/01/2004



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



---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.560 / Virus Database: 352 - Release Date: 08/01/2004
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.560 / Virus Database: 352 - Release Date: 08/01/2004
 

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



RE: [PHP] Is this possible ?

2004-01-18 Thread Dave Carrera
Thanks Toby,

But I forgot to mention something that makes retuning an array not usable in
the context of my needs.



As you can see with my ammeded example I am already returning and array.

I thought I could cast the result $num into the $GLOBAL array for use later
but that dose not seem to work or be do able.

I could relicate the function and call it something else say MyFunc2() but
that seems a waste of code and mysql connection load when I am already
retrieving the var I want to use.

Any further ideas are appreciated.

Dave C

-Original Message-
From: Toby Irmer [mailto:[EMAIL PROTECTED] 
Sent: 18 January 2004 10:29
To: Dave Carrera; [EMAIL PROTECTED]
Subject: Re: [PHP] Is this possible ?


One way:



hth

toby

- Original Message -
From: "Dave Carrera" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, January 18, 2004 11:22 AM
Subject: [PHP] Is this possible ?


Hi List,

I have a function that makes a call to mysql based on certain vars.

---example

Function MyFunc(){
 if(isset($_POST[var])){
 $sql = mysql_query("select * from table_name where field=\"$_POST[var]\"
");  $returnsomething ="blah blah";  }  return $returnsomething; }

And that all works fine no probs here but.

I want to use a result somewhere in my script that is not returned by
return. Let me show you...

---example

Function MyFunc(){
 if(isset($_POST[var])){
 $sql = mysql_query("select * from table_name where field=\"$_POST[var]\"
");

 $num = mysql_num_rows($sql); // I want to use this result outside this
function.

$returnsomething ="blah blah";
 }
 return $returnsomething;
}

So $num contains a number that I want to use outside the function which is
not covered by return.

I know return stops a script and returns what I want it to return but how do
I send out of the function the var I want.

I have tried $GLOBAL[var]=$num; but that don’t work, but I thought I
would'nt anyway just tried it and yes I know I have to declare it inside my
new function using global $var; to use it.

So I ask is this achiveable or how can I do this.

Thank you in advance

Dave C


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.560 / Virus Database: 352 - Release Date: 08/01/2004



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



---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.560 / Virus Database: 352 - Release Date: 08/01/2004
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.560 / Virus Database: 352 - Release Date: 08/01/2004
 

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



Re: [PHP] Is this possible ?

2004-01-18 Thread Toby Irmer
One way:



hth

toby

- Original Message -
From: "Dave Carrera" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, January 18, 2004 11:22 AM
Subject: [PHP] Is this possible ?


Hi List,

I have a function that makes a call to mysql based on certain vars.

---example

Function MyFunc(){
 if(isset($_POST[var])){
 $sql = mysql_query("select * from table_name where field=\"$_POST[var]\"
");
 $returnsomething ="blah blah";
 }
 return $returnsomething;
}

And that all works fine no probs here but.

I want to use a result somewhere in my script that is not returned by
return. Let me show you...

---example

Function MyFunc(){
 if(isset($_POST[var])){
 $sql = mysql_query("select * from table_name where field=\"$_POST[var]\"
");

 $num = mysql_num_rows($sql); // I want to use this result outside this
function.

$returnsomething ="blah blah";
 }
 return $returnsomething;
}

So $num contains a number that I want to use outside the function which is
not covered by return.

I know return stops a script and returns what I want it to return but how do
I send out of the function the var I want.

I have tried $GLOBAL[var]=$num; but that don’t work, but I thought I
would'nt anyway just tried it and yes I know I have to declare it inside my
new function using global $var; to use it.

So I ask is this achiveable or how can I do this.

Thank you in advance

Dave C


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.560 / Virus Database: 352 - Release Date: 08/01/2004



--
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] Is this possible ?

2004-01-18 Thread Dave Carrera
Hi List,

I have a function that makes a call to mysql based on certain vars.

---example

Function MyFunc(){
 if(isset($_POST[var])){
 $sql = mysql_query("select * from table_name where field=\"$_POST[var]\"
");
 $returnsomething ="blah blah";
 }
 return $returnsomething;
}

And that all works fine no probs here but.

I want to use a result somewhere in my script that is not returned by
return. Let me show you...

---example

Function MyFunc(){
 if(isset($_POST[var])){
 $sql = mysql_query("select * from table_name where field=\"$_POST[var]\"
");

 $num = mysql_num_rows($sql); // I want to use this result outside this
function.

$returnsomething ="blah blah";
 }
 return $returnsomething;
}

So $num contains a number that I want to use outside the function which is
not covered by return.

I know return stops a script and returns what I want it to return but how do
I send out of the function the var I want.

I have tried $GLOBAL[var]=$num; but that don’t work, but I thought I
would'nt anyway just tried it and yes I know I have to declare it inside my
new function using global $var; to use it.

So I ask is this achiveable or how can I do this.

Thank you in advance

Dave C


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.560 / Virus Database: 352 - Release Date: 08/01/2004
 


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



RE: [PHP] Is this possible?

2003-10-16 Thread Joseph Bannon
> Write a small script and see.


Yep, it worked. Thanks

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



Re: [PHP] Is this possible?

2003-10-16 Thread Raquel Rice
On Thu, 16 Oct 2003 10:36:38 -0500
"Joseph Bannon" <[EMAIL PROTECTED]> wrote:

> Is it possible to set two variables at once like this...
> 
> $test = $variable = 5;
> 

Yes.

--
Raquel

To sin by silence when they should protest makes cowards out of men.
  --Abraham Lincoln

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



Re: [PHP] Is this possible?

2003-10-16 Thread Robert Cummings
Write a small script and see.

Rob.

On Thu, 2003-10-16 at 11:36, Joseph Bannon wrote:
> Is it possible to set two variables at once like this...
> 
> $test = $variable = 5;
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



[PHP] Is this possible?

2003-10-16 Thread Joseph Bannon
Is it possible to set two variables at once like this...

$test = $variable = 5;

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



Re: [PHP] is this possible?

2003-09-27 Thread Jason Sheets
It sounds to me like you are having them update their information on a 
central admin control panel for their site.

There are a couple problems with your proposed method, first the .php 
file by default will get parsed by their server before it is sent to you 
so you will not be able to include it  because you will get the 
evaulated resulte.  Second even if including this file over the Internet 
worked it would be very insecure, you are passing the file over 
unencrypted HTTP which means the database password and login could 
easilly be sniffed.  Even if you were to use SSL you would still need to 
restrict access to the script because someone could simply access the 
same page and get their database information. Third you should use an 
SSL encrypted database link if you are reaching out over the Internet 
also to prevent the database password and login from being sniffed 
(MySQL and PostgreSQL support SSL, you could also use SSH or stunnel to 
create a tunnel).

My control panels are generally local to the site that way there is no 
reaching out.  Perhaps you should create a method in your application 
for an "update user" that is allowed to update other user's websites, 
now this user is assigned a pasword when you want to update a user you 
connect over SSL with the update user's login and password and the user 
login and new password you want to update it to. 

Another method is to use a hash technique on the user's current password 
and send the hash along with the user's login name and new hashed 
password, you could assume that if the current password matched the 
current password hash the password and information was a valid update 
request and could be updated.  Basically you shift the updating onto the 
client's site and you send a push to initiaite the update.

Jason

[ PAUL FERRIE ] wrote:

Hi guys,
I am have created several websites(flash) with admin areas so that the
clients can update sections of there site.
I have created a little admin section on my own site(yet to be published).
there is a client login area for client who's site's i have built. Here they
have the option to change the login details for ther on DB's, follow?
So far i have go it working.  Details get updated on my server DB.
Now it gets tricky for me.
I am trying to figure out the best way of  updating the clients db(Diffrent
server) with the new login details.
I thought i would do something like

php:// Updates clients details on my DB server
http://www.server1.com/php/common.php";;
$common2="http://www.server2.com/php/common.php";;
$common3="http://www.server3.com/php/common.php";;
$common4="http://www.server4.com/php/common.php";;
//
include('$common1');//one of the four above
$link = dbConnect();
// Attempt to authorise user with database
$userID = auth($username, $password);
// If authorisation failed...
if ($userID == -1) {
   // Inform Flash and quit
   fail("Invalid username and/or password");
}
//set new username and password
$crypt2 = md5($password2);
$query = "UPDATE admin SET username = '$username2', password = '$crypt2'
WHERE userID = '$userID'";
if(!mysql_query($query)) {
   fail("Error updating admin");
}
print "retval=1";
?>
Can the common.php file and the variables in this code be sent across the
server?
One other thing
The Db's on the four severs are identical
I hope i have explained what i am trying to do.
cheers

Paul

 

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


[PHP] is this possible?

2003-09-27 Thread \[ PAUL FERRIE \]
Hi guys,
I am have created several websites(flash) with admin areas so that the
clients can update sections of there site.

I have created a little admin section on my own site(yet to be published).
there is a client login area for client who's site's i have built. Here they
have the option to change the login details for ther on DB's, follow?
So far i have go it working.  Details get updated on my server DB.
Now it gets tricky for me.
I am trying to figure out the best way of  updating the clients db(Diffrent
server) with the new login details.

I thought i would do something like

php:// Updates clients details on my DB server
http://www.server1.com/php/common.php";;
$common2="http://www.server2.com/php/common.php";;
$common3="http://www.server3.com/php/common.php";;
$common4="http://www.server4.com/php/common.php";;
//
include('$common1');//one of the four above
$link = dbConnect();
// Attempt to authorise user with database
$userID = auth($username, $password);
// If authorisation failed...
if ($userID == -1) {
// Inform Flash and quit
fail("Invalid username and/or password");
}
//set new username and password
$crypt2 = md5($password2);
$query = "UPDATE admin SET username = '$username2', password = '$crypt2'
WHERE userID = '$userID'";
if(!mysql_query($query)) {
fail("Error updating admin");
}

print "retval=1";
?>
Can the common.php file and the variables in this code be sent across the
server?
One other thing
The Db's on the four severs are identical
I hope i have explained what i am trying to do.

cheers

Paul

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



RE: [PHP] Is this possible?

2003-07-23 Thread Tony Crockford

> Umm, you mean like:
>
> select i.id,d.description from items i, descriptions d where
> d.itemid =
> i.id;
>
> ?

Of course I do!

How stupid am I?

No, don't answer that - it's been a long week working on the wrong
stuff!


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



Re: [PHP] Is this possible?

2003-07-23 Thread Adam Voigt
Umm, you mean like:

select i.id,d.description from items i, descriptions d where d.itemid =
i.id;

?

On Wed, 2003-07-23 at 12:32, Tony Crockford wrote:
> Hi
> 
> 
> Thanks for the help on previous questions, I now have an in principle
> type question.
> 
> I have a MySQL database - "items" in one table and "descriptions" in
> another with a common key: item_ref
> It is used to create a sort of categorised directory of the items.
> (http://www.torbytes.co.uk)
> 
> 
> each table has a status field the "items" have a default description and
> the "descriptions" have a level classification.
> 
> up to now been working through all the items and printing out the
> descriptions at each level printing the default if I don't have a
> matching description, but I now need to do the following:
> 
> for a particular level print only the items (and their matching
> description) where there is a matching description. (I hope you see what
> I mean)
> 
> since the items are categorised and I don't want any dead ends in my
> tree structure I have to know if there's a description before I start
> working through the items.
> 
> I thought that this might be the way to do it:
> 
> select all the item-ref values from the description table.
> 
> step through this select array selecting the required fields from the
> item table where item_ref=item_ref and adding them to another array.
> 
> then step through that array building up the tree structure
> 
> The trouble with it as I see it is:
> 
> it's a lot of select calls to the database (one for every description
> found) and I'm not sure how to add the fields found in the item table to
> a new array.
> 
> 
> Am I going at this the wrong way?
> 
> Any help, clues or abuse accepted.
> 
> Thanks
> 
> Tony
> 
> 
> 
> --
> NEO organizes my Outlook - check it out:
> http://www.caelo.com/a/rl.php3?i=3NTVV
-- 
Adam Voigt ([EMAIL PROTECTED])
Linux/Unix Network Administrator
The Cryptocomm Group


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



[PHP] Is this possible?

2003-07-23 Thread Tony Crockford
Hi


Thanks for the help on previous questions, I now have an in principle
type question.

I have a MySQL database - "items" in one table and "descriptions" in
another with a common key: item_ref
It is used to create a sort of categorised directory of the items.
(http://www.torbytes.co.uk)


each table has a status field the "items" have a default description and
the "descriptions" have a level classification.

up to now been working through all the items and printing out the
descriptions at each level printing the default if I don't have a
matching description, but I now need to do the following:

for a particular level print only the items (and their matching
description) where there is a matching description. (I hope you see what
I mean)

since the items are categorised and I don't want any dead ends in my
tree structure I have to know if there's a description before I start
working through the items.

I thought that this might be the way to do it:

select all the item-ref values from the description table.

step through this select array selecting the required fields from the
item table where item_ref=item_ref and adding them to another array.

then step through that array building up the tree structure

The trouble with it as I see it is:

it's a lot of select calls to the database (one for every description
found) and I'm not sure how to add the fields found in the item table to
a new array.


Am I going at this the wrong way?

Any help, clues or abuse accepted.

Thanks

Tony



--
NEO organizes my Outlook - check it out:
http://www.caelo.com/a/rl.php3?i=3NTVV


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



RE: [PHP] Is this possible?

2003-06-11 Thread Jay Blanchard
[snip]
Please read these pages:
http://de.php.net/release_4_1_0.php
http://de.php.net/manual/en/security.registerglobals.php

if your PHP setting called register_globals is turned on, then the code
you 
propose would allow hackers to ask anything they want to your database, 
including destructive options.
[/snip]

UNLESS you declare and check your variables!

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



Re: [PHP] Is this possible?

2003-06-11 Thread Chris Hayes
At 18:06 11-6-03, you wrote:
Hey,
Whats the problem with this "table"
? its a perfectly legal bit of HTML...wheres your doubt?
in index.php just get the variable like this
$blah=$_GET['tablename'];
then run $blah in your select query.
Either this is just too simple or i dont really understand what you are
trying to do...
> $query = "SELECT * FROM $table";
well because when he has his globals turned off the $table var will not 
have a value.

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


Re: [PHP] Is this possible?

2003-06-11 Thread Chris Hayes
Please read these pages:
http://de.php.net/release_4_1_0.php
http://de.php.net/manual/en/security.registerglobals.php
if your PHP setting called register_globals is turned on, then the code you 
propose would allow hackers to ask anything they want to your database, 
including destructive options.

At 16:59 11-6-03, you wrote:
Hello PHP List,

I would like to use links such as:

table

The resulting page would have a line on it like such:

$query = "SELECT * FROM $table";

Is this possible? If so, is there maybe a better way to do this?

Also, is it possible to show the names of the tables in PHP page?

Thanks,

-Steve Marquez

--
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 this possible?

2003-06-11 Thread Ryan A
Hey,
Whats the problem with this "table"
? its a perfectly legal bit of HTML...wheres your doubt?

in index.php just get the variable like this
$blah=$_GET['tablename'];

then run $blah in your select query.
Either this is just too simple or i dont really understand what you are
trying to do...

Cheers,
-Ryan

- Original Message -
From: "Steve Marquez" <[EMAIL PROTECTED]>
To: "PHP eMail List" <[EMAIL PROTECTED]>
Sent: Wednesday, June 11, 2003 3:59 PM
Subject: [PHP] Is this possible?


> Hello PHP List,
>
> I would like to use links such as:
>
> table
>
> The resulting page would have a line on it like such:
>
> $query = "SELECT * FROM $table";
>
> Is this possible? If so, is there maybe a better way to do this?
>
> Also, is it possible to show the names of the tables in PHP page?
>
> Thanks,
>
> -Steve Marquez
>
>
> --
> 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] Is this possible?

2003-06-11 Thread Steve Marquez
Hello PHP List,

I would like to use links such as:

table

The resulting page would have a line on it like such:

$query = "SELECT * FROM $table";

Is this possible? If so, is there maybe a better way to do this?

Also, is it possible to show the names of the tables in PHP page?

Thanks,

-Steve Marquez


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



Re: [PHP] Is this possible? Group related results from mysql to one field…

2003-03-08 Thread Marek Kilimajer
The only way that comes to my mind is using a SET column type - in 
related table you would not wave toid relating to categories, but 
instead it would be of type SET("demonstrations","people"). This column 
can be set to
"" -empty, no category
"demonstrations"
"people"
"demonstrations,people"

But SET column is limited to 64 different members, still you can use 
more columns.

Victor Spång Arthursson wrote:

Hi!

Perhaps this is a little bit of topic, but if it's not possible to fix 
directly when the result is returning from mysql I need some tips on 
an intelligent solution...

This is the problem: I'm searching the database for files and i get 
some results. In the sql I have a LIMIT to split the result up. Every 
file can have none, one or several categories associated with it. This 
is done by having an extra table between the table with the references 
to the files and the table with the categories. What I want to do is 
to get all categories associated with an file concatenated and 
returned in _one_ field together with the other data. Look below for 
visualisation.

I'm having this main table with references to files in it:

files
+-+-+
 |  id  |   filename   |
+-+-+
 |168 |v008-12.jpg|
+-+-+
Then I have this table to relate one file to one or several categories:

relatedtable
+-++--+
 |id   |   fromid   |   toid   |
+-++--+
 |4|   1   | 2 |
 |  257  |   2   | 2 |
+-++--+
Which lies in this table for categories:

categories
++--+
 |  id   |   categoryname   | stickword
++--+
 |   5   |   demonstrations |
 |   6   |people   |
++--+
The following sql:

SELECT DISTINCT
files.id, files.filename, categories.categoryname
FROM
files
LEFT JOIN
relatedtable
ON
files.id = relateratabell.fromid
LEFT JOIN
kategorier
ON
relatedtable.toid = categories.id
WHERE
(relatedtable.fromid IS NULL OR relatedtable.fromid IS NOT NULL)
AND
   files.stickword LIKE '%basta%' //for example
ORDER BY
filename;
Gives the following result:

+---+---+--+
 |  id  | filename |   categoryname|
+---+---+--+
 | 166| v007-86.jpg | demonstrations  |
 | 166| v007-86.jpg | people   |
 | 167| v008-03.jpg | demonstrations  |
 | 167| v008-03.jpg | people  |
+---+---+--+
This is what I expected it to, but I'ld rather get a result as this one:

+---+---+--+
 |  id  | filename |   categoryname|
+---+---+--+
 | 166| v007-86.jpg | demonstrations, people|
 | 167| v008-03.jpg | demonstrations, people|
+---+---+--+
Where the categories have been collected together into the same field, 
so that I don't get multiple rows for the same file… Is this possible 
to achieve?

Many many thanks to the one who can give me some input!

Sincerely

Victor




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


[PHP] Is this possible? Group related results from mysql to one field…

2003-03-06 Thread Victor Spång Arthursson
Hi!

Perhaps this is a little bit of topic, but if it's not possible to fix 
directly when the result is returning from mysql I need some tips on an 
intelligent solution...

This is the problem: I'm searching the database for files and i get 
some results. In the sql I have a LIMIT to split the result up. Every 
file can have none, one or several categories associated with it. This 
is done by having an extra table between the table with the references 
to the files and the table with the categories. What I want to do is to 
get all categories associated with an file concatenated and returned in 
_one_ field together with the other data. Look below for visualisation.

I'm having this main table with references to files in it:

files
+-+-+
 |  id  |   filename   |
+-+-+
 |168 |v008-12.jpg|
+-+-+
Then I have this table to relate one file to one or several categories:

relatedtable
+-++--+
 |id   |   fromid   |   toid   |
+-++--+
 |4|   1   | 2 |
 |  257  |   2   | 2 |
+-++--+
Which lies in this table for categories:

categories
++--+
 |  id   |   categoryname   | stickword
++--+
 |   5   |   demonstrations |
 |   6   |people   |
++--+
The following sql:

SELECT DISTINCT
files.id, files.filename, categories.categoryname
FROM
files
LEFT JOIN
relatedtable
ON
files.id = relateratabell.fromid
LEFT JOIN
kategorier
ON
relatedtable.toid = categories.id
WHERE
(relatedtable.fromid IS NULL OR relatedtable.fromid IS NOT NULL)
AND
   files.stickword LIKE '%basta%' //for example
ORDER BY
filename;
Gives the following result:

+---+---+--+
 |  id  | filename |   categoryname|
+---+---+--+
 | 166| v007-86.jpg | demonstrations  |
 | 166| v007-86.jpg | people   |
 | 167| v008-03.jpg | demonstrations  |
 | 167| v008-03.jpg | people  |
+---+---+--+
This is what I expected it to, but I'ld rather get a result as this one:

+---+---+--+
 |  id  | filename |   categoryname|
+---+---+--+
 | 166| v007-86.jpg | demonstrations, people|
 | 167| v008-03.jpg | demonstrations, people|
+---+---+--+
Where the categories have been collected together into the same field, 
so that I don't get multiple rows for the same file… Is this possible 
to achieve?

Many many thanks to the one who can give me some input!

Sincerely

Victor

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


Re: [PHP] Is this possible with php?

2003-01-11 Thread Chris Hewitt
[EMAIL PROTECTED] wrote:


using MS Word in windows, when a file is saved, can it be AUTOMATICALLY
uploaded (via http POST or other mechanism) to a server?


Yes, in a webDAV enabled directory on your webserver 
(http://www.webdav.org). Its a module that you can compile for use with 
Apache (I'm using it under linux). M$ are one of the authors of the 
standard (RFC2518).

Currently I need to first save it on my desktop, then upload that copy
to a php-supported server.


Yes, that is the problem statement. In a webDAV enabled directory, its 
like an ordinary directory from your webserver but read/write, with file 
locking. Any authorisation your webserver supports may be used.

Nothing to do with PHP though.

Regards

Chris


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



RE: [PHP] Is this possible with php?

2003-01-11 Thread Rasmus Lerdorf
You should probably mention that this is called WebFolders in M$-speak and 
it actually works quite well when combined with the mod_dav and mod_digest 
Apache modules.

-Rasmus

On Fri, 10 Jan 2003, Timothy Hitchens (HiTCHO) wrote:

> So you want to be able to have a directory that when saved to it is
> really the server well
> besides ftp or samba integration into explorer the only other option you
> have is to use
> webdav with apache and that way it would be a post of sorts to the mod
> webdav module in apache.
> 
> 
> 
> Timothy Hitchens (HiTCHO)
> Open Platform Consulting
> e-mail: [EMAIL PROTECTED]
> 
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
> > Sent: Friday, 10 January 2003 4:06 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] Is this possible with php?
> > 
> > 
> > I would like to know if the follwing function can be 
> > implemneted in php with help of other tools:
> > 
> > using MS Word in windows, when a file is saved, can it be 
> > AUTOMATICALLY uploaded (via http POST or other mechanism) to a server?
> > 
> > Currently I need to first save it on my desktop, then upload 
> > that copy to a php-supported server.
> > 
> > Thanks in advance.
> > 
> > Tim
> > 
> > -- 
> > 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 this possible with php?

2003-01-10 Thread try
On Fri, Jan 10, 2003 at 12:00:33PM -, Danny Shepherd wrote:
> Hi,
> 
> Where did he say he wanted to use Word to edit PHP files? AFAICT the idea
> was to automatically upload Word files, presumably to make them available on
> an Intranet for download etc.

Yes, automatically upload word file after the save button is pressed.

> As for uploading a file automatically - PHP isn't going to do it. An app
> which can map a virtual drive in Windows would probably be the best bet - I
> think Windows has built in support for mapping WebDAV and FTP servers as
> shares so this may be a good starting point.

I have looked at webdav, ftp, etc. None can solve my client's problem
without a major overhaul of the system. The problem is:

My client has a document management system (implemented in php) on a server.
It does uploads without problem. However, each time, a file get modified,
it has to be saved on local disk first and uploaded to the server by
a few more clicks. It would be nice if the application (e.g.,ms words) can save
the modified file directly to the server.

I am wondering if office suite applications can be tweaked (using macros, vb?),
so that a 'save' event will trigger an action of automatic upload. Or there
is a better approach.

Tim

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




Re: [PHP] Is this possible with php?

2003-01-10 Thread Danny Shepherd
Hi,

Where did he say he wanted to use Word to edit PHP files? AFAICT the idea
was to automatically upload Word files, presumably to make them available on
an Intranet for download etc.

As for uploading a file automatically - PHP isn't going to do it. An app
which can map a virtual drive in Windows would probably be the best bet - I
think Windows has built in support for mapping WebDAV and FTP servers as
shares so this may be a good starting point.

HTH

Danny.

- Original Message -
From: "Maxim Maletsky" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, January 10, 2003 11:38 AM
Subject: Re: [PHP] Is this possible with php?


>
> [EMAIL PROTECTED] wrote... :
>
> > I would like to know if the follwing function can be implemneted
> > in php with help of other tools:
>
> in PHP distribution? PHP is the programming language, not a
> client/server tool. This is definitely something to be an integrated
> part of something else.
>
> > using MS Word in windows,
>
> MS Word for editing PHP files? That is very, very bad ... You will never
> find a job if ever mention it to an employer. Search the archives of
> this list for "PHP Editors". I recommend Edit Plus for plain-text
> programming. If you want a whole IDE then Zend Studio is probably the
> best for you.
>
> > when a file is saved, can it be AUTOMATICALLY
> > uploaded (via http POST or other mechanism) to a server?
> >
> > Currently I need to first save it on my desktop, then upload that copy
> > to a php-supported server.
>
> Oh well, there are four ways to accomplish this.
>
>
> 1. Professional way:
>
> Using CVS. CVS (cvshome.org) is a system that allows you to version your
> files. This, in two words, works this way: in CVS, you `checkout'
> (update) a file, edit it, and save it (if somebody else edited that file
> while you edited yours both changes will merge). CVS is the most
> professional solution for this thing.
>
>
> 2. Simplest way:
>
> Use a mapped networking like Samba. This will mean that you will see
> your server just as it was a hard disk on your windows. You drag&drop
> files there and the same will occur remotely. Not a very secure way,
> though.
>
>
> 3. FTP integrated tool:
>
> Get a good editor that has some FTP integration. It will means that when
> you `save' a file in your editor, it will automatically FTP that file on
> the server. A very tool-dependent way but can work. Very cruel when
> something goes wrong, though. Again, Zend IDE and Edit Plus can do that.
>
>
> 4. The Geeky way:
>
> Edit all your files in a simple VIM or other fancy directly on the
> server by logging there with telnet or SSH.
>
>
> Have fun.
>
>
> --
> Maxim Maletsky
> [EMAIL PROTECTED]
>
>
> --
> 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 this possible with php?

2003-01-10 Thread Justin French
on 10/01/03 6:14 PM, Tom Rogers ([EMAIL PROTECTED]) wrote:

> I use webdrive which allows me to map an ftp site to a windows drive letter so
> it gets treated as a local drive . very usefull.
> You can read about it here http://www.webdrive.com/

Does anyone know of a mac (OS8/9 NOT OSX) application that does a simular
thing?

Justin


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




Re: [PHP] Is this possible with php?

2003-01-10 Thread Maxim Maletsky

[EMAIL PROTECTED] wrote... :

> I would like to know if the follwing function can be implemneted
> in php with help of other tools:

in PHP distribution? PHP is the programming language, not a
client/server tool. This is definitely something to be an integrated
part of something else.

> using MS Word in windows, 

MS Word for editing PHP files? That is very, very bad ... You will never
find a job if ever mention it to an employer. Search the archives of
this list for "PHP Editors". I recommend Edit Plus for plain-text
programming. If you want a whole IDE then Zend Studio is probably the
best for you.

> when a file is saved, can it be AUTOMATICALLY
> uploaded (via http POST or other mechanism) to a server?
>
> Currently I need to first save it on my desktop, then upload that copy
> to a php-supported server.

Oh well, there are four ways to accomplish this.


1. Professional way:

Using CVS. CVS (cvshome.org) is a system that allows you to version your
files. This, in two words, works this way: in CVS, you `checkout'
(update) a file, edit it, and save it (if somebody else edited that file
while you edited yours both changes will merge). CVS is the most
professional solution for this thing.


2. Simplest way:

Use a mapped networking like Samba. This will mean that you will see
your server just as it was a hard disk on your windows. You drag&drop
files there and the same will occur remotely. Not a very secure way,
though.


3. FTP integrated tool:

Get a good editor that has some FTP integration. It will means that when
you `save' a file in your editor, it will automatically FTP that file on
the server. A very tool-dependent way but can work. Very cruel when
something goes wrong, though. Again, Zend IDE and Edit Plus can do that.


4. The Geeky way:

Edit all your files in a simple VIM or other fancy directly on the
server by logging there with telnet or SSH.


Have fun.


--
Maxim Maletsky
[EMAIL PROTECTED]


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




Re: [PHP] Is this possible with php?

2003-01-09 Thread Tom Rogers
Hi,

Friday, January 10, 2003, 4:06:23 PM, you wrote:
tnc> I would like to know if the follwing function can be implemneted
tnc> in php with help of other tools:

tnc> using MS Word in windows, when a file is saved, can it be AUTOMATICALLY
tnc> uploaded (via http POST or other mechanism) to a server?

tnc> Currently I need to first save it on my desktop, then upload that copy
tnc> to a php-supported server.

tnc> Thanks in advance.

tnc> Tim

I use webdrive which allows me to map an ftp site to a windows drive letter so
it gets treated as a local drive . very usefull.
You can read about it here http://www.webdrive.com/


-- 
regards,
Tom


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




RE: [PHP] Is this possible with php?

2003-01-09 Thread Timothy Hitchens \(HiTCHO\)
So you want to be able to have a directory that when saved to it is
really the server well
besides ftp or samba integration into explorer the only other option you
have is to use
webdav with apache and that way it would be a post of sorts to the mod
webdav module in apache.



Timothy Hitchens (HiTCHO)
Open Platform Consulting
e-mail: [EMAIL PROTECTED]

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
> Sent: Friday, 10 January 2003 4:06 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Is this possible with php?
> 
> 
> I would like to know if the follwing function can be 
> implemneted in php with help of other tools:
> 
> using MS Word in windows, when a file is saved, can it be 
> AUTOMATICALLY uploaded (via http POST or other mechanism) to a server?
> 
> Currently I need to first save it on my desktop, then upload 
> that copy to a php-supported server.
> 
> Thanks in advance.
> 
> Tim
> 
> -- 
> 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] Is this possible with php?

2003-01-09 Thread try
I would like to know if the follwing function can be implemneted
in php with help of other tools:

using MS Word in windows, when a file is saved, can it be AUTOMATICALLY
uploaded (via http POST or other mechanism) to a server?

Currently I need to first save it on my desktop, then upload that copy
to a php-supported server.

Thanks in advance.

Tim

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




Re: [PHP] Theoretical - Device server using PHP - Is this possible?

2002-12-10 Thread @ Edwin
Hello,

"Steve Jackson" <[EMAIL PROTECTED]> wrote:

> Hi all,
>
> I work for a company that manufactures device servers. They currently
> have a very low internal memory (about 8MB) which is more than enough
> for TCP/IP connections (which BTW we just released the code open source
> to anyone interested www.opentcp.org) to devices but I was wondering if
> there was any way we could give these device servers more functionality
> by somehow using PHP. Obviously the device server itself has nowhere
> near enough memory to have PHP installed upon it but it would be
> interesting to see if anyone has any ideas or theories about if this is
> possible.

Not that I can answer you question but I think it is possible to run php
(maybe a stripped down version?) with a small amount of memory--there's one
that runs on a pda...

- E

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




[PHP] Theoretical - Device server using PHP - Is this possible?

2002-12-10 Thread Steve Jackson
Hi all,

I work for a company that manufactures device servers. They currently
have a very low internal memory (about 8MB) which is more than enough
for TCP/IP connections (which BTW we just released the code open source
to anyone interested www.opentcp.org) to devices but I was wondering if
there was any way we could give these device servers more functionality
by somehow using PHP. Obviously the device server itself has nowhere
near enough memory to have PHP installed upon it but it would be
interesting to see if anyone has any ideas or theories about if this is
possible.

Thanks in advance.

Steve Jackson
Web Developer
Viola Systems Ltd.
http://www.violasystems.com
[EMAIL PROTECTED]
Mobile +358 50 343 5159


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




Re: [PHP] is this possible ...

2002-08-10 Thread Justin French

Yes attaching files to email is possible.  There's such a class available at
phpclasses.org by Manuel

Justin French


on 11/08/02 3:53 AM, M.E. Suliman ([EMAIL PROTECTED]) wrote:

> Hi
> 
> I need the contents of a form to be emailed as an attached Excel file or
> html file.  Is this possible using PHP.  I think comma delimited files open
> in Excel.  Can anyone advise.
> 
> Thanks in advance
> 
> Mohamed
> 


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




[PHP] is this possible ...

2002-08-10 Thread M.E. Suliman

Hi

I need the contents of a form to be emailed as an attached Excel file or
html file.  Is this possible using PHP.  I think comma delimited files open
in Excel.  Can anyone advise.

Thanks in advance

Mohamed


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




Re: [PHP] Is this possible

2002-06-06 Thread Analysis & Solutions

On Thu, Jun 06, 2002 at 05:32:45AM -, James Edgar wrote:

> class myClass
>   {
>   function myFunc($var)
>   {
>   include("xml.inc");
>   $obj = new xml($data,"xml");  

And what happened when you ran this?  Why not tell us?  In the future, 
please post error messages and/or results so we can help you more 
accurately.

If you ran it, it'd probably say "Class declarations may not be nested."  
Pretty clear.

The code for your xml class outside of myClass.  But, you can create the 
object inside the class.

So, put include('./xml.inc'); before class myClass and leave
$obj = new xml($data, 'xml'); where it is.

Enjoy,

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




[PHP] Is this possible

2002-06-05 Thread James Edgar

I am trying to run a class inside a class, it says that the object is there but when I 
go to get the info, it is not there. I have attached the code below and attache the 
xml.inc file. Any help would be greatly appreciated.

class myClass
{
function myFunc($var)
{
include("xml.inc");
$obj = new xml($data,"xml");  
if (is_object($obj)) 
{
print("Yes"); // It will print this
}
else
{
print("No");
}

/ below we will see the status of the result   
for($i=0;$iWhatever[0] . "\n"; 
}

echo($varvalue); // Does not echo anything.

} // end func

} // end class








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


RE: [PHP] Is this possible

2002-06-05 Thread Scott Hurring

Since you didnt include the code for InsideClass, i can only
assume that you're probably getting errors becuase "$bob"
is not initialized anywhere.

---
Scott Hurring
Systems Programmer
EAC Corporation
[EMAIL PROTECTED]
Voice: 201-462-2149
Fax: 201-288-1515

> -Original Message-
> From: James Edgar [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 05, 2002 5:27 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Is this possible
> 
> 
> I am trying to run a class inside a class, it says that the 
> object is there but when I go to get the info, it is not 
> there. I have attached the code below. Any help would be 
> greatly appreciated.
> 
> class myfirstClass
>   {
> 
>   
>   function Track($tracknum)
>   {
>   include("insideclass.inc");
>   
>   $obj = new InsideClass($data,"bob");  
>   
>   if (is_object($obj)) 
>   {
>   print("Yes"); // It will print this
>   }
>   else
>   {
>   print("No");
>   }
>   
>   / below we will see the status of the 
> result   
>   for($i=0;$i   { 
>   $nine = 
> $bob["Whatever_whaterver"][$i]->Whatever[0] . "\n"; 
>   }
> 
>   echo($nine); // Does not echo anything.
> 
>   } // end func
> 
>   } // end class
> 
> 
> 
> -- 
> 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] Is this possible

2002-06-05 Thread James Edgar

I am trying to run a class inside a class, it says that the object is there but when I 
go to get the info, it is not there. I have attached the code below. Any help would be 
greatly appreciated.

class myfirstClass
{


function Track($tracknum)
{
include("insideclass.inc");

$obj = new InsideClass($data,"bob");  

if (is_object($obj)) 
{
print("Yes"); // It will print this
}
else
{
print("No");
}

/ below we will see the status of the result   
for($i=0;$iWhatever[0] . "\n"; 
}

echo($nine); // Does not echo anything.

} // end func

} // end class



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




RE: [PHP] Is This Possible? (Database - PHP)

2002-05-12 Thread John Holmes

Yes, it's certainly possible. You will have to talk your host into
giving you remote access though, which could be hard. 

How permissions work in MySQL is that your username is given permission
to connect from a specific host. Generally, the host is listed as
'localhost' meaning the script has to be on the same server as MySQL.
You can also have '%' as your host, meaning you can connect from
anywhere. Or, when your ISP assigns you an IP, the first 2 or 3 octets
are generally the same. So you could put something like '123.123.%' or
'123.123.123.%' in your host. 

You hosting provider, if they're any good, will know all about this.
It's hard to talk people into giving you access, though, because they
are generally pretty paranoid. 

---John Holmes...

> -Original Message-
> From: r [mailto:[EMAIL PROTECTED]]
> Sent: Monday, May 13, 2002 12:05 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Is This Possible? (Database - PHP)
> 
> Hey there guys,
> I have a slight problem which i could not solve via Java servlets and
now
> that I am migrating to PHP I was wondering if its possible...
> 
> I am hosting with a company that has given me a database (MySql) I am
> using
> the database for all my apps which are only being accessed via my
> servlets... I want to change that and convert all my servlets to
PHP.
> Being new to PHP i am sure to make a lot of mistakes and instead of
> uploading my PHP page, getting errors/ redoing it, uploading etc I was
> kinda
> hoping i could connect to the remote database via my local machine?
> I already have PHP installed on my machine. on the remote host the
> details are
> 
> Localhost
> jimmy*** (Username)
> gunsand* (Password)
> umace_com (Database name)
> 
> Is this possible?
> Any help and comments appreciated.
> Cheers,
> -Ryan
> 
> /* Whats the difference between the pope and your boss? The pope only
> wants
> you to kiss his ring! */
> 
> 
> 
> --
> 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 This Possible? (Database - PHP)

2002-05-12 Thread Jason Wong

On Monday 13 May 2002 15:05, r wrote:
> Hey there guys,
> I have a slight problem which i could not solve via Java servlets and now
> that I am migrating to PHP I was wondering if its possible...
>
> I am hosting with a company that has given me a database (MySql) I am using
> the database for all my apps which are only being accessed via my
> servlets... I want to change that and convert all my servlets to PHP.
> Being new to PHP i am sure to make a lot of mistakes and instead of
> uploading my PHP page, getting errors/ redoing it, uploading etc I was
> kinda hoping i could connect to the remote database via my local machine? I
> already have PHP installed on my machine. on the remote host the
> details are
>
> Localhost
> jimmy*** (Username)
> gunsand* (Password)
> umace_com (Database name)
>
> Is this possible?

It depends on whether your hosting company allows remote connections to the 
mysql server. Speak to them.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
You can tell how far we have to go, when FORTRAN is the language of
supercomputers.
-- Steven Feiner
*/


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




[PHP] Is This Possible? (Database - PHP)

2002-05-12 Thread r

Hey there guys,
I have a slight problem which i could not solve via Java servlets and now
that I am migrating to PHP I was wondering if its possible...

I am hosting with a company that has given me a database (MySql) I am using
the database for all my apps which are only being accessed via my
servlets... I want to change that and convert all my servlets to PHP.
Being new to PHP i am sure to make a lot of mistakes and instead of
uploading my PHP page, getting errors/ redoing it, uploading etc I was kinda
hoping i could connect to the remote database via my local machine?
I already have PHP installed on my machine. on the remote host the
details are

Localhost
jimmy*** (Username)
gunsand* (Password)
umace_com (Database name)

Is this possible?
Any help and comments appreciated.
Cheers,
-Ryan

/* Whats the difference between the pope and your boss? The pope only wants
you to kiss his ring! */



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




RE: [PHP] Is this possible?

2002-02-14 Thread Rick Emery

I forgot to mention, you must have access to the A and/or CNAME records for
your DNS in order to point the domains to the single IP adress.

Yes, you can do this.  In the script below, I read the sub-directory from a
MYSQL database.  This is overkill for just a few domains, but great for a
hundred.

The MYSQL table structure is:
subdomain char(20)
domain char(20)
directory char(20)

I'm going to change this on my host to:
domain varchar(50)
directory char(20)

The domain field will contain the entire domain and sub-domain structure,
which will then easily accomodate sub-domains and sub-sub-domains, etc.

This is index.html file:

$query");
if( mysql_num_rows($results)<>1 )
{
print "Error: Cannot find sub-domain
".$HTTP_SERVER_VARS['HTTP_HOST']."";
exit;
}
else
{
$row = mysql_fetch_array($results);
$loc = "http://www.mydomain.com/".$row['directory'];
header( "location: $loc");
}
exit;
?>


-Original Message-----
From: Leif K-Brooks
To: [EMAIL PROTECTED]
Sent: 2/13/02 8:37 PM
Subject: [PHP] Is this possible?

I would like to have multiple domains and have them forwarded to
different
folders, so I'd only need one hosting account.  Example:
 www.domain1.com goes to www.domain.com/domain1
 www.domain2.com goes to www.domain.com/domain2
I would like to do this in php.  Of course, to do this, I'd need to get
the
url the user is requesting into the script.  If this possible?
Thanks in advance, Leif K-Brooks. 

-- 
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] Is this possible?

2002-02-13 Thread Rick Emery

Yes, you can do this.  In the script below, I read the sub-directory from a
MYSQL database.  This is overkill for just a few domains, but great for a
hundred.

This is index.html file:

$query");
if( mysql_num_rows($results)<>1 )
{
print "Error: Cannot find sub-domain
".$HTTP_SERVER_VARS['HTTP_HOST']."";
exit;
}
else
{
$row = mysql_fetch_array($results);
$loc = "http://www.mydomain.com/".$row['directory'];
header( "location: $loc");
}
exit;
?>


-Original Message-
From: Leif K-Brooks
To: [EMAIL PROTECTED]
Sent: 2/13/02 8:37 PM
Subject: [PHP] Is this possible?

I would like to have multiple domains and have them forwarded to
different
folders, so I'd only need one hosting account.  Example:
 www.domain1.com goes to www.domain.com/domain1
 www.domain2.com goes to www.domain.com/domain2
I would like to do this in php.  Of course, to do this, I'd need to get
the
url the user is requesting into the script.  If this possible?
Thanks in advance, Leif K-Brooks. 

-- 
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] Is this possible?

2002-02-13 Thread Leif K-Brooks

I would like to have multiple domains and have them forwarded to different
folders, so I'd only need one hosting account.  Example:
 www.domain1.com goes to www.domain.com/domain1
 www.domain2.com goes to www.domain.com/domain2
I would like to do this in php.  Of course, to do this, I'd need to get the
url the user is requesting into the script.  If this possible?
Thanks in advance, Leif K-Brooks. 

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




Re: [PHP] Is this possible?

2002-02-06 Thread Julio Nobrega Trabalhando

  I am sorry, this has nothing to do with the logic of your code, but
instead with style (and a little bit of perfomance, both from you and your
system).

  Isn't easier to escape PHP when you are going to enter html code lines?
Like this:

\n";
echo " \n";
?>

  IMHO would be better:



  


   Seems to be easier to type, prettier and faster

   Just a tought;-)

--

Julio Nobrega.

Um dia eu chego lá:
http://sourceforge.net/projects/toca




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




Re: [PHP] Is this possible?

2002-02-06 Thread Raymond Lilleødegård

At last!  : )  Thank you very much for all help! ; )

I made it with two mysql_query()

Here are my queries if it is interesting.

 $varetabell = mysql_query("SELECT varetabell.tekstbilde,
varetabell.varenavn, varetabell.varenr, varetabell.innhold, pristabell.pris
FROM varetabell, pristabell WHERE pristabell.varenr=varetabell.varenr AND
pristabell.type='footlong'",$db);

 $varetab = mysql_query("SELECT varetabell.varenr, pristabell.varenr,
pristabell.pris  FROM varetabell, pristabell WHERE
pristabell.varenr=varetabell.varenr AND pristabell.type='6inch'",$db);

 if ($myrow = mysql_fetch_array($varetabell) AND $myro =
mysql_fetch_array($varetab)) {

echo "\n";
echo " \n";
echo "  Subs\n";
echo "  6\"\n";
echo "  Footlong\n";
echo " \n";
echo " \n";
echo "  \n";
echo " \n";

 do {
printf(" ",$myrow["varenavn"]);
printf( " ",$myrow["tekstbilde"], $myrow["varenavn"]);
printf( "  ");
printf("  %s",$myro["pris"]);
printf( "  %s",$myrow["pris"]);
printf("  ");
printf("  ");
printf("  ",$myrow["varenr"]);
printf("",$myrow["varenavn"]);
printf("  ");
printf("  ");
printf("  (%s)",$myrow["innhold"]);
printf("  ");
printf("  ");
printf("  ");
printf(" \n");

 } while ($myrow = mysql_fetch_array($varetabell) AND $myro =
mysql_fetch_array($varetab));



- Original Message -
From: "DL Neil" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; "Raymond Lilleodegard" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, February 06, 2002 7:20 PM
Subject: Re: [PHP] Is this possible?


> val,
>
> Surely this would only be possible if "SIZE1" and "P2" [sic - maybe
"SIZE2"] were constants, ie that all small
> packs had SIZE="small" and all large packs were defined as SIZE="large".
> (also that all products had no more than two sizes)
>
> Interesting thought though (subject to the <=2 sizes constraint), could
there be a LEFT JOIN off PRODUCTS, but
> put P1 and P2 into a cartesian product but only selecting where there is
inequality:
>
> WHERE P.NUM=P1.ID AND P.NUM=P2.ID
>  AND P1.SIZE <> P2.SIZE
>
> [sorry, machine is busy on something, so haven't prototyped it]
>
> Raymond: is there a SIZE (type of) field? Do the above constraints apply?
What are the table definitions you are
> using? Any chance of some sample data?
>
> Please advise,
> =dn
>
>
> > Let prices(id,price etc.) be table of prices, products(NUM,name etc).
> >
> > Try smth like this:
> >
> > SELECT DISTINCT * FROM PRODUCTS P, PRICES P1, PRICES P2
> > WHERE P.NUM=P1.ID AND P.NUM=P2.ID AND P1.SIZE=SIZE1 AND P2.SIZE=P2
> >
> >
> > Valentin Petruchek (aki Zliy Pes)
> > http://zliypes.com.ua
> > mailto:[EMAIL PROTECTED]
> > - Original Message -
> > From: "Raymond Lilleodegard" <>
> > To: <[EMAIL PROTECTED]>
> > Sent: Wednesday, February 06, 2002 7:16 PM
> > Subject: [PHP] Is this possible?
> >
> >
> > > Hi!
> > >
> > > I have this tricky case, at lest for me : )
> > >
> > > I'm trying to get some data out of two tables and listing the data in
a
> > > product/price site. But. :
> > >
> > > I have one table with productinfo and one with prices.
> > > And it is several columns with the same id in the pricetable, because
> > every
> > > product have several sizes.
> > >
> > > So... how do I get only one row from the "product table" and two rows
from
> > > the "price table" in one line in a page?
> > > Is it possible?
> > >
> > >
> > >
> > > Best regards
> > >
> > > Raymond
> > >
> > >
> > >
> > > --
> > > 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] Is this possible?

2002-02-06 Thread DL Neil

val,

Surely this would only be possible if "SIZE1" and "P2" [sic - maybe "SIZE2"] were 
constants, ie that all small
packs had SIZE="small" and all large packs were defined as SIZE="large".
(also that all products had no more than two sizes)

Interesting thought though (subject to the <=2 sizes constraint), could there be a 
LEFT JOIN off PRODUCTS, but
put P1 and P2 into a cartesian product but only selecting where there is inequality:

WHERE P.NUM=P1.ID AND P.NUM=P2.ID
 AND P1.SIZE <> P2.SIZE

[sorry, machine is busy on something, so haven't prototyped it]

Raymond: is there a SIZE (type of) field? Do the above constraints apply? What are the 
table definitions you are
using? Any chance of some sample data?

Please advise,
=dn


> Let prices(id,price etc.) be table of prices, products(NUM,name etc).
>
> Try smth like this:
>
> SELECT DISTINCT * FROM PRODUCTS P, PRICES P1, PRICES P2
> WHERE P.NUM=P1.ID AND P.NUM=P2.ID AND P1.SIZE=SIZE1 AND P2.SIZE=P2
>
>
> Valentin Petruchek (aki Zliy Pes)
> http://zliypes.com.ua
> mailto:[EMAIL PROTECTED]
> - Original Message -
> From: "Raymond Lilleodegard" <>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, February 06, 2002 7:16 PM
> Subject: [PHP] Is this possible?
>
>
> > Hi!
> >
> > I have this tricky case, at lest for me : )
> >
> > I'm trying to get some data out of two tables and listing the data in a
> > product/price site. But. :
> >
> > I have one table with productinfo and one with prices.
> > And it is several columns with the same id in the pricetable, because
> every
> > product have several sizes.
> >
> > So... how do I get only one row from the "product table" and two rows from
> > the "price table" in one line in a page?
> > Is it possible?
> >
> >
> >
> > Best regards
> >
> > Raymond
> >
> >
> >
> > --
> > 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] Is this possible?

2002-02-06 Thread val petruchek

Let prices(id,price etc.) be table of prices, products(NUM,name etc).

Try smth like this:

SELECT DISTINCT * FROM PRODUCTS P, PRICES P1, PRICES P2
WHERE P.NUM=P1.ID AND P.NUM=P2.ID AND P1.SIZE=SIZE1 AND P2.SIZE=P2


Valentin Petruchek (aki Zliy Pes)
http://zliypes.com.ua
mailto:[EMAIL PROTECTED]
- Original Message -
From: "Raymond Lilleodegard" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 06, 2002 7:16 PM
Subject: [PHP] Is this possible?


> Hi!
>
> I have this tricky case, at lest for me : )
>
> I'm trying to get some data out of two tables and listing the data in a
> product/price site. But. :
>
> I have one table with productinfo and one with prices.
> And it is several columns with the same id in the pricetable, because
every
> product have several sizes.
>
> So... how do I get only one row from the "product table" and two rows from
> the "price table" in one line in a page?
> Is it possible?
>
>
>
> Best regards
>
> Raymond
>
>
>
> --
> 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 this possible?

2002-02-06 Thread Erik Price


On Wednesday, February 6, 2002, at 12:16  PM, Raymond Lilleodegard wrote:

> So... how do I get only one row from the "product table" and two rows 
> from
> the "price table" in one line in a page?

Use this query:

SELECT producttable.onerow, pricetable.onerow, pricetable.tworow
FROM producttable, pricetable
WHERE [use variable to constrain query here]

This is valid for if you're using MySQL or other ANSI-standard database, 
I think.

Then run your query against the database, and use one of the db 
functions (like mysql_fetch_assoc()) to pull your data out of the 
query's array.  Pull out the data you want and assign it to different 
variables, then echo those variables surrounded by whatever HTML tags 
you want.


Standard procedure, unless you're asking something different.


Erik





Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




[PHP] Is this possible?

2002-02-06 Thread Raymond Lilleodegard

Hi!

I have this tricky case, at lest for me : )

I'm trying to get some data out of two tables and listing the data in a
product/price site. But. :

I have one table with productinfo and one with prices.
And it is several columns with the same id in the pricetable, because every
product have several sizes.

So... how do I get only one row from the "product table" and two rows from
the "price table" in one line in a page?
Is it possible?



Best regards

Raymond



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




RE: [PHP] Is this possible? PHP + Javascript

2001-03-26 Thread Joe Sheble \(Wizaerd\)

in the onCLick event of the checkbox call a javascript function.  In that
function use a window.open() method to open aother browser window, using the
open() methods various properties to control how that browser window looks
and feels.  For the URL for that browser window, make it a PHP script
passing an ID.  That script would run against the server and database,
returning the results in whatever HTML format you include in that browser
window.  Works similiar to a popup but allows you to run a dynamic script
instead of loading up on javascript arrays or variables when the page loads.

Joseph E. Sheble
a.k.a. Wizaerd
Wizaerd's Realm
Canvas, 3D, Graphics,
ColdFusion, PHP, and mySQL
http://www.wizaerd.com
=

> -Original Message-
> From: Reuben D Budiardja [mailto:[EMAIL PROTECTED]]
> Sent: Monday, March 26, 2001 4:29 PM
> To: Michael Champagne; PHP General Mailing List
> Subject: Re: [PHP] Is this possible? PHP + Javascript
>
>
> At 05:11 PM 3/26/01 -0600, Michael Champagne wrote:
> >I have a huge database-driven list of clients with a checkbox
> next to each
> >one.  When I check one of these clients, I'm wanting one of those small
> >javascript boxes to pop up and display the contacts for this
> client (another
> >database lookup) and allow me to select one via a radio button.
> I figured I
> >could do this via the checkbox's onclick event, but I'm not
> completely sure
> >how.
> >
> >How do I bring up the box and display database information
> within?  Any help
> >is GREATLY appreciated.
>
> What I did for something like this was: I donwloaded all the information
> that I'm (probably) going to use and store it in variables/arrays, but I
> don't display them.
> Only after an event happened, like onClick, I display the relevant
> information using javascript, since javascript can access a php variable.
>
> I don't if this can work for your problem. But the idea basically is
> download everything first from server side, and display what is necessary
> from client side. That way you minimizing the reload/refresh, which take
> painfully long time for some of the clients.
>
> Hope that helps
> Reuben D. Budiardja
>
>
> Reuben D. Budiardja
> Web Database Application Programmer / Analyst
> Devcorps, ITS
> Goshen College, IN 46526
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Is this possible? PHP + Javascript

2001-03-26 Thread Reuben D Budiardja

At 05:11 PM 3/26/01 -0600, Michael Champagne wrote:
>I have a huge database-driven list of clients with a checkbox next to each
>one.  When I check one of these clients, I'm wanting one of those small
>javascript boxes to pop up and display the contacts for this client (another
>database lookup) and allow me to select one via a radio button.  I figured I
>could do this via the checkbox's onclick event, but I'm not completely sure
>how.
>
>How do I bring up the box and display database information within?  Any help
>is GREATLY appreciated.

What I did for something like this was: I donwloaded all the information 
that I'm (probably) going to use and store it in variables/arrays, but I 
don't display them.
Only after an event happened, like onClick, I display the relevant 
information using javascript, since javascript can access a php variable.

I don't if this can work for your problem. But the idea basically is 
download everything first from server side, and display what is necessary 
from client side. That way you minimizing the reload/refresh, which take 
painfully long time for some of the clients.

Hope that helps
Reuben D. Budiardja


Reuben D. Budiardja
Web Database Application Programmer / Analyst
Devcorps, ITS
Goshen College, IN 46526


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]