[PHP] Need Older version of file upload script

2003-07-02 Thread Webmaster
I just developed a php script that will upload files to a secure server for
a client. Works great.

Problem: When I uploaded the scripts to the secure server...the file upload
doesn't work. Come to find out I developed using php v4.3.2 only to find out
that the secure server that it will be running on is v4.0.3pl.

Upgrading is not an option. Does anyone have a file upload script that will
work on this older version of php that they would be willing to share?

Thanks.
Mark Roberts, Roberts Computing Systems
Webmaster Services $29.50/mo

mailto:[EMAIL PROTECTED]




[PHP] Help with upload

2003-07-03 Thread Webmaster
I am trying to do a file upload using the following code. Script doesn't
appear to generate any errors that I can see. Just that the file isn't
copied. I have put in some debuging code and all variable seem to be
correct. file just isn't copying. I have tried both copy() and
move_uploaded_file() functions with the same result...file isn't copied. I
must be overlooking the obvious and am hoping someone can point it out to
me. Help would be appreciated.

Note: I am using php v4.0.3pl (I don't have any option and this is the
version that I am stuck with, so I just have to make it work). Thanks  in
advance.

echo "upload=".$ufolder.$HTTP_POST_FILES['img1']['tmp_name'];
if ($HTTP_POST_FILES['img1'] != "") {
 move_uploaded_file($HTTP_POST_FILES['img1']['tmp_name'],
$ufolder.$HTTP_POST_FILES['img1']['name']);
 //copy($HTTP_POST_FILES['img1']['tmp_name'],
"$ufolder".$HTTP_POST_FILES['img1']['name']);
  //or die($php_errormsg);
  //or die("Couldn't copy the file!");
 echo "error=".$php_errormsg;
} else {

 die("No input file specified");
}


Thanks.
Mark Roberts, Roberts Computing Systems
Webmaster Services $29.50/mo

mailto:[EMAIL PROTECTED]




[PHP] More on file upload

2003-07-04 Thread Webmaster
First of all, thanks to all that have helped so far.

I am trying to get a file upload script to work using php v4.0.3 (no option
here)

Everything seems to be working except the move_uploaded_file() function (the
most critical part)

I have checked all variables they seem to be correct.
my php.ini settings are:
file_uploads 1
doc_root  no value
post_max_size 8m
upload_max_file size 2m
upload_tmp_dir   no value

Anthing else to check? Is there a way to get a more descriptive error msg?

Thanks.

Mark Roberts, Roberts Computing Systems
Webmaster Services $29.50/mo
mailto:[EMAIL PROTECTED]




RE: [PHP] More on file upload

2003-07-04 Thread Webmaster
Directory permissions are set to 0777

Right now I am just using
 if ( move_uploaded_file(source,dest))
{
echo "file moved";
}
else
{
echo "could not move file";
}
  }

Have not yet been able to figure out how to get a more descriptive error. I
know there has to be a better way to get exact message, but just haven't
figured it out yet.

Mark Roberts, Roberts Computing Systems
eCommerce, yeah, we do that!
Graphics, Scripting, Databases, shopping carts
mailto:[EMAIL PROTECTED]

-Original Message-
From: Marek Kilimajer [mailto:[EMAIL PROTECTED]
Sent: Friday, July 04, 2003 10:57 AM
To: Webmaster
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] More on file upload


What is the message now? Is the file being uploaded and
move_uploaded_file() does not move the file? Then check the directory
permissions.

Webmaster wrote:

> First of all, thanks to all that have helped so far.
>
> I am trying to get a file upload script to work using php v4.0.3 (no
option
> here)
>
> Everything seems to be working except the move_uploaded_file() function
(the
> most critical part)
>
> Anthing else to check? Is there a way to get a more descriptive error msg?
>




--
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] More on file upload

2003-07-04 Thread Webmaster
Same results.

I have attached a copy of the code...it is straight from the zend site.
Here is the url to the code:
https://robertscomputing.securelook.com/bmiphp/uptest.php

and a link my phpinfo script for the server php.ini settings:

https://robertscomputing.securelook.com/phpinfo.php

Thanks for your response.


Mark Roberts, Roberts Computing Systems
eCommerce, yeah, we do that!
Graphics, Scripting, Databases, shopping carts
mailto:[EMAIL PROTECTED]

-Original Message-
From: Andrew McCombe [mailto:[EMAIL PROTECTED]
Sent: Friday, July 04, 2003 11:16 AM
To: Webmaster; Marek Kilimajer
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] More on file upload


Try copy() instead of move_uploaded_file and see what you get.

Andrew

- Original Message -
From: "Webmaster" <[EMAIL PROTECTED]>
To: "Marek Kilimajer" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, July 04, 2003 5:12 PM
Subject: RE: [PHP] More on file upload


> Directory permissions are set to 0777
>
> Right now I am just using
>  if ( move_uploaded_file(source,dest))
> {
> echo "file moved";
> }
> else
> {
> echo "could not move file";
> }
>   }
>
> Have not yet been able to figure out how to get a more descriptive error.
I
> know there has to be a better way to get exact message, but just haven't
> figured it out yet.
>
> Mark Roberts, Roberts Computing Systems
> eCommerce, yeah, we do that!
> Graphics, Scripting, Databases, shopping carts
> mailto:[EMAIL PROTECTED]
>
> -Original Message-
> From: Marek Kilimajer [mailto:[EMAIL PROTECTED]
> Sent: Friday, July 04, 2003 10:57 AM
> To: Webmaster
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] More on file upload
>
>
> What is the message now? Is the file being uploaded and
> move_uploaded_file() does not move the file? Then check the directory
> permissions.
>
> Webmaster wrote:
>
> > First of all, thanks to all that have helped so far.
> >
> > I am trying to get a file upload script to work using php v4.0.3 (no
> option
> > here)
> >
> > Everything seems to be working except the move_uploaded_file() function
> (the
> > most critical part)
> >
> > Anthing else to check? Is there a way to get a more descriptive error
msg?
> >
>
>
>
>
> --
> 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

[PHP] string questions

2002-08-02 Thread webmaster

I know there has to be an easy way to do this, but I just can't find the
answer.  I need to strip out the first part of a text string.  I've
figured out out to strip out the last part of a string using the
following:

$address = (4455 N. 45th St.);

$test = strstr($address, " ");
echo $test;

The variable $test returns N. 45th St. without the 4455.  Is there a way
to reverse this so I can just return 4455?

Thanks,
-Elkan


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




[PHP] Next and Previous links

2002-08-09 Thread webmaster

Hello,

I've been trying write a .php page that displays 10 results per page
with links to the next 10 avail.  I've found a couple examples on how to
do this with MySQL, and I tried to convert it to work with Postgres with
no luck.  Has anyone ever done this using PHP4.0.6 and Postgres 7.1?

Also, I keep getting an error that pg_fetch_row() and pg_fetch_array()
requires at least 2 parameters where all the examples I find only use
1.  Is this a DB configuration problem?

Thanks in advance,
-Elkan


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




Re: [PHP] Next and Previous links

2002-08-09 Thread webmaster

I found an answer for anyone who may be interested on phpbuilder.com

 http://phpbuilder.com/annotate/message.php3?id=1010986

-Elkan

webmaster wrote:

> Hello,
>
> I've been trying write a .php page that displays 10 results per page
> with links to the next 10 avail.  I've found a couple examples on how to
> do this with MySQL, and I tried to convert it to work with Postgres with
> no luck.  Has anyone ever done this using PHP4.0.6 and Postgres 7.1?
>
> Also, I keep getting an error that pg_fetch_row() and pg_fetch_array()
> requires at least 2 parameters where all the examples I find only use
> 1.  Is this a DB configuration problem?
>
> Thanks in advance,
> -Elkan
>
> --
> 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] Writing Files

2002-08-30 Thread Webmaster

i write these files in a for-next loop, so at the start of each loop, i've
to put an unmask command?

- Original Message -
From: "Jason Wong" <[EMAIL PROTECTED]>
Newsgroups: php.general
To: <[EMAIL PROTECTED]>
Sent: Friday, August 30, 2002 4:11 PM
Subject: Re: [PHP] Writing Files


> On Friday 30 August 2002 20:53, Georgie Casey wrote:
> > How do you write files so that theyre chmoded 777 by default. the
folders
> > theyre written to are 0777 but the files aren't. so i cant delete or
modify
> > the files through PHP, i have to first chmod them with FTP, which takes
> > ages.
>
> umask()
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> monitor resolution too high
> */
>


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




[PHP] problem with SUM and Postgres

2002-10-09 Thread webmaster

I can't figure out why the following code is not returning a column
total:

$sql1 = "SELECT SUM(hostingcost) FROM $tablename WHERE webserver =
'$webserver'";
$hosting = pg_exec($connect, $sql1);
echo $hosting;

This returns: Resource ID #3

The only thing I can think of is that the hostingcost column's default
value is set to MONEY which is a postgres specific constraint.  The
query works fine within psql on the server, but not with php.

Thanks for any help.



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




[PHP] output buffering problem

2002-11-15 Thread webmaster
I'm trying to enable output buffering to speed up the load time of some
of our php web pages.  I've consulted the manual and enabled the
following:

output_buffering = On
output_handler = ob_gzhandler

At the beginning of my .php script, I include the following:

ob_start(ob_gzhandler);

This returns complete garbage when I run the page.  Is there something I
missed within the setup?  Or maybe something I need to install for
Apache?

php version = 4.1.2
RedHat = 7.2

Thanks for any advice,
-Elkan


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




[PHP] Printing Large Blocks of Text

2002-06-04 Thread webmaster



What is the best way to print large blocks of text 
within a PHP function?
 
JJ Harrison[EMAIL PROTECTED]www.tececo.com

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


[PHP] Best way to store 1000 char in a database

2002-06-06 Thread webmaster




What is the best way to store text with up to 1000 
characters in a mySQL database?
 
Sorry for the slightly of topic posting but I am 
not going to join another mailing list unless I have to.
 
I am going to create a weekly qoute generator 
thingy for my site.
 
JJ Harrison[EMAIL PROTECTED]www.tececo.com

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


[PHP] invalid path

2002-06-08 Thread Webmaster

My OS is XP Pro.

I installed my web folders in c:\web instead of c:\apache\htdocs

My php folder is: > c:/php

In the httpd.conf:
DocumentRoot "/web/myweb"
ScriptAlias /php/ "c:/php/"
   AddType application/x-httpd-php .php
   Action application/x-httpd-php "/php/php.exe"

In my Php.ini:
include_path = "c:/web/myweb/ezp/"

My ez Publish folder is > c:/web/myweb/ezp


Error text in browser is:

Warning: fopen("c:/web/myweb/php/php.exe/ezp/error.log","a") - No such file
or directory in classes/ezfile.php on line 282
Log file could not be opened.

Error:
"/php/php.exe" is inserted unexpectly..

What's wrong with my php?





[PHP] Suggestions for getting started with poll app.

2002-06-08 Thread webmaster



I want to build my own poll(The ones availble from 
sites such as hotscripts.com are not quite what I need)
 
Could any one tell me of a *good* 
tutorial?
 
Particularly the number of questions would be 
different between each poll not a fixed number.
 
JJ Harrison[EMAIL PROTECTED]www.tececo.com

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


[PHP] Javascript & PHP cookies

2002-06-08 Thread webmaster



Is it possible to read cookies from javascript 
written by PHP and vice-versa?
 
Just out of curiousity
 
JJ Harrison[EMAIL PROTECTED]www.tececo.com

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


Re: [PHP] Suggestions for getting started with poll app.

2002-06-08 Thread webmaster



- 
Original Message -From: "Nick Wilson" <[EMAIL PROTECTED]>To: <[EMAIL PROTECTED]>Sent: Sunday, June 09, 2002 12:15 
AMSubject: Re: [PHP] Suggestions for getting started with poll 
app.* and then [EMAIL PROTECTED] 
declared> I want to build my own poll(The ones availble from sites 
such ashotscripts.com are not quite what I need)I did one recently 
for a client. You could have a look at it and see ifit fits your needs... 
I've commented it for someone else so it should bequite easy to modify (see 
attached)--Nick Wilson //  www.explodingnet.com

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


[PHP] PHP function for listing number of columns in table

2002-06-08 Thread webmaster

Pardon the probably stupid question but,

Is there a PHP function for listing number of columns in a mySQL table?

Thanks in advance

JJ Harrison
[EMAIL PROTECTED]
www.tececo.com




[PHP] Converting week number to unix timestamp

2002-06-12 Thread webmaster



How can I convert the week number(i.e. 1 - 52) to a 
UNIX Timestamp?
 
Thanks
 
JJ Harrison[EMAIL PROTECTED]www.tececo.com

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


[PHP] Nested Menu Help

2002-06-22 Thread webmaster



When I am in page A (or one of it's children) I 
wish to show it's one level of children like so:
 
Page A
  Child 1

  Child 2

  etc...
Page B
 
When I am in page B (or one of it's children) I 
wish to show it's one level of children like so:
 

Page A

Page B

  Child 1

  Child 2

  etc...
 
Do you get the picture?
 
I have a db with link url, id, parent id and 
title
 
does any one know of a simple function or something 
to do this for one level?
 
I have tried and sort of failed 3 times. And before 
I keep trying I thought I would ask this group
 
JJ Harrison[EMAIL PROTECTED]www.tececo.com

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


[PHP] Error(Newbie)

2002-06-22 Thread webmaster



Both the below are in the same dir.
 
The meta.array_create.php file works fine 
elsewhere
 
when I try and view stat.php I get this 
error:
 
Parse error: parse error, expecting `T_STRING' or 
`T_VARIABLE' or `T_NUM_STRING' in C:\TecEco(Converting To PHP)\includes\stat.php 
on line 7
 
What does the error mean and how can I correct my 
code?
 
File meta.array_create.php
---
  $fn = explode("/", 
$_SERVER['PHP_SELF']);  $num_of_s = count($fn) - 1;  $fn = 
"$fn[$num_of_s]";  $query = "SELECT * FROM meta_data WHERE page_name = 
'$fn'";  $result = mysql_query($query);  $num_results = 
mysql_num_rows($result);  $row = mysql_fetch_array($result);  
$id = $row['id'];  $pid = $row['pid'];  $title = 
$row['title'];  $description = $row['description'];  $keywords 
= $row['keywords'];?>
 
file stat.php
-
 
include 
"meta.array_create.php";if(!isset($_COOKIE['tececo_stats'])){setcookie 
("tececo_stats", 1);}$query = "INSERT INTO `stats` (`vid`, `id`, `vn`, 
`time`, `host`, `referrer`, `browser`) VALUES ('', '$id', 
'$_COOKIE['tececo_stats']', '$time', '$_SERVER['REMOTE_HOST']', 
'$_SERVER['HTTP_REFERER']', '$_SERVER['HTTP_USER_AGENT']'); ";$insert = 
mysql_query($query);?>

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


Re: [PHP] Error(Newbie)

2002-06-22 Thread webmaster

I got that auto add slashes thing on. is it enough?

If not how should I go about adding them?

like this?

$_SERVER['REMOTE_HOST'] = addslashes($_SERVER['REMOTE_HOST']);

What sort of effects could an attack have?

I am intergrating stats into a site. What other vars could I gather info
from?

Thanks,

JJ Harrison
[EMAIL PROTECTED]
www.tececo.com

BTW I have fixed the error now.

- Original Message -
From: "1LT John W. Holmes" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Sunday, June 23, 2002 2:11 PM
Subject: Re: [PHP] Error(Newbie)


>$query = "INSERT INTO `stats` (`vid`, `id`, `vn`, `time`, `host`,
`referrer`, `browser`) VALUES ('', '$id', '$_COOKIE
>['tececo_stats']', '$time', '$_SERVER['REMOTE_HOST']',
'$_SERVER['HTTP_REFERER']', '$_SERVER
>['HTTP_USER_AGENT']'); ";

I hope you are using addslashes on your $_COOKIE and $_SERVER vars, too,
otherwise your query is wide open to some attacks...

---John Holmes...



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




[PHP] Accessing objects of other objects?

2003-08-29 Thread Webmaster
Hi,

I have the following problem:

On page "A" of my homepage I create an object "1" which itself creates an
object "2".
Now how can I access the properties of object "2" from "A" ?

It doesn't seem to work.
I am fairly new to Object Oriented Programming.
Thank you very much.

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



[PHP] Can Objects be passed to another page?

2003-09-03 Thread Webmaster
Hi,

is it possible to pass an Object to another php page?
I want to pass a whole bunch of varibales to another page.
For example the session ID, the language that the user choose,etc.
All those variables are in one or more objects.
Do I have to copy all those object attributes to variables and pass them via
the URL?

How is this done professionally?
Up to now I used cookies. But I would like to change that.
Not all users have cookies enabled.

Thx

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



[PHP] Question regarding OOP and interitance

2003-09-04 Thread Webmaster
Good day,

I would like to know a constructor function is also inherited to a child
class.
I mean the child class also needs to have a constructor function but it must
have the same name as the class name.
How does that work?


Thank you very much.

BW

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



[PHP] Passing objects as a reference and extracting the index of an associative array.

2003-09-04 Thread Webmaster
Hi,

i am using the smarty template engine.
Here is the problem that I would like to ask about:

function initTop(&$page, $array)
{
  for ($i=0; $iassignVars(, $array[$i])
  }
}


The function is supposed to know which object's attributes she is supposed
to change. Do I have to pass the object as a reference? Have never worked
with References before.

The array is supposed to be associative.
The funcion assignVars() is called like this:

$objektname->assignVars("indexname of ass. array", $arraywert);

How do I get the indexname for each arrrayvalue, so I can pass it to the
function assignVars?

Is there a php function?

Thank you very much.

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



[PHP] Passing Objects between scripts and guarateeing that a language has been choosen.

2003-09-04 Thread Webmaster
Hi,

I am just starting to understand how the session handling routines work in
php.
I can pass objects to other scripts. So I can put the language into the
object that the visitor chose at the very first page.
But what if a visitor bookmarked my homepage and comes back after a few
weeks.
How can I guarantee that a language is always choosen? I mean how is this
done professionally?
What do I have to write at the beginning of every page?

I hope it is clear what I am asking.

Thank you very much.


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



[PHP] IP adress problem

2003-09-16 Thread Webmaster
Hi,

why doesn't this work?

## IP FUNCTIONS ##
function assignClientIP()
{
if (getenv('HTTP_X_FORWARDED_FOR') == '')
{
$this->aCustomer->setClientIP((!empty($HTTP_SERVER_VARS['REMOTE_ADDR']) ) ?
$HTTP_SERVER_VARS['REMOTE_ADDR'] : ( (
!empty($HTTP_ENV_VARS['REMOTE_ADDR']) ) ? $HTTP_ENV_VARS['REMOTE_ADDR'] :
$REMOTE_ADDR ));
}

else
{
$this->aCustomer->setClientIP("Proxy");
}
}

The Attribut $clientIP is always empty.


-- 
ABSOLUT ANONYMES FILESHARING:
http://www.freenetproject.org/

ABSOLUT ANONYMER IRC CHAT:
http://www.invisiblenet.net/

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



[PHP] Creating Objects!

2003-09-23 Thread Webmaster

HI,

let us say there is Class A.
In the constructor of this class I create an Object B of Class B.

Now what is the difference between these two ?

this->B = new B;

and

B = new B;


Thank you very much!

Wenmaster

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



[PHP] Creating objects

2003-09-23 Thread Webmaster
Hi,

let us say there is Class A.
In the constructor of this class I create an Object B of Class B.

Now what is the difference between these two ?

this->B = new B;

and

B = new B;


Thank you very much!

Wenmaster

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



[PHP] WHAT IS PEAR?

2003-09-24 Thread Webmaster
I checked the PEAR HOMEPAGE but still I don't quite understand what the
project is about.
I am familiar with writing classes and functions.
Now, I can not figure out what the deal is. Does Pear consist of a class
library that comes with the installation?
There is a directory "pear" which is full of rar archives. How does that
come into play.
Does the standard installation provide SMARTY support or does it need
additional configuration?
If it does is there some some sort of crash course how to use it? Also an
overview of what actually is available would come in handy.

Thank you very much.

W.

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



[PHP] Sessions

2003-10-07 Thread Webmaster
Hi!

I started to use the php own session functions today.

Now I am getting such lines in the address bar:

/pages/news.php?option=1015&PHPSESSID=PHPSESSID=d117dba208d4b205cd4e521f606b
b44e#result

Why do I get "PHPSESSID=PHPSESSID=" ?

Thank you.

Webmaster

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



[PHP] Smarty problem

2003-10-08 Thread Webmaster
Hi,

I already posted this question in the Smarty group, without success.

I have a problem with Smarty. I wrote the following function that gets data
from a mysql database:

 function showHeadlines()
 {
  global $db;
  $entry_events = array();

  if ($this->showold == "true")
 {
  $db->select("*", "news", "(d_kategorie = 'de_termin')", "d_datum
ASC", "", "", "");

  $entry_events = $db->fetch_array();

  $this->assignVars('termineAus', $this->aTrans['termineAus']);
   $this->assignVars('entry_events', $entry_events);
  }

The template part looks like this:

   

  {$events}
 
 
  {$termineAus}
 
 {section name=i loop=$entry_events}
 
 {$entry_events[i].d_datum}
{$entry_events[i].d_zeit}
 
 
 {$entry_events[i].d_ueberschrift}
 
 
 {$place}: {$entry_events[i].d_ort}
 
 {/section}
   


The problem is that the output in only garbage?
Is there a logical problem ?

Thank you very much

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



[PHP] About php

2003-11-10 Thread webmaster
We have a data base in access 2000.
 Could you advise which version of php will connect to the access.
 Please advise also how can i open the connection .
 
 Thank you in advance for your  assistance.
 
 Best regards 
 Marlyn Estefanos
 Businesslink.

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



RE: [PHP] Communicating with remote server

2003-11-17 Thread Webmaster
Well, I know how to run MySQL queries and connect to the db and things
like that.  But I would like to be able to connect to a remote site (ex:
http://my-site.com/functions.php).  Here I would like to run functions
from the remote functions.php file and have it connect to it's own
server's db.  Then I want to be able to have certain information sent
back to me.  Maybe sockets is the best way to do this, but I don't know
much about them.  Any advice anyone?

Matt


-Original Message-
From: Jeff McKeon [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 17, 2003 5:14 PM
To: Matt Palermo
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Communicating with remote server

Matt Palermo wrote:
> I am writing a desktop application using PHP-GTK.  I would
> like this program to be able to connect to a remote server,
> call some functions that I specify, and return the right
> information (most likely from a MySQL db).  I have access to
> the server, so I can create any and all functions that I
> want, but I don't know how to connect to the remote server
> page and get all the results.  I am new to cross-server
> comunication programming, so if anyone knows of a very
> detailed and easy to learn tutorial please send me the link.
> I would appreciate any help you are willing to offer.
> 
> Thanks,
> 
> Matt

For mysql queries I use this...

function db_connect($dbhost,$dbname,$dbuser,$dbpass) {

global $MYSQL_ERRNO, $MYSQL_ERROR;

$link = mysql_connect($dbhost,$dbname,$dbuser,$dbpass);
if (!$link_id) {
$MYSQL_ERRNO = 0;
$MYSQL_ERROR = "Connection failed to the host $dbhost";
return 0;
}
else if(empty($dbname) && !mysql_select_db($dbname)) {
$MYSQL_ERRNO = mysql_errno();
$MYSQL_ERROR = mysql_error();
return 0;
}
else return $link;
}

$link_id=db_connect(dbname,db_user_name,db_user_pass);
Mysql_select_db(dbname, $link_id);

$query="select * from tablename";

$result=mysql_query($query);

While ($query_data=mysql_fetch_row($result)) 
{
echo $query_data[0],$query_data[1],$query_data[2],etc
}

Jeff

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



RE: [PHP] Communicating with remote server

2003-11-17 Thread Webmaster
Yes, the remote server does have PHP.  This sounds like a good idea.  Is
it relatively easy to do?  I have never worked with HTTP protocol
functions for this.  Do you know of a tutorial I could look through to
learn a little of this?

Thanks,

Matt


-Original Message-
From: Marek Kilimajer [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 17, 2003 5:26 PM
To: Matt Palermo
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Communicating with remote server

Matt Palermo wrote:
> I am writing a desktop application using PHP-GTK.  I would like this
program
> to be able to connect to a remote server, call some functions that I
> specify, and return the right information (most likely from a MySQL
db).  I
> have access to the server, so I can create any and all functions that
I
> want, but I don't know how to connect to the remote server page and
get all
> the results.  I am new to cross-server comunication programming, so if
> anyone knows of a very detailed and easy to learn tutorial please send
me
> the link.  I would appreciate any help you are willing to offer.
> 
> Thanks,
> 
> Matt
> 
> 

If the remote server has webserver with php, you can use http protocol 
to call functions and get the results. You can use one of the http 
classes that can make both get and post requests in your GTK-PHP app, to

return information from the server I would use XML, but you can use 
other format - csv, or even php code that you will eval()

Keep security in mind!

Marek

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



RE: [PHP] Communicating with remote server

2003-11-17 Thread Webmaster
Yes, both my server and the remote server have webservers with PHP
installed.  I have access to both servers to edit/modify/create files
etc.  I don't have SSH on the server's though.  I have FTP access, so I
can work with anything that way.  I basically just need a relatively
easy way to communicate back and forth between the servers.  I just have
no prior experience doing it so I need a little guidance.

Thanks,

Matt

-Original Message-
From: Vail, Warren [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 17, 2003 7:09 PM
To: 'Webmaster'; 'Jeff McKeon'
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Communicating with remote server

Lot's of options.  

Will this access be across the internet, or behind a firewall?  

Are you concerned about securing your information from prying eyes?  

You seem to be focusing on a script that runs on the remote machine,
does
this machine have a web server as well, or will you be executing PHP as
a
standalone process?

I am taking it for granted that you have PHP installed on the remote
machine?

Do you have access to commands like REXEC, RCP, RSH, SSH on your local
machine, and are the required daemons running on the remote machine?

What platforms are involved at each end?

Just a few questions that may have an impact on your solution...

Warren Vail

-Original Message-
From: Webmaster [mailto:[EMAIL PROTECTED]
Sent: Monday, November 17, 2003 2:19 PM
To: 'Jeff McKeon'
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Communicating with remote server


Well, I know how to run MySQL queries and connect to the db and things
like that.  But I would like to be able to connect to a remote site (ex:
http://my-site.com/functions.php).  Here I would like to run functions
from the remote functions.php file and have it connect to it's own
server's db.  Then I want to be able to have certain information sent
back to me.  Maybe sockets is the best way to do this, but I don't know
much about them.  Any advice anyone?

Matt


-Original Message-
From: Jeff McKeon [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 17, 2003 5:14 PM
To: Matt Palermo
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Communicating with remote server

Matt Palermo wrote:
> I am writing a desktop application using PHP-GTK.  I would
> like this program to be able to connect to a remote server,
> call some functions that I specify, and return the right
> information (most likely from a MySQL db).  I have access to
> the server, so I can create any and all functions that I
> want, but I don't know how to connect to the remote server
> page and get all the results.  I am new to cross-server
> comunication programming, so if anyone knows of a very
> detailed and easy to learn tutorial please send me the link.
> I would appreciate any help you are willing to offer.
> 
> Thanks,
> 
> Matt

For mysql queries I use this...

function db_connect($dbhost,$dbname,$dbuser,$dbpass) {

global $MYSQL_ERRNO, $MYSQL_ERROR;

$link = mysql_connect($dbhost,$dbname,$dbuser,$dbpass);
if (!$link_id) {
$MYSQL_ERRNO = 0;
$MYSQL_ERROR = "Connection failed to the host $dbhost";
return 0;
}
else if(empty($dbname) && !mysql_select_db($dbname)) {
$MYSQL_ERRNO = mysql_errno();
$MYSQL_ERROR = mysql_error();
return 0;
}
else return $link;
}

$link_id=db_connect(dbname,db_user_name,db_user_pass);
Mysql_select_db(dbname, $link_id);

$query="select * from tablename";

$result=mysql_query($query);

While ($query_data=mysql_fetch_row($result)) 
{
echo $query_data[0],$query_data[1],$query_data[2],etc
}

Jeff

-- 
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] serialize and unserialize

2003-12-22 Thread webmaster



Hello all i need a little help with serialize and unserialize

here is my code
 'cart', 'y' => $password);
session_register("y");
$var = serialize($data);
//$chksum = md5($data . md5('secret salt here'));
//$var = serialize(array($data,$chksum));
setcookie('data', $var, time() + 3600);




   } else {

$var = unserialize($_COOKIE['data']);
list($data, $chksum) = $var;
if (md5($data . md5('secret salt here')) == $chksum)
{
   // Data is valid
   $data = unserialize($_COOKIE['data']);
list($y, $chksum) = $data;
   $x = $data['x'];
   $y = $data['y'];
session_register("y");
}
//session_register("y");






}

?>

the problem is when i try to pull it back out to use the number that is generated by 
$password it gives me this error
Notice: unserialize(): Error at offset 9 of 118 bytes in c:\program files\apache 
group\apache\htdocs\header.php on line 24

any ideas towards fixin this would be appreciated


   
   
 



[PHP] need help getting one variable

2003-12-22 Thread webmaster
hello all i need help to enter one variable in a cookie and then retreive it back 
later, i know this probably sounds dumb to most but this is really the first time ive 
tried working with cookies so please bear with me, thanks for any help.


[PHP] need a little help all

2003-12-28 Thread webmaster
Here is what i have i call 2 cookies in the top of my script, now i need to
call another when another script is called but it keeps givin me the error
headers already sent,
now ive seen this done in other scripts but wont work for me so please help
me is it in my php.ini or is it just not possible and imagened seeing it
somwhere else. Thanks all.

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



[PHP] need help with php and mysql

2003-12-31 Thread webmaster
i made a bobo and now mysql server is returning a to many connections error i dont 
have access to reboot so is there a comand i can use to close all connections.


[PHP] need help with php and mysql

2003-12-31 Thread webmaster
hi all i had an to many connections error with mysql
i dont have anyway to reboot the server so is there someway i can give php a command 
and shut down all open connections on mysql thank you


[PHP] I need a little help

2004-01-11 Thread webmaster
Hello all i have probably a pretty dumb one here. i need help with getting the proper 
count on my referrals the way i set it up was i was just going to count down the line 
by using the member table, i enter the referral in the member table when the new user 
is added, this may have been a bad idea but i figured it would save sql resources, 
well the problem is when i do the count it does okay unless i run accross a member who 
doesnt have a downline yet, say member1 has 4 referrals member2 has 3 well if the 
first of the 4 from member1 doesnt have any then it wont show what the next member 
has. i believe i need to place them in a array before using the count and im not sure 
of a good way to pull table information to an array. So really if someone could just 
show me a goodway to put information from a table into an array i could probably 
figure the rest out. Thanks for any help.


[PHP] I am totally nuts/banana. Please somebody help me with an include problem.

2004-01-12 Thread Webmaster
Hello,

please can somebody help me. I am going nuts.
Really I am close to totally freaking out.

I have a problem that seems minor and ridiculous but cost me already 3
working days.

I have a working php/mysql homepage and used to use Ommnihttpd until 3 days
ago.
I installed the latest versions of Apache and php4 3 days ago on Windows
2000.

No matter what I do my script can not include another file from a directory
on the same level in the directory tree.

I have the following directory structure:

c:\webpage\classes\_dentonaproject\page_dentona.class.php
c:\webpage\classes\design\page.class.php

In the file page_dentona.class.php the first line says the following:

require_once('../design/page.class.php');

The following error message comes up:

 Warning: main(../design/page.class.php): failed to open stream: No such
file or directory in
D:\dentona_new\classes\_dentonaproject\page_dentona.class.php on line 2

Fatal error: main(): Failed opening required '../design/page.class.php'
(include_path='.;c:\php4\pear') in
D:\dentona_new\classes\_dentonaproject\page_dentona.class.php on line 2


I wrote a test.php file in the _dentonaproject directory:



and put this into the design directory:



and it works fine.

What could be the problem. Really I am getting grey hair.
Is there ANYTHING in the php.ini file httpd.conf that could cause this?

I looked them over about 50 times.
Thx webmaster

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



[PHP] Putting php at end of html?

2001-03-15 Thread webmaster

I am creating a site right now and I think many of the pages will 
use php in the future...But not right now.

Should I put the .php extentsion at the end of these pages now 
even though they currently do not have php on them.

So there anything that can go wrong if I do this?

Steve

-- 
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] Hey Everyone

2001-03-19 Thread WebMaster

Hi Everyone,

I just wanted to let you know (and thank some of you for all your help!), that I've 
finally launched my revamped website.

There are two main sections in the site:
Section 1 is for High School and College Students and has almost 3000 Essays available.
Section 2 is for anyone seeking a Cisco Career Certification.

All Documents and Study Guides/Cheat Sheets are absolutely free! So Enjoy!

Since the site is free, I'm not about to fork out dough for Advertising, so pass the 
word around for me, would ya?


Thanks!

Clayton Dukes
The Global Document Database
http://www.gdd.net




Re: [PHP] protecting video files

2001-05-11 Thread WebMaster

I did :( went character by character and could find not extra spaces.

At 06:16 PM 5/11/01 -0400, Michael Kimsal wrote:
>Check for extraneous spaces in your script.
>
>Tim Schulte wrote:
>
> > Hi there -
> >
> > I am having some weird problems here. I am try to write a script that
> > will check to see where a movie file is being called from. I want to define
> > which web page I will allow a movie to be called from, and block all 
> others.
> > The script so far looks like this:
> >
> > The file gets called like this
> > http://www.hardcorehosting.com/video/playmovie.php?movie=test.mov
> >
> >   playmovie.php  ===
> >  > header("Content-type: video/quicktime");
> > $file=fopen($movie, "r");
> > fpassthru($file);
> > ?>
> > = end script  ===
> >
> > which works fine until I add this at the top
> >
> > if($HTTP_REFERER != "http://www.hardcorehosting.com/video/test.html";)
> > {
> > exit();
> > }
> >
> > to check and see where the page is being called from. It then gives me a
> > broken image. I've checked for space's and can't see what I'm doing wrong
> > :( Any suggestions ?? Thanks.
> >
> > Tim Schulte
> > [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]



-- 
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] creating table help

2002-04-19 Thread webmaster

I'm very new to php and PostgreSQL.  I keep getting the following error
when I try to create a table:

Warning: Wrong parameter count for pg_exec() in
/var/www/html/elkan/createtable.php on line 23
The table, ghdsl could not be created

Here is the code I'm using:



thanks for any help.


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




[PHP] authorization headers

2002-04-25 Thread webmaster

does anybody know how to pass the correct username and password as a
header
to a directory with an .htaccess file.

i tried

header("Authorization: Basic username:password");

like that and also where the username:password was base 64 encoded and
it
isn't working.

thanks.


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




[PHP] auto_increment

2002-04-26 Thread webmaster

I'm using PHP v.4.0.6. and PostgreSQL 7.2.  Does any one know the
equivilant of auto_increment for postgresSQL?  For example when creating
a table:

$query = "CREATE table $tablename (id INT UNSIGNED NOT NULL
AUTO_INCREMENT PRIMARY KEY, firstname TEXT, lastname TEXT, emailaddress
TEXT, )";

this works fine in MySQL, but I keep getting errors with PostgreSQL.

thanks for any help,
-Elkan


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




[PHP] Defining PHP varibles from URL

2002-05-04 Thread webmaster



I can't seem to define a varible from the url 
entered into a browser.
 
I wish to use the following code or something like 
it.

="php">

$file = "";
//the above is defined from the url

include "$file";

It could be what I was typing in the url bar. file.php?file=foobar.inc   Thanks, JJ Harrison[EMAIL PROTECTED]www.tececo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Defining PHP varibles from URL




I don't mean to be a pain but could someone send me 
a working example?
 
I am what you would probably call a 
'newbie'
 
For those who don't know here is my previous 
message
 
 can't seem to define a varible from the url 
entered into a browser.
 
I wish to use the following code or something like 
it.

="php">

$file = "";
//the above is defined from the url

include "$file";

It could be what I was typing in the url bar. file.php?file=foobar.inc   Thanks, JJ Harrison[EMAIL PROTECTED]www.tececo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Defining PHP varibles from URL Solved!




Sorry I did read all your replies etc. They were 
helpful.
 
I have now solved the 'problem' and thank you 
all.
 
I have less than week of experiance in PHP and am 
still learning.
 
JJ Harrison[EMAIL PROTECTED]www.tececo.com

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


[PHP] .vcf files and PHP Email Form(Newbie)


I want to create an e-mail form that writes a (person's name).vcf(vCard)
file and attaches it to the message. This would allow me to eaisly add
people to my address book.

The source of a sample .vcf(vCard) file is shown below:
BEGIN:VCARD
VERSION:2.1
N:Harrison;JJ
FN:Harrison, JJ
ORG:TecEco Pty. Ltd.;IT
TITLE:Webmaster
ADR;WORK:;;497 main road Glenorchy;Hobart;Tasmania;7010;Australia
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:497 main road Glenorchy=0D=0AHobart,
Tasmania 7010=0D=0AAustralia
ADR;HOME:;;12 Harbinger Lane Austin's Ferry;Hobart;Tasmania;7011;Australia
LABEL;HOME;ENCODING=QUOTED-PRINTABLE:12 Harbinger Lane Austin's
Ferry=0D=0AHobart, Tasmania 7011=0D=0AAustralia
X-WAB-GENDER:2
URL;WORK:http://www.tececo.com
EMAIL;PREF;INTERNET:[EMAIL PROTECTED]
REV:20020512T063717Z
END:VCARD

Does anyone have any ideas or know of a pre-built script to do this?

Thanks,

JJ Harrison
[EMAIL PROTECTED]
www.tececo.com



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


Re: [PHP] .vcf files and PHP Email Form(Newbie)


I don't have much experiance with MIME. where could I find a tutorial or
ready made class?

- Original Message -
From: "Miguel Cruz" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, May 12, 2002 4:41 PM
Subject: Re: [PHP] .vcf files and PHP Email Form(Newbie)


> Use any of about 10 billion available MIME mail classes/functions (or
> write your own; there's really nothing to it) and attach the vcard as
> content-type: text/x-vcard.
>
> miguel
>
> On Sun, 12 May 2002 [EMAIL PROTECTED] wrote:
> > I want to create an e-mail form that writes a (person's name).vcf(vCard)
> > file and attaches it to the message. This would allow me to eaisly add
> > people to my address book.
> >
> > The source of a sample .vcf(vCard) file is shown below:
> > BEGIN:VCARD
> > VERSION:2.1
> > N:Harrison;JJ
> > FN:Harrison, JJ
> > ORG:TecEco Pty. Ltd.;IT
> > TITLE:Webmaster
> > ADR;WORK:;;497 main road Glenorchy;Hobart;Tasmania;7010;Australia
> > LABEL;WORK;ENCODING=QUOTED-PRINTABLE:497 main road
Glenorchy=0D=0AHobart,
> > Tasmania 7010=0D=0AAustralia
> > ADR;HOME:;;12 Harbinger Lane Austin's
Ferry;Hobart;Tasmania;7011;Australia
> > LABEL;HOME;ENCODING=QUOTED-PRINTABLE:12 Harbinger Lane Austin's
> > Ferry=0D=0AHobart, Tasmania 7011=0D=0AAustralia
> > X-WAB-GENDER:2
> > URL;WORK:http://www.tececo.com
> > EMAIL;PREF;INTERNET:[EMAIL PROTECTED]
> > REV:20020512T063717Z
> > END:VCARD
> >
> > Does anyone have any ideas or know of a pre-built script to do this?
> >
> > Thanks,
> >
> > JJ Harrison
> > [EMAIL PROTECTED]
> > www.tececo.com
> >
> >


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




RE: [PHP] Re: MySQL or FlatFile




I am very new to PHP(Still awaiting a book, Only 
done a few tutorials and read bits of the PHP manual).
 
But if you used:
mysql_pconnect($host, $user, 
$password)
It would keep a consistant connection to the 
database so it may speed things up a bit.
 
JJ Harrison[EMAIL PROTECTED]www.tececo.com
 
 
-Original Message-
If the content is going to be the same each time, then loading from 
aflat-file would probably be better, because accessing a database 
wouldrequire the connection to be established, the database to parse and 
executeyour query, then send that data back. Where as reading from the file, 
it'sjust open file, read file, close file, a lot 
quicker.-Original Message-From: David Duong 
[mailto:[EMAIL PROTECTED]]Sent: Monday, May 13, 2002 10:46 AMTo: 
[EMAIL PROTECTED]Subject: 
[PHP] Re: MySQL or FlatFileI am referring to whole PHP/Perl 
files.  It is necessary to load them asmuch as 20+ times within the 
same hour what would be better MySql orFlatfile?-- PHP 
General Mailing List (http://www.php.net/)To unsubscribe, visit: http://www.php.net/unsub.php-- 
PHP General Mailing List (http://www.php.net/)To unsubscribe, visit: http://www.php.net/unsub.php

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


Re: [PHP] PHP and mySQL


You are missing a " before $booktitle.
old:booktitle=$booktitle AND quantity=quantity";
new:booktitle="$booktitle AND quantity=quantity";

JJ Harrison
[EMAIL PROTECTED]
www.tececo.com

- Original Message -
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, May 14, 2002 8:51 PM
Subject: Re: [PHP] PHP and mySQL


> On Tuesday 14 May 2002 18:38, City Colleges of Chicago - Mannheim wrote:
> > I am getting a parse error on line 75. I am trying to say:
> >
> > if there is a booktitle and a quantity chosen, then go to that booktitle
> > and adjust the quantity in the database.
>
> if ($booktitle AND $quantity) { ...
>
> >  >  $user = "adminer";
> >  $pass = "hoosiers";
> >  $db = "Book Store1";
> >  $local = "jolinux";
> >  $link = mysql_connect( "$local", $user, $pass   );
> >  if (! $link )
> >die ( "Couldn't open the database" );
> >  mysql_select_db( $db, $link )
> >  or die ( "Couldn't open the $db: ".mysql_error() );
> >
> >  if ($submit){
> >  if( $booktitle, "quantity" ){
> > $sql = "UPDATE Book2 SET stock ='$stock-quantity' WHERE
> > booktitle=$booktitle AND quantity=quantity";
> >  }
> > // $result = mysql_query($mysql);
> >  }else if(!$submit){
> >   echo "Your order has not been placed.";
> >  }
> >  ?>
> > 
> > 
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> "All we are given is possibilities -- to make ourselves one thing or
another."
> -- Ortega y Gasset
> */
>
>
> --
> 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] Listing the contents of a directory in an array




I am a newbie so be kindI have looked into 
the manual about directory functions etc.I want to return all the files 
from a directory into a array.
 
Could some one give me a few pointers or 
something?
 
I keep getting confused but I have used google and 
the manual.
 
I can find functions but I am not sure how I 
can list the files into an array.
 
Thanks in advance,
 
JJ Harrison[EMAIL PROTECTED]www.tececo.com

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


[PHP] document root variable or function




Is there a variable in PHP which will show the 
directory of the document root? I have done a few searches and before I go 
looking harder I thought I'd ask. My problem is that I am using both windows, 
IIS and linux, Apache. I tried a few things like $document_root which didn't 
seem to work but I didn't try very hard :)
 
Below is an example of what I want to 
do:

include "(magic variable or function)/$file;
JJ Harrison[EMAIL PROTECTED]www.tececo.com
P.S. Can anyone suggest a good text 
editor for PHP and html?
 

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


[PHP] (newbi)mySQL query question




This doesn't have a huge amount to do with PHP 
but,
 
I have the following code for my SQL 
query:

$query = "SELECT code FROM links WHERE sort_text = $letter*";
I get an error.
What I want to do is be able to specify 
a letter and have the rest be undefined eg
if $letter was t
I would get TecEco, Tiny, and 
Trailer
and if $letter was b I would get Basket 
and Ball.
Could any one show me the correct 
syntax off their heads?JJ Harrison[EMAIL PROTECTED]www.tececo.com
 

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


[PHP] Complex(ish) Question for Newbie




How can I return the last five lines of a mySQL 
database table?
 
JJ Harrison[EMAIL PROTECTED]www.tececo.com

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


[PHP] Problem with




I have the following code for a mySQL query in 
php:
 

$text = "sort_text";
$query = "SELECT code FROM links ORDER BY $text WHERE ".$text." like 
'".$l."%'";
$result = mysql_query($query) or die("Query failed");
When I do the query I get Query 
failed.
When I remove the sort parameter they 
are all printed correctly(except the fact the aren't in alphabetical 
order)
I am a newbie so be nice.
Any Ideas?
JJ Harrison[EMAIL PROTECTED]www.tececo.com

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


[PHP] Searching for any number in a mysql query





This isn't a one hundred percent PHP Q but here I 
go.
 
If I have the following query:

$query = "SELECT code FROM links WHERE ".$text." like '".$l."%' ORDER BY 
sort_text";
and define the letter a letter i.e x.
it works fine.
I am not sure what to do if I want to say get 
something that starts with (from one to ten).
I want to say all the numbers at once, not one at a 
time.
Any help appreciated,
JJ Harrison[EMAIL PROTECTED]www.tececo.com

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


[PHP] Reverse mySQL date




How can I reverse the date coming out of 
mySQL?
 
 
ie 2002-05-21
 
becomes 21-05-2002
 
Can do it in the mySQL query or do I need to use 
PHP?
 
Thanks in advance,
 
JJ Harrison[EMAIL PROTECTED]www.tececo.com

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


[PHP] Parse Error(Newbie)




I get a parse error on line 114 can anyone see the 
problem?
 
Sorry if it is something obvious :}

for ($i=0; $i <$num_results; $i++)
110. {
111. $row = mysql_fetch_array($result);
112. echo '';
115. echo $row['description'];
116. echo '';
}
JJ Harrison[EMAIL PROTECTED]www.tececo.com

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


[PHP] Confusion with UNIX date/time




What php functions should I use to convert a UNIX 
timestamp to a human - legible format and back again?
 
I have looked in the manual and used google etc but 
I am only getting more confused :}
 
JJ Harrison[EMAIL PROTECTED]www.tececo.com

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


[PHP] Parse Error(Newbie)




I know it is probably something obvious but the 
following gives me a parse error and as a newbie I am having trouble locating 
it.
 
$query = "select * from news WHERE id = 
"$_get['id']"";
 
JJ Harrison[EMAIL PROTECTED]www.tececo.com

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


[PHP] auto_increment


I think this is any easy question, but I couldn't find an answer in the
php Black Book for PostgreSQL.  Does anyone know the equivilant of
auto_increment for PostgreSQL?  This is the php code that I have:

$query = "CREATE table $tablename (id INT NOT NULL PRIMARY KEY, ip TEXT,
customer TEXT, dslphone TEXT, date TEXT, vpivci TEXT)";

This creates the table, but when I need to add data to the Database, I
have to specify a unique id each time.  I need want the id to
automatically increment each time data is added the the DataBase.  Is
there a way to do this by adding an auto_increment option to the id
field when the table is first created?

Thanks for any Help,
-Elkan

PHP version: 4.0.6
OS: RH 7.2
PostgreSQL: v.7.1


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




[PHP] Parse Error(newbie)




I get a parse error on this line
 
$query = "SELECT * FROM news ORDER BY id DESC LIMIT 
1";
 
I believe that it is an error in the SQL 
statement
 
Thanks in advance
 
JJ Harrison[EMAIL PROTECTED]www.tececo.com

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


Re: [PHP] Parse Error(newbie)


Here is the function:

function print_new_story(){
$query = "SELECT * FROM news ORDER BY id DESC LIMIT 1";
$result = mysql_query($query);
$num_results = mysql_num_rows($result);

for ($i=0; $i < $num_results; $i++)
  {
 $row = mysql_fetch_array($result);
 echo ': ';
 echo $row['title'];
 if(!$row['date'] == 0){
 echo ' - ';
 echo date("d-M-y", $row['date']);
 }
 echo ' :';
include $row['int_location'];
  }

}

and here is the error message:
Parse error: parse error in \\johnh\c\co2 busters\includes\functions.php on
line 81
- Original Message -
From: "Nick Wilson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, May 29, 2002 11:08 PM
Subject: Re: [PHP] Parse Error(newbie)


> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
>
> * and then [EMAIL PROTECTED] declared
> > I get a parse error on this line
> >
> > $query = "SELECT * FROM news ORDER BY id DESC LIMIT 1";
> >
> > I believe that it is an error in the SQL statement
>
> Nothing wrong with that. Let's have the whole error msg and the code
> surrouding the line it says it's on please It might well not be on
> that line at all.
> - --
> Nick Wilson // www.tioka.com
>
>
>
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.0.6 (GNU/Linux)
>
> iD8DBQE89NLaHpvrrTa6L5oRAiZ0AJ9fXPhupt203ghx8nNnDkgrtkgpsgCfQRFO
> tpYkUeHN5k9+EZxGuZbP34k=
> =QCuq
> -END PGP SIGNATURE-
>
> --
> 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] Parse Error(newbie)


Line 81 is $query.

I showed it in my first email.

I suspect this line is the one causing the trouble(It is about four lines
above the start of the function and is the only previous PHP statement)
mysql_query("delete from conf_event where time < ( time() );

- Original Message -
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, May 29, 2002 11:11 PM
Subject: Re: [PHP] Parse Error(newbie)


> On Wednesday 29 May 2002 21:13, [EMAIL PROTECTED] wrote:
> > Here is the function:
> >
> > function print_new_story(){
> > $query = "SELECT * FROM news ORDER BY id DESC LIMIT 1";
> > $result = mysql_query($query);
> > $num_results = mysql_num_rows($result);
> >
> > for ($i=0; $i < $num_results; $i++)
> >   {
> >  $row = mysql_fetch_array($result);
> >  echo ': ';
> >  echo $row['title'];
> >  if(!$row['date'] == 0){
> >  echo ' - ';
> >  echo date("d-M-y", $row['date']);
> >  }
> >  echo ' :';
> > include $row['int_location'];
> >   }
> >
> > }
> >
> > and here is the error message:
> > Parse error: parse error in \\johnh\c\co2 busters\includes\functions.php
on
> > line 81
>
> We're not mind readers, which is line 81?
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> Would it help if I got out and pushed?
> -- Princess Leia Organa
> */
>
>
> --
> 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] Periods with UNIX timestamps




Where is the best place to find out the values in 
seconds(i.e. UNIX time stamps) for standard periods of time such as one day and 
one week and one month(The month thing would need to be correct for each 
month)
 
JJ Harrison[EMAIL PROTECTED]www.tececo.com

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


Re: [PHP] Parse Error(newbie)


Notepad at the moment as I can't change the settings of my computer due to
lack of privilages
- Original Message -
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, May 29, 2002 11:26 PM
Subject: Re: [PHP] Parse Error(newbie)


> On Wednesday 29 May 2002 21:22, Niklas Lampén wrote:
> > mysql_query("delete from conf_event where time < ( time() );
> >
> > You're missing the ending " there.
> >
> >
> > Niklas
> >
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> > Sent: 29. toukokuuta 2002 16:20
> > To: [EMAIL PROTECTED]
> > Subject: Re: [PHP] Parse Error(newbie)
> >
> >
> > Line 81 is $query.
> >
> > I showed it in my first email.
> >
> > I suspect this line is the one causing the trouble(It is about four
> > lines above the start of the function and is the only previous PHP
> > statement) mysql_query("delete from conf_event where time < ( time() );
>
> It is cases like these where an editor with /decent/ syntax highlighting
is
> invaluable.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> A man is like a rusty wheel on a rusty cart,
> He sings his song as he rattles along and then he falls apart.
> -- Richard Thompson
> */
>
>
> --
> 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] Month Values in UNIX timestamps and workaround(Newbie)




I began to write a function that correctly diveded 
up the months into their correct UNIX timestamps and wrote content from a 
database accordingly.
 
I have had an idea that maybe eaiser to implement 
but slower. Could one or two people tell me what the think and if it is a good 
idea. I am also interested in speed and efficiany of both methods.
 
The original method is:
 
I do a few maths functions to get the value in 
seconds of each month etc
 
New Method:
 
I do string compares with with dates then convert 
them to UNIX timestamps.
 
JJ Harrison[EMAIL PROTECTED]www.tececo.com

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


[PHP] Replacing Number with Month(newbie)




Is there a magical function that I can use to 
convert 4 into April and 5 into May etc?
 
can I use mktime()
 
One yes no answer will do fine
 
JJ Harrison[EMAIL PROTECTED]www.tececo.com

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


[PHP] Not sure how to loop this...(Newbie)




I have this code:
 

$end_date = time();
$year = 2002;
$month = 4;
$monthi = $month + 1;
$time = SecondsInMonth($month, $year);
$time_i = SecondsInMonth($monthi, $year);
$query = "SELECT * FROM news WHERE date < $time_i AND date > $time 
ORDER BY id";
$result = mysql_query($query);
$num_results = mysql_num_rows($result);
 
echo '';
echo date('F', mktime(12, 0, 0, ++$month));
echo '';
echo '';
for ($i=0; $i < $num_results; $i++)
{
$row = mysql_fetch_array($result);
echo ': ';
echo $row['title'];
if(!$row['date'] == 0){
echo ' - ';
echo date("d-M-y", $row['date']);
}
echo ' :'; 
}
echo '';
if($month == 12){
$year++;
$month = 0;
}
And I am not sure how to loop 
it.
It Currently prints like this:

  
  

  May
: A Carbon Based Built Environment? - 
  21-May-02 :
I am not sure how to get the newest records to display at the top. Rather 
than the bottom. There is no looping yet as I am not sure how to do it. Can I 
reverse to results array or something? Every month is in a new set of 
cells.
 
Thanks,
 
JJ Harrison[EMAIL PROTECTED]www.tececo.com

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


[PHP] echoing two varibles(newbie)




How can I echo(or include) two 
variables?
 
ie include $DOCUMENT_ROOT then 
$row['location']
 
Thanks in Advance
 
JJ Harrison[EMAIL PROTECTED]www.tececo.com

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


[PHP] PHP and passwords


Is there a way to connect to your database using php without hard coding
a password into the php file?  We run PostgreSQL 7.1 on a Linux 7.2
server with the latest version of apache.  I don't want to change the
authentication within Postgres to not require a password.  But I also,
for security reasons, don't want to have passwords coded into the php
scripts for accessing the database.  I'm very new to php, but very
excited about what I've learned so far.  Any help would be appreciated.

thanks,

Elkan


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




[PHP] best linux choice for php / mysql ???


I've been using PHP/mySQL on my web host's site for a year or so, and I now
need to create my own installation ...

Given my relatively limited linux background, which distribution woud I find
easiest to install? I'll be needing PHP, mySQL, and PDFlib ...

I've done my homework, I've studied every linux text I could get my hands
on, and I feel like I'm ready to start ... but I don't want to install one
distribution, only to find that it is inappropriate for my needs ... Call me
lazy, but I only want to do this once (this week, anyway).

Any help would be most appreciated.

Thanks,

Kenn



-- 
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] Double your website traffic




Do you want to double the number of visitors to your homepage everyday? The 
perfect solution is PopUp Window Exchange!

It's a brand new concept from LinkExchange. It will pop up websites instead 
of traditional banners. As a result, it can bring you REAL web traffic 
instead of raw banner impressions which do not give you unique hits.  

Here is how it works. Let's assume your website currently has 100 visitors 
daily. If you join our free popup exchange, 30 days later, your website can have up to

100*(1+50%)**30days=19175105 visitors/day!

The above calculation is very simple. Since every member needs to insert a 
simple HTML code in their homepage, when other website pops up in your 
homepage, your homepage will also popup in a member's website. Essentially 
giving you a free visitor everytime someone visits your page. If you used 
to have 1 visitor, now you will have 2 (The 2nd visitor is brought to you 
by other members)  

More Information can be found at..
http://GoPopUp.com

-
[EMAIL PROTECTED]
http://GoPopUp.com

To be removed from our mailing list -> 
http://gopopup.com/unsubscrib.php?[EMAIL PROTECTED]


---Chinese-Big5
·Q§ó¦h¤Hª¾¹D§Aªººô¯¸¶Ü¡S §Ú­Ì¥i¥HÀ°§A¨C¤Ñ±N§Aªººô¯¸¤H¼Æ¼W¥[Âù­¿.
°²¦p§A¨C¤Ñ²{¦³100­Ó³X«È, ¦pªG§A¥[¤JPopUp Exchange, 30¤Ñ«á¡M
§Aªººô¯¸±N·|¦³19175105­Ó³X«È. 
100 * (1 + 50%) ** 30 days = 19175105 vistors/day
PopUp Exchange ªº¹B§@«D±`²³æ¡C  ¨C¦W¦¨­û¥u»Ý¦b¥Lªººô¯¸¤¤¥[¤J
¤@¬qPopUp HTML_CODE¡C  ³o´N¬O»¡,  ·í¨ä¥¦·|­ûªººô­¶¦b§Aªººô¯¸¤¤
PopUp¤@¦¸¡M ¦P¼Ë¦a¡M §Aªººô­¶¤]·|¦b¨ä¥¦·|­ûªººô¯¸¤¤PopUp¤@¦¸¡C
´N¬O»¡, ¦pªG§A¦³¤@­Ó³X«È¡M ´NÅܦ¨­Ç­Ó¡C
¥t¥~¡M PopUp¤£·|¼vÅT³X«È°ÑÆ[§Aªººô¯¸¡C¼u¥Xµ¡¤fÅã¥Ü¤_§A­ì¦³µ¡¤fªº©³³¡¡C 

½Ð¨ì¥H¤Uºô§}¥[¤J
http://GoPopUp.com/chinese.php

[EMAIL PROTECTED]
http://GoPopUp.com

¨ú®ø¹q¤l³ø¡H -> http://gopopup.com/unsubscrib.php?[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]




[PHP] Your invitation to the Legal Solutions Europe 2001 Conference


Hi

My apologies for writing to you unannounced. I came across your name whilst 
researching some data for the above event and I thought it might be of interest to 
you. For more info see below or visit www.lseurope.com

This is Europe's largest and most prestigious IT solutions event. It incorporates a 
comprehensive conference programme and a free to attend exhibition. The Legal 
Solutions conference will focus on how to develop and integrate an IT strategy into 
the overall framework of a law firm's key disciplines, including knowledge management, 
marketing, intranets, extranets, web technologies, and communications.
The  conference will feature keynote presentations from some of the world's 
acknowledged law firm management strategists such as:

David Maister
Prof Joost Breuker
Andrew Levison
Alan Hodgart 

and case studies from firms with the profile of:
Clifford Chance
Nauta Dutilh
Freshfield Bruckhaus Deringer.

I hope that you find the conference of interest and look forward to hearing from you.
Should you wish to register, please visit www.lseurope.com or reply to this email 
including your daytime telephone number and your address details.

Thank you.

Nick Hussey

P.S.: If you wish to be removed from our mailing list, please visit 
http://www.ark-interactive.com/cgi-bin/po4001/manager.pl?action=delete&email=php-general%40lists.php.net&group1=Roberto-law7-10

www.ark-interactive.com--

-- 
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] form data used on the same page?


Greetungs.

Is it possible to use data collected in a form ON THE SAME PAGE without
using the form's "submit" button? In other words, if a text field is filled
in, can I capture (via PHP or other means) the info typed there and display
it elsewhere on the same page?

I realize the answer may very well be "NO," but if it is possible, it would
certainly make my life easier this morning.

Thanks in advance.

Kenn



-- 
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] Problem with PHP y Phorummail


Hi people:

I trying to execute Phorummail script (put email into a web message board) from my 
shell, but I get this error message.

[root@corotu docs]# ./phorummail
php: error in loading shared libraries: libmysqlclient.so.6: cannot open shared
object file: No such file or directory

What can I do for execute this script properly, What I doing it wrong?

I am running Apache 1.3.20 - PHP 4.06 and MySQL 3.23.27

Thanks,

Peter Brumvig




[PHP] Unresolved Mistery Error in PHP


Hi people:

I trying to run a script from my shell but I get this error:

[root@corotu docs]# ./phorummail
php: error in loading shared libraries: libmysqlclient.so.6: cannot open
shared
object file: No such file or directory

Well, some people said to me that usually this library is located in
/usr/local/lib/mysql, I search this file in source of MySQL but not
exists!!! only there are libmysqlclient.so.10, I made a sym-link from
libmysqlclient.so.10 to libmysqlclient.so.6 after copy to
/usr/local/lib/mysql and don't work  I received the same error.

The error occurs with any php script not only with Phorummail.

I am on the edge of insane, please somebody help me, I was working in this
for one week.

Regards,

Peter Brumvig


-- 
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] execute remote CGI without redirect


How do you call for the execution of a CGI on a remote machine
without redirecting the output of that CGI to the browser?
I basically need to send form info to a CGI of a marketing
group, while keeping the browser on my site.

Thanks,
_Ken
[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]




[PHP] Installing PEAR on Windows

I've had no luck with the PEAR General List... so...

I've successfully "manually" installed PEAR onto my windows server after trying
many attempts at installing it properly - however, it's prooving a pain in the
arse to upgrade the packages, and install any new ones.

So, can anyone assist in why it won't install?

Loading zlib: ok
Using local package: PEAR.ok
Using local package: Archive_Tar..ok
Using local package: Console_Getoptok
Using local package: XML_RPC..ok
Bootstrapping: PEAR...(local) ok
Bootstrapping: Archive_Tar
Bootstrapping: Console_Getopt.
Using local package: DB...ok
Using local package: Net_Socket...ok
Using local package: Net_SMTP.ok
Using local package: Mail.ok
Using local package: XML_Parser...ok
Using local package: PHPUnit..ok
Extracting installer..
Warning: main(PEAR.php): failed to open stream: No such file or directory in C:\
www\pear\Archive\Tar.php on line 21

Fatal error: main(): Failed opening required 'PEAR.php' (include_path='/C:\DOCUM
E~1\ADMINI~1.DEV\LOCALS~1\Temp\gop1.tmp') in C:\www\pear\Archive\Tar.php on line
21

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



Re: [PHP] Installing PEAR on Windows

Hi Matt (et al),

I've added the c:\www\pear path to both the windows path and also the path in
the php.ini file.  However it's still coming up with the same error.  Is there
a way of putting in a temporary path in the go-pear.php file?

Nunners


Quoting "Matt M." <[EMAIL PROTECTED]>:

> > Warning: main(PEAR.php): failed to open stream: No such file or directory
> in C:\
> > www\pear\Archive\Tar.php on line 21
> >
> > Fatal error: main(): Failed opening required 'PEAR.php'
> (include_path='/C:\DOCUM
> > E~1\ADMINI~1.DEV\LOCALS~1\Temp\gop1.tmp') in C:\www\pear\Archive\Tar.php on
> line
> > 21
> >
> pear is requiring that PEAR.php be included in the script and it can't
> find it.  I think adding C:\www\pear\ to your include path might solve
> this problem
>
> --
> 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] Nueva web necesita enlaces php

Apreciados colegas, estoy desarrollando una web en  php que si bien no es muy 
complicada espero sea útil.

Se trata de http://www.rutaweb.com/

La web principalmente está dedicada a enlaces de calidad pero en breve estrenaré 
sección de PHP con tutoriales y scripts. 

De momento agradecería que le echarais un ojo y me hicieseis alguna sugerencia, 
observación, etc.

Además estoy buscando ENLACES DE CALIDAD de los temas que se muestran en el portal, si 
crees que hay algún enlace que deberia aparecer decidmelo!

Saludos y gracias



[PHP] pasring complex string question

Hello, 

i have a string looking like this.

 

## /T (KEY1)/V (VALUE1)|| ## /T (KEY2)/V (VALUE2)|| ## /V (VALUE3)/T
(KEY3)|| 

 

 

I know want to separete it in to keys and values and insert them into an
array.

Note that /T always shows that teh upcoming value in() is a Key and that /V
always is a Value. And that the set can be flipped.

 

Thank you very much for helping.

Mirco Blitz



AW: [PHP] Re: pasring complex string question

Thank you very much.

If anybody has some good links to ereg tutorials, I would love to get that
teached.

Thanks
Mirco Blitz

-Ursprüngliche Nachricht-
Von: Eli [mailto:[EMAIL PROTECTED] 
Gesendet: Freitag, 8. April 2005 06:40
An: php-general@lists.php.net; Webmaster
Betreff: [PHP] Re: pasring complex string question

Eli wrote:
> Webmaster wrote:
> 
>> Hello,
>> i have a string looking like this.
>>
>>  
>>
>> ## /T (KEY1)/V (VALUE1)|| ## /T (KEY2)/V (VALUE2)|| ## /V (VALUE3)/T
>> (KEY3)||
>>  
>>
>>  
>>
>> I know want to separete it in to keys and values and insert them into an
>> array.
>>
>> Note that /T always shows that teh upcoming value in() is a Key and 
>> that /V
>> always is a Value. And that the set can be flipped.
>>
>>  
>>
>> Thank you very much for helping.
>>
>> Mirco Blitz
>>
>>
> 
> It seems you complex yourself too much.. ;)
> 
> Try using regexp with the 'e' modifier:
> 
>  
> $data="## /T (KEY1)/V (VALUE1)|| ## /T (KEY2)/V (VALUE2)|| ## /V 
> (VALUE3)/T (KEY3)||";
> 
> $data_array=array();
> preg_replace(
> array(
> "/\#\#\s*/T\s*\(([^\)]*)\)\s*\V\s*\(([^\)]*)\)\s*\|\|/e",
> "/\#\#\s*/V\s*\(([^\)]*)\)\s*\T\s*\(([^\)]*)\)\s*\|\|/e"
> ),
> array(
> "\$data_array['\\1']='\\2';",
> "\$data_array['\\2']='\\1';"
> ),
> $data
> );
> 
> print_r($data_array);  //see if you get it as expected
> 
> ?>
> 
> I believe there's an easier way to store your data as strings (like 
> serialize), so why not using them?!
> see alse: http://www.php.net/serialize

Sorry... a little correction:



-- 
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] Another array sorting Problem

Hi,

I have a multidimensional array looking linke this

Rowid   title   kat
123 nr1 3
442 nr2 2
547665  nr3 5
4532nr4 3
3244nr5 1
124 nr6 2
776 nr7 4

I now need to sort that array first by kat and second on rowid, so it would
throw out:

Nr5
Nr6
Nr2
Nr1
Nr4
Nr7
Nr3

I tried to achieve that goal with array_multiosort(), but all I got was a
one way (either rowid or kat) sorting.

Do you know some kind of way to achieve my goal?

Thabk you for helping.
Mirco Blitz

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



AW: [PHP] Apache - IIS Migration

Hi,
abolutly right.
I never had problems with migrating from Apache to IIS or vice versa.

Best Regards 
Mirco Blitz

-Ursprüngliche Nachricht-
Von: Pablo D Marotta [mailto:[EMAIL PROTECTED] 
Gesendet: Montag, 18. April 2005 23:09
An: php-general@lists.php.net
Betreff: [PHP] Apache - IIS Migration

Hi there..

I´m using Apace 1.3.31 and PHP 4.3.8 in a Windows 2000 enviroment.

I´ll have to migrate the whole site to Windows 2003 enviroment, using IIS
6.0..
Should there be any problem about that, or not?

I mean, should it all go fine, or is it possible for the code to fail in
some
parts?
Just in case you need to know, I´m using "register globals" on, and I´m also
using some Pear functions (Excel_Spreadsheet).

The people I´ve asked about this yet, have told me that it should go fine as
long as I keep the same PHP version.
(I should install PHP in the IIS, configure it to recognize the php files,
and
then copy the php files)

Thank you all!
Pablo



American Express made the following
 annotations on 04/18/05 14:09:05

--

**

"This message and any attachments are solely for the intended recipient and
may contain confidential or privileged information. If you are not the
intended recipient, any disclosure, copying, use, or distribution of the
information included in this message and any attachments is prohibited. If
you have received this communication in error, please notify us by reply
e-mail and immediately and permanently delete this message and any
attachments. Thank you."


**

==

-- 
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] Session Array using array_pop and array_unshift

Hello,
I have an application that occasionally drops a session array element value.
Data from the form...
$_POST['firstName'];
$_POST['lastName'];
$_POST['phone'];
$_POST['email'];
$_POST['cell'];
When the form is submitted, the POST variables are checked to make sure 
they each contain a value.  If not, the form is redisplayed and the user 
is alerted to the missing data.  The next step in the process places the 
data into an array and then assigns the array to a session variable...

$userData = array ($_POST['firstName'], $_POST['lastName'], 
$_POST['phone'], $_POST['email'], $_POST['cell']);

$_SESSION['userData'] = $userData;
The user then visits some other pages and fills out some more data.  At 
one point, it is necessary to remove the last two elements from the 
session array.  This is achieved by using array_pop...

$cellPhone = array_pop($_SESSION['userData']);
$emailAddress = array_pop($_SESSION['userData']);
And then it is necessary to add a different variable to the beginning of 
the session array...

$userCleared = "ok";
array_unshift($_SESSION['userData'], $userCleared);
Finally, the data is checked again to make sure values exist.  At this 
point, occasionally, one of the element values of the session array is 
missing.  It's never the same one.  It seems that, at random, one of the 
elemental values just goes away.  The others are still there.  If an 
element is missing, I receive an email alerting me to this fact.  I can 
think of other ways to handle all of this data, but my question is 
this...would the current code cause elements to loose their value?  
Would using a session array AND the array_pop or array_unshift cause 
this to happen?  Has anyone else experienced this sort of occasional 
anomaly?

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


[PHP] php and mysql help

Hello i need help with mysql_create_db i found the solution once but cant remember 
what it was if someone could tell me the proper way to create a database with php and 
mysql i would be greatly thankfull.
Thank you.


RE: [PHP] Holding links in a database

Quoting Jay Blanchard <[EMAIL PROTECTED]>:

> [snip]
> I have created a site that is begining to accumulate a large number of
> pages. I have been considering holding links to all pages in a database
> so that the sub menus alter dynamically rather than being hand coded.
> Has anyone else done this...
> [/snip]
>
>
> Yes.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


Me too!

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



RE: [PHP] PHP Web Mail

Try www.horde.org

It's not only a webmail client, but has a whole load more!

Nunners

Quoting "I.A. Gray" <[EMAIL PROTECTED]>:

> Thanks- looked at Squirrel Mail.  Looks really good, however we use POP3- I
> don't think Squirrel Mail uses POP3 does it?
>
>
>
> -Original Message-
> From: Jose Leon [mailto:[EMAIL PROTECTED]
> Sent: 05 July 2004 12:09
> To: I.A. Gray
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] PHP Web Mail
>
>
> Hello,
> > Does anyone know a good PHP-based (free if possible) web mail other than
> > UebiMiau that they would recommend?
> Why not Squirrel Mail?
>
> http://www.squirrelmail.org
>
> Regards.
> --
> qadram :: software development
> http://www.qadram.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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Session_Start Problem (Fatal Error)

I'm using Mambo Open Source CMS to run a site I'm building, and seem to have a
problem logging into the Administration Tool.  It comes up with:

Fatal error: session_start(): Failed to initialize storage module. in
/home/hetbweb/public_html/administrator/index.php on line 64

I've looked at various things that could cause this, and finally contacted my
server support who said:
"It's a PHP bug which they still havent fixed as of yet, as soon as the fix
becomes available we will update PHP.
It may be worth looking on the mambo forums as there may be a patch to resolve
this for your script."

Does anyone know about this, and if so, is there a fix or work around or
anything?

Cheers
Nunners

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



[PHP] curl http file upload post

I am trying to upload a file to a remote server using curl and post method 
here is what I have:

$file = $dir."".$dbfile[0];
$this->invoiceno = $dbfile[1];
$uploadpath = "http://www.website.com;
$postvar = array ();
$postvar['cboFileType'] = "837";
$postvar['txtDesc']  = "Invoice No. ".$this->invoiceno;
$postvar['btnSave']  = "Upload File";
$postvar['FILE1']   = "@$file";
$postvar['UPLOADING']  = "true";

$this->postvariables = 
"txtUserName=".$this->user."&txtPassword=".$this->password."&btnLogin=Log 
In";

// login first
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $this->login_post);
curl_setopt($ch, CURLOPT_USERAGENT, $this->agent);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $this->postvariables);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_REFERER, $this->reffer);
curl_setopt($ch, CURLOPT_COOKIEFILE, $this->cookie_file_path);
curl_setopt($ch, CURLOPT_COOKIEJAR, $this->cookie_file_path);
$results = curl_exec ($ch);
// upload file
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$postvar);
curl_setopt ( $ch, CURLOPT_URL, $uploadpath);
$uploaded = curl_exec ( $ch );
echo $uploaded;

I think my problem is that the file I need to upload is not in the same 
directory on the server as this script. I am setting $file = 
/var/www/include/upload/test.txt and this is what seems to be causing the 
problem. I can find very little information on this topic on google so I 
need your help. Do I need to copy the file to the same directory that the 
script is in or is there something else I am missing? If I just set $file = 
test.txt how would the server know where to find the file? 

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



[PHP] mail() and exim


Hello,

I'm not sure if this is the right list to ask this on or not

Here's the situation... my php scripts were generating emails as 
expected.  I was shocked when they told me that exim was not responding 
to requests on port 25 and had to be restarted.  So, PHP communicates 
with exim internally and doesn't have the need for ports as far as PHP 
generated emails go?  Can anyone describe how this communication takes 
place between PHP and exim (or any mail server for that matter)??  Is 
this why exim would not send my emails via thunderbird but would send 
them via PHP???


Thanks!

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



[PHP] Session Array Disappears


Hello,

The site I'm working on works like this...
Requires a login that uses sessions to remember username and email 
address.  Upon being verified, the user is presented with a page that 
displays several questions regarding their background.  Upon submitting 
the background page, a script checks to make sure all background 
questions were answered.  If not, the page is redisplayed with a warning 
to answer all questions.  If they are all present, a second page is 
displayed asking about a specific topic.  Submitting the second page 
calls up the code provided below.


In reading the www.php.net/manual/en/ref.session.php page, I'd like to 
point out we do not use cookies.  The session id is propagated in the 
URL (although it's not visible in the URL bar).  Also, 
session.gc_maxlifetime is set to 5400.  We are using PHP 4.3.4.


Not very often, but once in a while, I'll get an email warning me that a 
submission was denied because $_SESSION['Q'] is empty.  I'm wondering, 
hoping and/or praying that someone out there can look at this small 
script and let me know if I'm doing something wrong with the built in 
function array_pop, perhaps I don't understand sessions at all or 
perhaps it is a server issue.  It's very confusing because other session 
variables (name and email from the login page) are not emptied, just 
$_SESSION['Q'].


Here's my code with some documentation:
$_SESSION['startQA'] contains 11 elements and is generated by a previous 
page in the site.
Once the visitor clicks the page two submit button, the above SESSION 
variable comes into play again.


This script takes that array of elements and does the following:
1. Assign session array to local array
2. Removes the last elemental value using array_pop
3. Removes the last elemental value using array_pop
4. Assign local variable the value of the a POST element
4a. Create a new session array and populates the first element equal to 
POST element

5. Runs through and populates the remaining 9 elements
5a. Total of 10 elements are now populated, 0 thru 9
6. Double checks the existence of each element
6a. if an element is missing, email me a warning and end program
*/

//Assign Session array to local variable
// Step 1
$thisQarray = $_SESSION['startQA'];

//Remove the last element of the original array
// Step 2
$area = array_pop($thisQarray);

//Remove last element of bgq array and assign to taking_test_at
// Step 3
$from_location = array_pop($thisQarray);

//Assign test version to variable
// Step 4
$testVersion = $_POST['version'];

//Start building the final Session Array
// Step 4a
$_SESSION['Q'] = array($testVersion);

//Populate rest of Session Array
// Step 5
for ($newBGQCounter=0; $newBGQCounterif ( ($_SESSION['Q'][0] == "") OR ($_SESSION['Q'][1] == "") OR 
($_SESSION['Q'][2] == "") OR ($_SESSION['Q'][3] == "") OR 
($_SESSION['Q'][4] == "") OR ($_SESSION['Q'][5] == "") OR 
($_SESSION['Q'][6] == "") OR ($_SESSION['Q'][7] == "") OR 
($_SESSION['Q'][8] == "") OR ($_SESSION['Q'][9] == "") )

{
 SEND ME AN ERROR EMAIL
 END PROGRAM
}
?>

Thank you all very much,
R

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



  1   2   >