[PHP] There Has to be an easier way (Multidimensional Array_

2002-12-03 Thread Dev
Hello all

Currently I have a web fom that has 3 field in it that I want writing to a 
multidimensional array.


	
	
	


in my page that processing this I have currently:

while(list($key,$value) = each($address)) {
	if(!is_array($value)){
		echo "$value  ";
	}
	else {
		while(list($key,$value1) = each($value)) {
			if(!is_array($value1)){
echo "$value1  ";
			}
			else {
while(list($key,$value2) = each($value1)) {
	echo "$value2";
}
			}
		}
	}
	echo "";
};

To read through it... I know there has to be a simpler way that I am 
missing.  This way will not let me sort very well from what I see either.

Thank you in advance.


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



Re: [PHP] There Has to be an easier way (Multidimensional Array_

2002-12-03 Thread Dev
Thank you That works great!

At 11:56 PM 12/3/2002 +0800, Jason Wong wrote:

On Tuesday 03 December 2002 23:45, Dev wrote:
> Hello all
>
> Currently I have a web fom that has 3 field in it that I want writing to a
> multidimensional array.
>
> 
>   
>   
> VALUE="" SIZE="5" MAXLENGTH="5">
>   
> VALUE=""> 

I would name them as:

  NAME="address[][address]"
  NAME="address[][state]"
  NAME="address[][zip]"

(I'm assuming you have multiple addresses on a single form)

Then loop through them by:

  foreach ($address as $key => $value) {
echo "Address: {$value['address']} State: {$value['state']} Zip:
{$value['zip']}";
  }

For a single address use:

  NAME="address[address]"
  NAME="address[state]"
  NAME="address[zip]"

And no need to loop, just use the values directly.


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

/*
The best portion of a good man's life, his little, nameless, unremembered acts
of kindness and love.
-- Wordsworth
*/


--
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] Regular Expresion Work on IP address

2002-12-04 Thread Dev
Hello all,

Let me first say thank you to Jason Wong and Adam Voigt for their help on 
my problem with Multidimensional Arrays!!!


Now I am continuing on with the same script and I need to check for valid 
IP address form.
Currently I have:

$ip="255.255.255.0";

if (preg_match ("/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/", $ip)) {
print "Good Ip";
} else {
print "Bad Ip";
}

This does work kinda.  It checks to see if the 4 sets of  numbers are well 
there and numbers.
The problem I am having is that it does not check to see if the IP is in a 
proper range ie less than 255.255.255.255
So you could enter 256.256.256.999 and it will say that it is a good IP.

Any clue how I would change it to check for that


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



Re: [PHP] Regular Expresion Work on IP address

2002-12-04 Thread Dev
Well after reading John'ss and DL Neil's replys i came up with 2 functions.
The first is to check to see if the entry is a valid IP address and the 
Next is to determine if it is a Private Network IP or not!.

You can see this in action at:
http://www.my-tangled-web.net/codebank/code/ip_check.php
and the sorce for that page is at:
http://www.my-tangled-web.net/codebank/getsource.php?dir=&file=ip_check.php

Please if you test it and find a problem let me know!

Thanks


function ipcheck($ip_chk){
$parts=explode(".",$ip_chk);
if (preg_match 
("/^([01]?\d\d?|2[0-4]\d|25[0-4])\.([01]?\d\d?|2[0-4]\d|25[0-4])\.([01]?\d\d?|2[0-4]\d|25[0-4])\.([01]?\d\d?|2[0-4]\d|25[0-4])$/", 
$ip_chk))
{
if($parts[0]==0 || $parts[0]>=255 ||$parts[1]>=255 || 
$parts[2]>=255 || $parts[3]>=255){
$ip_state="0";
}
elseif($parts[0]<255 && $parts[1]<255 && $parts[2]<255 && 
$parts[3]<255){
$ip_state="1";
}
}
else {
$ip_state=0;
}
$this="that";
return $ip_state;
}

function net_check($ip_2_chk){
$parts=explode(".",$ip_2_chk);
if($parts[0]==10){
$network="internal";
}
elseif($parts[0]==172 && $parts[1]>=16 || $parts[1]<=31){
$network="internal";
}
elseif($parts[0]==192 && $parts[1]==168){
$network="internal";
}
else {
$network="external";
}
return $network;
};

At 07:47 PM 12/4/2002 +, DL Neil wrote:
John,

> I think it'd be hard to verify the range with a regex. ip2long and long2ip
> do not validate. So, an option would be to write your own little function
> that splits the $ip on the period, verifies there are 4 parts, then checks
> that each part is between 1 and 255 inclusive.


My other post on the subject notwithstanding, I agree.

When I get time/when I get a round tuit, I'd like to do a performance test
on the (short) IP RegEx against what you have outlined:

explode against "."
run resultant array through 0-255 validation function
- and still have the semantic issues of 0.0.0.0, etc...

Meantime, will sit here whistling and quietly muttering into my beard (and
dreaming of tuits),
=dn


--
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] Serial Port and PHP Login

2003-07-20 Thread Dev
Hello All,

I have asked before about serial port programing with PHP and have gotten 
great advice and now I am stuck again.

Okay here is my problem.

I want to have a php app executed upon a modem connection.  Currently the 
/sbin/login is what is executed.

Does anyone have any clues on this or where I may want to look.  I am using 
mgetty as my modem connection control.

Thanks in advance!



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


Re: [PHP] phpUpLoad

2002-11-22 Thread Dev
Need to ensure that your web sever is able to write to the location.

You may need to chmod the dir to 775 or even 777

hope that helps.

At 04:35 PM 11/22/2002 +, Vicky wrote:

Hi!

I'm using phpUpLoad but when I try to upload a file I get this error -

Warning: Unable to create '/home/silversa/AC/files/Amber.pet': No such file
or directory in /home/silversa/public_html/AC/do_upload.php on line 9
Couldn't copy file.

I made a directory called "files" in the folder incase that was the problem
but it hasn't helped. I also made the path
/usr/home/silversa/public_html/AC/ incase that was the problem but that
didn't help either. Can you shed any light?

Thanks ^_^

Vicky


--
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] Image Rotation Script

2011-10-15 Thread dev
We have a simple script which rotates and image to a random value, saves
it to a cache directory and displays it. For some reason when I move the
script from a Debian box over to the production CentOS machine, it no
longer caches any of the images. the rest works, but not the cache. If you
could look at it and see if anything jumps out at you, please let me know.

install the code below to the directory /angles


.htaccess:
RewriteEngine on
RewriteRule ^rotate_(\d+)(?:_(?:\d+))?.png$ rotate.php?im=$1

rotate.php:


Use it by url:
http://www.servername.com/angles/rotate_019.png
Each time you reload page the angle should rotate to a new position.
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP 5.2.3 - Segmentation fault (core dumped)

2007-09-14 Thread dev
On Fri, 14 Sep 2007 10:10:09 +0200, Per Jessen <[EMAIL PROTECTED]> wrote:
> Per Jessen wrote:
> 
>> To let a user script bring down the host environment is just not
>> acceptable. IMHO.
> 
> Here's an example from this morning - I have a situation where all I
> need to do is add a single superfluous double quote, and I get a
> segfault.  Is that not poor error handling somewhere?  
> 
> 
> 
> 
> /Per Jessen, Zürich
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

Would love to see the code that caused this.

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



Re: [PHP] building php with DB extension without installing DB locally

2008-01-22 Thread dev

Quoting Jochem Maas <[EMAIL PROTECTED]>:


hi guys,

I want to build php with firebirdDB (ibase) extension (for the purposes
of this exercise it could just as well be mysql) without installing firebird
on the local machine (i'm moving the DB to a seperate server) ...

I can't figure out how to do this apart from installing firebird,   
building php

then removing firebird again - although I'm not sure this would even work.

Does anyone know the correct way to go about such a thing?

TIA


Think it's the same as compiling with the mysql extension. You need  
the client libraries to build PHP. So just install the firebird client  
and compile against that. That should work .. right?


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



Re: [PHP] save image in database vs folder

2008-03-11 Thread dev

Quoting jeffry s <[EMAIL PROTECTED]>:


some friend of mine ague about this matter, this morning. they say, saving
image in
database is more professional. I am not really agree with that,since i am
just a novice programmer. i am asking
senior php programmer what you opinion about this?

which one is better. save in database or in folder?



Not this thread again :) Search the archives for this one. There have  
been numerous discussions about this topic. Personally i don't see  
what would make this technique more professional. It's just a matter  
of taste.


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



Re: [PHP] save image in database vs folder

2008-03-11 Thread dev

Quoting jeffry s <[EMAIL PROTECTED]>:


thanks Richard ..
sorry dev.. i don't know this subject is quite sensitive here :(


It's not so sensitive :) It's just one of those questions that pop''s  
up a lot. And some of those discussions were pretty heated.





I think I'm gonna dive into the archives then. To see for myself what
left such a scars upon that subject.


i guess, i have to prepare my oxygen tank to dive into the archives.
i am quite curious to find out what  happen about this..



Happy diving.



On Tue, Mar 11, 2008 at 7:18 PM, Richard Heyes <[EMAIL PROTECTED]> wrote:


> some friend of mine ague about this matter, this morning. they say,
saving
> image in
> database is more professional. I am not really agree with that,since i
am
> just a novice programmer.

Well, bearing in mind I only have experience of MySQL, the general
consensus is to save it to a file on you hard drive and store the file
name in the database. If for whatever reason you can't or don't want to
do that, then at least store it in a separate table that only gets
touched when the image is requested.

--
Richard Heyes
Employ me:
http://www.phpguru.org/cv







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



[PHP] filetype() and exec() issues

2007-04-23 Thread dev
This question is a two parter

a) anyone else noticing filetype() failing on ISO image files?

Warning: filetype(): Lstat failed for /var/lib/samba/some/file.iso

b) I have a script that during processing will eventually call

  exec('/usr/bin/file -bi '.$file)

over 1000 times, I've added a counter and when it dies on this line it's
always after 1020 exec calls, regardless of the file name I'm feeding to
`file`.  I've reproduced this with both exec, shell_exec, system and the
backticks.  What am I missing here?

My System:
Linux carbon 2.6.18-gentoo-r3
PHP 5.2.1-pl3-gentoo (cli) (built: Apr 19 2007 00:42:03)
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies

/djb

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



Re: [PHP] Array Push question

2007-07-12 Thread dev
On Thu, 12 Jul 2007 18:45:36 +1000, John Comerford <[EMAIL PROTECTED]> wrote:
> Hi Folks,
> 
> Is there a better way of doing the following:
> 
> $Rows[] = array();
> $currentRow = count($Rows) - 1;
> $Rows[$currentRow]['test'] = "this is a test";
> 
> Specifically I am wonder if I can avoid having to use 'count'.
> 
> TIA,
>   JC
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

This code looks weird...

$currenRow will be numeric. So why would you do $currentRow['test']?
Anyway if you just wanna add an element to the end of the array use array_push

http://nl3.php.net/manual/en/function.array-push.php

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



[PHP] PHP Telnet Deamon?

2004-02-03 Thread Dev
Hello all,

I currently have a generic socket daemon running and doing what it should 
but I am wondering if there is a way to have a php script act as a telnet 
daemon?

Thanks to you all in advance!

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


[PHP] Multiple Socket Read and Writes?

2004-02-24 Thread Dev
Hello all,

I am having a problem with getting multiple socket reads working in a 
simple socket server!
The writes appear to be working but the reads seam to only allow one read?

I know i am missing something.  Could even be my approach is totally wrong
Currently I have:
  $input = socket_read($client[$i]['sock'] , 2024,PHP_BINARY_READ );
  if ($input == null) {
// Zero length string meaning disconnected
echo "null input 1\n";
unset($client[$i]);
  }
  elseif ($input == 'exit') {
// requested disconnect
echo "exit\n";
socket_shutdown($client[$i]['sock']);
socket_close($client[$i]['sock']);
  }
elseif ($input=="kill") {
echo "kill\n";
socket_shutdown($sock);
socket_close($sock);
die;
}
elseif ($input) {
// strip white spaces and write back to user
echo " <-- ". $input."\n";
socket_write( $client[$i]['sock'],dechex(50) );
echo " --> SYN  ".socket_strerror(socket_last_error())."\n";
socket_write( $client[$i]['sock'],dechex(50) );
echo " --> SYN  ".socket_strerror(socket_last_error())."\n";
socket_write( $client[$i]['sock'],dechex(50) );
echo " --> SYN  ".socket_strerror(socket_last_error())."\n";
//$output = ereg_replace("[ \t\n\r]","",$input).chr(0);
if ( false == ( socket_write( 
$client[$i]['sock'],dechex(46) ) ) ) {
echo "socket_write() failed: reason: " . 
socket_strerror(socket_last_error()) . "\n";
}
else {
echo " --> 
ENQ  ".socket_strerror(socket_last_error())."\n";
$input1 = socket_read($client[$i]['sock'] , 
2024,PHP_BINARY_READ );
echo "<-- ". $input1."  " . 
socket_strerror(socket_last_error()) ."\n";
};
}
else {
echo "nothing on INPUT\n";
}

--

UMPA
  Brian C. Doyle
Director, Internet Services
United Merchant Processing Association
http://www.umpa-us.com
1-800-555-9665 ext 212


[PHP] Sending Data with Ascii data

2004-11-12 Thread Dev
Hello,
I am working on a Socket script that needs to send a binary 0x1C to another 
applicaiton that is connected to the socket.  Any way in PHP to do this so 
that I do not have to go and learn C++ over the weekend

Does anyone have a clue what needs to be done to make this work?
--
UMPA
  Brian C. Doyle
Director, Internet Services
United Merchant Processing Association
http://www.umpa-us.com
1-800-555-9665 ext 212


RE: [PHP] Sending Data with Ascii data

2004-11-12 Thread Dev
Actually yes I have.  Many times as a matter of fact.
What was happing was that the 0xC1 was being translated into it dec form of 28.
Thankfully i was able to resolve the issue by using:
pack("C",28)
But thanks Jay for the help!
At 03:29 PM 11/12/2004, Jay Blanchard wrote:
[snip]
I am working on a Socket script that needs to send a binary 0x1C to
another
applicaiton that is connected to the socket.  Any way in PHP to do this
so
that I do not have to go and learn C++ over the weekend
Does anyone have a clue what needs to be done to make this work?
[/snip]
Are we to assume that you have RTFM http://www.php.net/sockets ?

--
UMPA
  Brian C. Doyle
Director, Internet Services
United Merchant Processing Association
http://www.umpa-us.com
1-800-555-9665 ext 212


Re: [PHP] Varible calling a define value

2004-12-13 Thread Dev
I actually figure this out from the web site and had to use constant();
At 04:36 PM 12/13/2004, you wrote:
Hello all,
I am setting up a page that I would like to use DEFINE to retrieve more 
information about abriviations in a database.
The database part all works just fine.

Currently i have a Defiune setup of:
define("THS", "This is a test");
I also have a string value of
$that='THS';
When I echo out $that it get THS.
I want to echo out $that and get:
This is a test.
How can I do this?

--
UMPA
  Brian C. Doyle
Director, Internet Services
United Merchant Processing Association
http://www.umpa-us.com
1-800-555-9665 ext 212

--
UMPA
  Brian C. Doyle
Director, Internet Services
United Merchant Processing Association
http://www.umpa-us.com
1-800-555-9665 ext 212


[PHP] Varible calling a define value

2004-12-13 Thread Dev
Hello all,
I am setting up a page that I would like to use DEFINE to retrieve more 
information about abriviations in a database.
The database part all works just fine.

Currently i have a Defiune setup of:
define("THS", "This is a test");
I also have a string value of
$that='THS';
When I echo out $that it get THS.
I want to echo out $that and get:
This is a test.
How can I do this?

--
UMPA
  Brian C. Doyle
Director, Internet Services
United Merchant Processing Association
http://www.umpa-us.com
1-800-555-9665 ext 212


Re: [PHP] newbie : how to access functions in seperate files???

2001-09-03 Thread web-dev

speedboy wrote:
> 
> What do people do with required files? I have a file called config.php
> which contains all my functions. It is 329526 bytes. Should I split this
> up into other files? I don't think so, but what do others think?

I too am curious about a recommended or best practice. I create a
function file that contains numerous functions for generating forms that
are used more than once in a site and it becomes large when the forms
are complex. But the alternative is to bloat the individual files by
including the function code on each page that uses it. Or, if you split
the one, large file into some number of smaller files, it increases the
administrative burden of knowing what is in each smaller file and
requiring the correct sub-file in the right context rather than
routinely requiring the one catch-all file every time one or more
function is needed.

Kris O.

-- 
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] MSSQL, PHP and Linux

2004-09-01 Thread blackwater dev
I need some help...I am helping a local business with a site which
needs to connect to a mssql db, my webhost uses linux and compiled php
with the freetds library and when I go to the info page..it does show
Microsoft SQL Server under dbx yet I still get the errors "called to
undefined function mssql_pconnect()"...what can I try next?

Is there anything that needs to be changed in the linux php ini file?
It looked like most things where uncommented.

here is the info page... http://mwvre.ht-tech.net/info.php

This is something we have to get fixed today.

Thanks!!

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



Re: [PHP] MSSQL, PHP and Linux

2004-09-01 Thread blackwater dev
No, I was using the mssql functions which I want to use.

I tried the dbx functions example:
$link = dbx_connect('mssql', $mssqldbhost,"",$mssqldbuser,$mssqldbpass);

but go the error that the mssql module isn't loaded.

On Wed, 1 Sep 2004 14:06:55 -0400, John Holmes <[EMAIL PROTECTED]> wrote:
> From: "blackwater dev" <[EMAIL PROTECTED]>
> 
> >I need some help...I am helping a local business with a site which
> > needs to connect to a mssql db, my webhost uses linux and compiled php
> > with the freetds library and when I go to the info page..it does show
> > Microsoft SQL Server under dbx yet I still get the errors "called to
> > undefined function mssql_pconnect()"...what can I try next?
> 
> Are you using the dbx functions and not mssql_connect/pconnect()??
> 
> http://www.php.net/manual/en/ref.dbx.php
> 
> ---John Holmes...
>

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



Re: [PHP] MSSQL, PHP and Linux

2004-09-01 Thread blackwater dev
We just tried again with the -mssql switch but it still doesn't seem
to be therethe -mssql isn't on the info page...I don't have a
clue...

http://mwvre.ht-tech.net/info.php

On Wed, 01 Sep 2004 15:08:41 -0400, Ben Ramsey <[EMAIL PROTECTED]> wrote:
> Like I and others have said, you need to compile PHP --with-mssql
> 
> 
> 
> 
> Blackwater Dev wrote:
> > No, I was using the mssql functions which I want to use.
> >
> > I tried the dbx functions example:
> > $link = dbx_connect('mssql', $mssqldbhost,"",$mssqldbuser,$mssqldbpass);
> >
> > but go the error that the mssql module isn't loaded.
> >
> > On Wed, 1 Sep 2004 14:06:55 -0400, John Holmes <[EMAIL PROTECTED]> wrote:
> >
> >>From: "blackwater dev" <[EMAIL PROTECTED]>
> >>
> >>>I need some help...I am helping a local business with a site which
> >>>needs to connect to a mssql db, my webhost uses linux and compiled php
> >>>with the freetds library and when I go to the info page..it does show
> >>>Microsoft SQL Server under dbx yet I still get the errors "called to
> >>>undefined function mssql_pconnect()"...what can I try next?
> >>
> >>Are you using the dbx functions and not mssql_connect/pconnect()??
> >>
> >>http://www.php.net/manual/en/ref.dbx.php
> >>
> >>---John Holmes...
> >>
> 
> --
> Regards,
> Ben Ramsey
> http://benramsey.com
> 
> ---
> http://www.phpcommunity.org/
> Open Source, Open Community
> Visit for more information or to join the movement.
> ---
> 
> PGP Key ID: 0x3968B5EE
>

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



Re: [PHP] MSSQL, PHP and Linux

2004-09-01 Thread blackwater dev
I have tried recompiling with --with-mssql and --with-mssql=/usr/include/freetds
It all appears to compile correctly, except the info page does not
reflect the config was done with mssql at all.  below is a snippet of
the config switches that were used.

--enable-ftp \
--enable-magic-quotes \
--enable-safe-mode \
--enable-sockets \
--enable-sysvsem \
--enable-sysvshm \
--enable-discard-path \
--enable-track-vars \
--enable-trans-sid \
--enable-yp \
--enable-wddx \
--without-oci8 \
--with-pear=/usr/share/pear \
--with-imap=shared \
--with-imap-ssl \
--with-kerberos=/usr/kerberos \
--with-ldap=shared \
--with-mysql=shared,%{_prefix} \
--with-sybase=/usr/include/freetds \
--with-mssql=/usr/include/freetds \

Any help would be appreciated.

thanks,


On Wed, 1 Sep 2004 08:29:55 -1200, blackwater dev
<[EMAIL PROTECTED]> wrote:
> We just tried again with the -mssql switch but it still doesn't seem
> to be therethe -mssql isn't on the info page...I don't have a
> clue...
> 
> http://mwvre.ht-tech.net/info.php
> 
> 
> 
> On Wed, 01 Sep 2004 15:08:41 -0400, Ben Ramsey <[EMAIL PROTECTED]> wrote:
> > Like I and others have said, you need to compile PHP --with-mssql
> >
> >
> >
> >
> > Blackwater Dev wrote:
> > > No, I was using the mssql functions which I want to use.
> > >
> > > I tried the dbx functions example:
> > > $link = dbx_connect('mssql', $mssqldbhost,"",$mssqldbuser,$mssqldbpass);
> > >
> > > but go the error that the mssql module isn't loaded.
> > >
> > > On Wed, 1 Sep 2004 14:06:55 -0400, John Holmes <[EMAIL PROTECTED]> wrote:
> > >
> > >>From: "blackwater dev" <[EMAIL PROTECTED]>
> > >>
> > >>>I need some help...I am helping a local business with a site which
> > >>>needs to connect to a mssql db, my webhost uses linux and compiled php
> > >>>with the freetds library and when I go to the info page..it does show
> > >>>Microsoft SQL Server under dbx yet I still get the errors "called to
> > >>>undefined function mssql_pconnect()"...what can I try next?
> > >>
> > >>Are you using the dbx functions and not mssql_connect/pconnect()??
> > >>
> > >>http://www.php.net/manual/en/ref.dbx.php
> > >>
> > >>---John Holmes...
> > >>
> >
> > --
> > Regards,
> > Ben Ramsey
> > http://benramsey.com
> >
> > ---
> > http://www.phpcommunity.org/
> > Open Source, Open Community
> > Visit for more information or to join the movement.
> > ---
> >
> > PGP Key ID: 0x3968B5EE
> >
>

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



Re: [PHP] MSSQL, PHP and Linux

2004-09-01 Thread blackwater dev
the date is a very good question?  Here is the info from my system

-rwxr-xr-x1 root root  1371932 Sep  1 19:50 /usr/bin/php

Not sure why its showing that date - Apache has been restarted.


On Wed, 01 Sep 2004 22:29:41 +, Jennifer Goodie <[EMAIL PROTECTED]> wrote:
> -- Original message from blackwater dev : --
> 
> > I have tried recompiling with --with-mssql and --with-mssql=/usr/include/freetds
> > It all appears to compile correctly, except the info page does not
> > reflect the config was done with mssql at all. below is a snippet of
> > the config switches that were used.
> 
> > > http://mwvre.ht-tech.net/info.php
> 
> It also shows a build date in June.  Did you restart apache?
>

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



Re: [PHP] Re: Does this beginner's book exist?

2004-09-02 Thread blackwater dev
I have one on the shelf that I have never read titled:

PHP/MySQL Programming for the Absolute Beginner, no Experience
Required which might be worth a look.

Looks like they have one for php5 now also

http://premierpressbooks.com/ptr_detail.cfm?group=Programming&subcat=SQL&isbn=1%2D59200%2D494%2D6



On Thu, 2 Sep 2004 09:22:39 -0400, Anthony Ritter
<[EMAIL PROTECTED]> wrote:
> Chris Lott wrote in message:
> 
> > I am looking for a new text for my beginning PHP...[snipped]
> ...
> 
> Besides Larry's book - which is excellent - try David Sklar's book called
> "Learning PHP 5" (O'Reilly).
> 
> Not too much on mySQL with PHP except for chapter 7 _however_ the whole book
> is grounded in the understanding of PHP syntax and constructs - if/else,
> loops, arrays, functions - then moves on to databases, cookies/sessions,
> forms and files.
> 
> Clear, concise and with humor and if you like Chinese food great entrees for
> 
> 
> the array examples.
> 
> Both books are very good.
> TR
> 
> --
> 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] data grids...

2004-09-08 Thread blackwater dev
Does anyone have a nice clean way to provide data grids with php short
of simply creating a bunch of input boxes or using flash?

Thanks!

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



Re: [PHP] data grids...

2004-09-08 Thread blackwater dev
yeah, it needs to be on a front end site where the users can enter
their data easily...I will play with the new flash data grid component
some more.

Thanks!


On Wed, 8 Sep 2004 15:06:55 -0400, John Holmes <[EMAIL PROTECTED]> wrote:
> From: "blackwater dev" <[EMAIL PROTECTED]>
> 
> 
> 
> > Does anyone have a nice clean way to provide data grids with php short
> > of simply creating a bunch of input boxes or using flash?
> 
> You mean using HTML/DHTML/CSS, etc. instead of PHP. PHP just creates the
> code to send to the browser.
> 
> To answer your question, though, if you're stuck with HTML, then the "bunch
> of textboxes" is your only option. Flash is probably your best bet if you
> want a true grid or maybe some ActiveX/Java plug in?
> 
> ---John Holmes...
> 
>

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



Re: [PHP] Re: MSSQL, PHP and Linux

2004-09-13 Thread blackwater dev
Still no luck with thismy host has asked:

if someone has a  (fedora core 2) RPM for us to install that has
freetds support built in?

Anyone have anything like this??

Thanks!


On Thu, 02 Sep 2004 07:45:00 -0700, Jon Bertsch <[EMAIL PROTECTED]> wrote:
> 
> I didn't see it mentioned but if you don't do a 'make clean' command php
> will not update the info used by php_info(), so you see the old information.
> 
> I've recently set up access to mssql databases and as repeated by many you
> need to do the following:
> 
> install freetds libraries (in my case to /usr/local/freetds)
> 
> compile php with the --with-mssql=/usr/local/freetds flag
> 
> setup the mssql DSN entry in the freetds conf file (under
> /usr/local/freetds/etc)
> 
> Jon Bertsch
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

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



Re: [PHP] Re: MSSQL, PHP and Linux

2004-09-13 Thread blackwater dev
Nope, not paying for it.  I think it is just a trial...he has tried
for a few weeks to get the freetds library to work with redhat 9 with
no luck so I think he just now wants to try fedora for the heck of it.

We have no idea as to why it won't work with Red Hat 9...must me
missing a small step or something but don't know...it can't be this
hard.


On Mon, 13 Sep 2004 14:46:51 -0500, Greg Donald <[EMAIL PROTECTED]> wrote:
> On Mon, 13 Sep 2004 06:33:15 -1200, blackwater dev
> <[EMAIL PROTECTED]> wrote:
> > Still no luck with thismy host has asked:
> >
> > if someone has a  (fedora core 2) RPM for us to install that has
> > freetds support built in?
> >
> > Anyone have anything like this??
> 
> Just curious here..  Why are you hosting with someone who is using
> Fedora in the first place?  Hope you're not paying for that.  Fedora
> is a test platform for RedHat's non-free commercial distro.  By it's
> very nature it will be broken.
> 
> Quoted from: http://www.redhat.com/software/rhelorfedora/
> "the Fedora Project is for developers and high-tech enthusiasts using
> Linux in non-critical computing environments."
> 
> Sorry, I don't mean to offend.. but I see no reason to help report and
> fix RedHat bugs for free when they no longer offer us a free public
> distro that isn't bleeding edge new and broken out of the starting
> gate.
> 
> 
> --
> Greg Donald
> http://destiney.com/
>

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



[PHP] jpgraph newbie

2004-09-15 Thread blackwater dev
I go the following code form phpfreaks..problem is, when I run it I
get a page not found error.  I know jpgraph sends the image back to
the browser but why do I get page not found?  If I force some syntax
errors, they will be displayed but this just doesn't seem to do
anything.

Thanks!

$db=new db();
$sql = "select year, mph from car limit 10";
$db->query($sql);

while($row = $db->fetch()){
$data[] = $row[1];
$leg[] = $row[0];
} 
 
$graph = new Graph(250,150,"auto");
$graph->SetScale("textint");
$graph->img->SetMargin(50,30,50,50);
//$graph->AdjBackgroundImage(0.4,0.7,-1); //setting BG type
//$graph->SetBackgroundImage("linux_pez.png",BGIMG_FILLFRAME); //adding image
$graph->SetShadow();

$graph->xaxis->SetTickLabels($leg);

$bplot = new BarPlot($data);
$bplot->SetFillColor("lightgreen"); // Fill color
$bplot->value->Show();
$bplot->value->SetFont(FF_ARIAL,FS_BOLD);
$bplot->value->SetAngle(45);
$bplot->value->SetColor("black","navy");

$graph->Add($bplot);
$graph->Stroke(); ?>

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



Re: [PHP] To Rasmus

2004-09-17 Thread blackwater dev
how did gmail get you blocked?

On Fri, 17 Sep 2004 11:48:53 -0700, Richard Whitney <[EMAIL PROTECTED]> wrote:
> Dear Rasmus,
> 
> Could you please unblock 140.99.35.6 from the mailing list.
> I made a mistake once.
> I subscribed using Gmail and I hate it.
> Please forgive me.
> 
> Richard Whitney
> [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



[PHP] files not uploading

2004-09-28 Thread blackwater dev
I just switched hosts and I am now working on all the stuff that once
worked but now doesn't.  I have an image upload script with the
following code:

?method=upload&id='>

  
   
 


   
 
 
 

Then, here is part of the code doing the upload:


//When REGISTERED_GLOBALS are off in php.ini
  $_POST= $HTTP_POST_VARS;
  $_GET = $HTTP_GET_VARS;

  //Upload the file
if($_GET['method'] == "upload")
{
   echo "1";
  $file_array = $HTTP_POST_FILES['file'];
  $uploads = false;
  for($i = 0 ; $i < $files_to_upload; $i++)
  { echo "2";
   
if($HTTP_POST_FILES['file']['name'][$i])
{ echo "3";


It prints out the 2 but doesn't get into the 3 loopbut I am
uploading files.  I have tried it with $_FILES and $HTTP_POST_FILES. 
This worked on my last hosts servers but not the new host.  Any ideas?

Thanks!

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



[PHP] can't upload files

2004-09-28 Thread blackwater dev
--sorry if you get this twice...it didn't seem to go through the first time--

I just switched hosts and I am now working on all the stuff that once
worked but now doesn't.  I have an image upload script with the
following code:

?method=upload&id='>
   
 
  

   
   
  



Then, here is part of the code doing the upload:


//When REGISTERED_GLOBALS are off in php.ini
 $_POST= $HTTP_POST_VARS;
 $_GET = $HTTP_GET_VARS;

 //Upload the file
   if($_GET['method'] == "upload")
   {
  echo "1";
 $file_array = $HTTP_POST_FILES['file'];
 $uploads = false;
 for($i = 0 ; $i < $files_to_upload; $i++)
 { echo "2";

   if($HTTP_POST_FILES['file']['name'][$i])
   { echo "3";


It prints out the 2 but doesn't get into the 3 loopbut I am
uploading files.  I have tried it with $_FILES and $HTTP_POST_FILES.
This worked on my last hosts servers but not the new host.  Any ideas?

Thanks!

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



Re: [PHP] can't upload files

2004-09-28 Thread blackwater dev
Doesn't print out anything.


On Wed, 29 Sep 2004 05:32:32 +0800, Jason Wong <[EMAIL PROTECTED]> wrote:
> On Wednesday 29 September 2004 01:44, blackwater dev wrote:
> 
> > Then, here is part of the code doing the upload:
> 
> To be precise this is the part of the code which handles the upload. The files
> have already been uploaded and stored by your webserver long before your
> script starts executing.
> 
> > It prints out the 2 but doesn't get into the 3 loopbut I am
> > uploading files.  I have tried it with $_FILES and $HTTP_POST_FILES.
> > This worked on my last hosts servers but not the new host.  Any ideas?
> 
> print_r() those two variables (and any others you can think of).
> 
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> --
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> --
> /*
> Don't let your status become too quo!
> */
> 
> --
> 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] can't upload files

2004-09-29 Thread blackwater dev
What should I look for?  I know globals are off...file_upload is on.




On Wed, 29 Sep 2004 10:08:31 +0600, raditha dissanayake
<[EMAIL PROTECTED]> wrote:
> blackwater dev wrote:
> 
> >Doesn't print out anything.
> >
> >
> >
> >
> then try phpinfo() it will tell you everything about your server, your
> script and data that is being passed to it. Look for anything amiss.
> 
> >>print_r() those two variables (and any others you can think of).
> >>
> >>
> >>
> >
> 
> -- 
> Raditha Dissanayake.
> 
> http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
> Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
> Graphical User Inteface. Just 128 KB | with progress bar.
> 
> 
> 
> --
> 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] splitting string into array

2004-09-29 Thread blackwater dev
How can I take a string and create an array?

Example,
A12B05C45D34

I need to split this into chunks of three A12,B05,C45..etc?

Thanks!

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



Re: [PHP] splitting string into array

2004-09-29 Thread blackwater dev
Thanks all!


On Wed, 29 Sep 2004 14:55:58 +0100, Chris Dowell <[EMAIL PROTECTED]> wrote:
> In PHP4
> 
> $array = explode(';', chunk_split("A12B05C45D34", 3, ';'));
> 
> In PHP4
> 
> $array = str_split("A12B05C45D34", 3);
> 
> RTFM
> 
> Cheers
> 
> Chris
> 
> 
> 
> blackwater dev wrote:
> 
> > How can I take a string and create an array?
> >
> > Example,
> > A12B05C45D34
> >
> > I need to split this into chunks of three A12,B05,C45..etc?
> >
> > Thanks!
> >
> 
> --
> 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] safe mode?

2004-09-29 Thread blackwater dev
Hello all...

I finally have an upload script partly working but am not running into
this problem.

I have this code which executes when the user visits the image upload page:


 if (!file_exists("../images/property_$id")){
 mkdir("../images/property_$id", 0700);}

 $upload_dir = "../images/property_$id";


When the user executes the script, it returns and runs this code:


if($_FILES['file']['name'][$i])
  {
  $file_to_upload = $upload_dir."/".$_FILES['file']['name'][$i];
  $thisName=$_FILES['file']['name'][$i];
  move_uploaded_file($_FILES['file']['tmp_name'][$i],$file_to_upload); }


And I get these errors::

Warning: move_uploaded_file(): SAFE MODE Restriction in effect. The
script whose uid is 1044 is not allowed to access
/images/property_128873 owned by uid 1002 in /imageupload.inc.php on
line 39

then a bunch of other related errors.  I have tried to using 0777
also.  How can I get around SAFE MODE as I can't easily change the ini
file as it is on my hosts server.

Thanks!

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



Re: [PHP] safe mode?

2004-09-29 Thread blackwater dev
so do this each time?

I need a routine that will dynamically create a folder, then use that
folder to upload images.  This problem doesn't exists just on one
directory but on all directories dynamically created.

Thanks!


On Wed, 29 Sep 2004 21:48:05 +0200, Marek Kilimajer <[EMAIL PROTECTED]> wrote:
> 
> 
> blackwater dev wrote:
> > Hello all...
> >
> > I finally have an upload script partly working but am not running into
> > this problem.
> >
> > I have this code which executes when the user visits the image upload page:
> >
> > 
> >  if (!file_exists("../images/property_$id")){
> >  mkdir("../images/property_$id", 0700);}
> >
> >  $upload_dir = "../images/property_$id";
> > 
> >
> > When the user executes the script, it returns and runs this code:
> >
> > 
> > if($_FILES['file']['name'][$i])
> >   {
> >   $file_to_upload = $upload_dir."/".$_FILES['file']['name'][$i];
> >   $thisName=$_FILES['file']['name'][$i];
> >   move_uploaded_file($_FILES['file']['tmp_name'][$i],$file_to_upload); }
> > 
> >
> > And I get these errors::
> >
> > Warning: move_uploaded_file(): SAFE MODE Restriction in effect. The
> > script whose uid is 1044 is not allowed to access
> > /images/property_128873 owned by uid 1002 in /imageupload.inc.php on
> > line 39
> >
> > then a bunch of other related errors.  I have tried to using 0777
> > also.  How can I get around SAFE MODE as I can't easily change the ini
> > file as it is on my hosts server.
> >
> > Thanks!
> >
> 
> Use ftp function to create the upload directory. Login as userid 1044,
> create the directory, change it's permission, and you are done
> 
> --
> 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] displaying blob images from a mssql db

2004-10-06 Thread blackwater dev
Ok, I know images shouldn't be saved in the db but this isn't my db so
I can't change that.  Does anyone know of a good tutorial to show me
how to grab these blog jpg's and display them in a browser?

Thanks!

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



[PHP] enterprise php application automated testing

2004-10-23 Thread blackwater dev
Hello all,

I know I can use simpletest to test my application at the class level
but I need a tool to test it at a much higher level.  I need something
to enter data in forms, click links, etc.  I have played some with
simpletest's web tester without much luck.  I am just curious how
others are effectively testing their large php enterprise
applications?  Years ago I wrote Visual test scripts and it had a
feature where I could record all my keystrokes as I entered, clicked,
etc...I guess I am curious if there is anything like that..open
source?

Any suggestions are welcome.
Thanks!

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



[PHP] sms through teleflip and php?

2007-01-16 Thread blackwater dev

Has anyone been able to successfully send a text message using php and the
mail function?

It works fine if I open up thunderbird and send a message to
[EMAIL PROTECTED] but if I use the mail function:

mail("[EMAIL PROTECTED]", "test", "test");

It doesn't work.  I've tried several different approaches so was curious if
others have used it successfully.

Thanks!


Re: [PHP] sms through teleflip and php?

2007-01-16 Thread blackwater dev

Thanks for all the insights.  It appears that it might have thought my email
was spam as I sent it from another server and it worked fine.

Thanks!

On 1/16/07, Jochem Maas <[EMAIL PROTECTED]> wrote:


also consider that there maybe a reverse lookup being done on the sending
MTA
that the sms gateway doesn't consider kosher .. and/or that the IP of the
sending MTA is grey-listed/black-listed.

also a check may be being done to see if the sender's account exists
on the sender's [your servers] domain.

check the relevant logs on your server to see what (if anything)
the sms gateway is asking your server. (no idea what/where those logs
are hiding out).

sorry if this all sounds vague, I'm mostly parroting what others have said
in the past - I'm hardly what you would call knowledgable with regard to
mail servers
and all that jazz.

[EMAIL PROTECTED] wrote:
> Maybe phpMailer isn't sending the correct headers either.  Sometimes all
it takes is one missing header that a system is looking for and it may
filter it as spam or something.
>
> Again, I encourage you to examine the headers from your Thunderbird
"good" email and compare it to your PHP and/or phpMailer headers that are
getting sent.  Possibly try to emulate the successful email as much as
possible by copying the headers from a known successful message.
>
> If that doesn't work, then you may contact teleflip or whatever service
you're trying to send text messages to and ask them if they can provide any
information as to why it may not be going through.  Never know, might find
someone with half a brain who can help.
>
> -TG
>
> = = = Original message = = =
>
> I tried using phpMailer and all and it nothing seems to work right.  I
can
> send it fine through thunderbird but it just seems to complain via
php.  Not
> sure why.
>
> On 1/16/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]
>
> wrote:
>> I'm guessing the SMS system is rejecting the email because it's lacking
>> some headers that mail programs tend to use... and spammers sometimes
>> forget.
>>
>> You might send your email from Thunderbird.. CC yourself on it.  Verify
>> that it went through as a text message, then open the CC'd copy and
look at
>> the headers.  You can start by taking all those headers and putting
them
>> into your PHP script then slowly commenting some out until you get just
what
>> you need and not a lot of extra garbage (to keep it simple and
>> semi-elegant).
>>
>> That's where I'd start at least.
>>
>> -TG
>>
>> = = = Original message = = =
>>
>> Has anyone been able to successfully send a text message using php and
the
>> mail function?
>>
>> It works fine if I open up thunderbird and send a message to
>> [EMAIL PROTECTED] but if I use the mail function:
>>
>> mail("[EMAIL PROTECTED]", "test", "test");
>>
>> It doesn't work.  I've tried several different approaches so was
curious
>> if
>> others have used it successfully.
>>
>> Thanks!
>
>
> ___
> Sent by ePrompter, the premier email notification software.
> Free download at http://www.ePrompter.com.
>




[PHP] nuSoap -method '' not defined in service

2007-01-18 Thread blackwater dev

I have the following code but when I hit the page, I get the xml error of
method '' not defined in service.  I don't have a wsdl or anything defined.
Is there more I need to do to get the SOAP service set up?

Thanks!

include("nusoap/nusoap.php");

$server=new soap_server();
$server->register('getColumns');

function getColumns(){

   $search= new carSearch();

   return $search->getSearchColumns();

}
$server->service($HTTP_RAW_POST_DATA);


[PHP] webservice libraries/frameworks

2007-01-19 Thread blackwater dev

I've heard that there might be a php library or framework that allows you to
expose your code as a webservice with little to no extra code.  I heard the
code could potentially also allow access via several different protocols.

Has anyone come across anything similar, or do I need to pick a specific
protocol for my services?

Thanks!


[PHP] os php scheduler?

2007-01-20 Thread blackwater dev

Does anyone have recommendations for an open source php based,
'lightweight', scheduling app?  I just want something clean that I can use
to schedule trainings within our company.  I need to be able to put in
details for each training and then see a synopsis on a calender.  Just a
basic scheduler but clean and useful.

Thanks!


[PHP] creating an api-which protocol do you use?

2007-01-23 Thread blackwater dev

I need to create some webservices for our web app and am really torn as to
which route to go...SOAP, XML_RPC, etc.?  I like the looks of REST but many
of our partners that will be using our services use cold fusion and I think
that has build in SOAP support.

Which protocol would you use?

Thanks!


[PHP] bit wise math? Is there a function to easily return the bits?

2007-01-25 Thread blackwater dev

Is there a php function I can call to pass in a number and get the values
returned?

For example, pass in 7 and get 1,2,4 ?

Thanks!


[PHP] php based digg like package?

2007-02-10 Thread blackwater dev

A month or so ago I can across a php based open source community news
package.  I can't seem to find it now...does anyone know of one?

Thanks!


[PHP] round to nearest 500?

2007-02-12 Thread blackwater dev

Is there an easy way in php to round to the nearest 500?

So if I have 600, I 500 and if I have 800 I want 1000?

Thanks!


[PHP] how do I just escape double quotes within a string?

2007-02-13 Thread blackwater dev

If I use add slashes, it strips everything, I just want to replace all the
double quotes with slash double quote but this, of course, throws errors:

str_replace(""","\"",$code);


Thanks!


[PHP] php forcing a post??

2007-02-20 Thread blackwater dev

I currently have an html page that posts to a cgi function.  I need to
interject some php in the middle.  So, the form will post to itself, the php
page will catch the post, check on thing and then pass along to the cgi page
but the cgi page only handles posts.  How can I still php in the middle and
still have it 'post' to the cgi page?

Thanks!


Re: [PHP] Re: php forcing a post??

2007-02-20 Thread blackwater dev

Currently the form posts to /cgi/process

Process does all sorts of stuff.  I basically just want to step in the
middle and do one small php thing and then send the form on to the process
cgi script just like the form had posted it there.


On 2/20/07, Al <[EMAIL PROTECTED]> wrote:


One simple way would be to have php send the page to the client. Then,it
will
look for the response.

blackwater dev wrote:
> I currently have an html page that posts to a cgi function.  I need to
> interject some php in the middle.  So, the form will post to itself, the
> php
> page will catch the post, check on thing and then pass along to the cgi
> page
> but the cgi page only handles posts.  How can I still php in the middle
and
> still have it 'post' to the cgi page?
>
> Thanks!
>

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




[PHP] post via text message?

2007-04-16 Thread blackwater dev

I'm working on a site where I need to allow someone to send me a text
message and let the code take their message and respond or post it in the
db.  Can someone point me in the right direction on how this is done?

Thanks!


Re: [PHP] securing php pages

2009-11-20 Thread niccguard-dev
From: nitin reddy 
To: php-general@lists.php.net
Sent: Fri, November 20, 2009 8:56:39 AM
Subject: [PHP] securing php pages

Hi I am a new user of PHP..in my project i have put login forms and i am
able to login successful but the pages after the login can be accessed
directly by typing the address so if any one can help in this matter.


Thank you,

-- 
Nitin





I'm a PHP noob in general, but I'll throw in my 2 cents:

Every page you want to keep people from accessing if they aren't logged in, 
needs to check the status of the login. 

Here is a link to a login system I used in learning more about setting this up, 
it may help you to understand better;

http://evolt.org/PHP-Login-System-with-Admin-Features

--

Aaron

[PHP] Seeking developer for short term project

2010-06-14 Thread Dev Job
Our company is looking to hire a PHP Developer for a short term project.
 We're currently in the last couple weeks of the interview phase to narrow
down our options.  We are looking for a developer that is comfortable
working with existing code as well as creating new code.  You must be
skilled in PHP and MySQL in addition to HTML and javascript.  Experience in
jQuery is a plus!

We're looking for candidates from the U.S. and UK only right now.

If you meet the requirements and are intersted, please respond with a resume
and contact information.

We'll be making a decision in the next couple weeks, so please respond soon!


[PHP] Re: Seeking developer for short term project

2010-06-16 Thread Dev Job
Just to clarify, we are looking for a single developer, not a team please.

Thanks!


On Mon, Jun 14, 2010 at 12:46 PM, Dev Job  wrote:

> Our company is looking to hire a PHP Developer for a short term project.
>  We're currently in the last couple weeks of the interview phase to narrow
> down our options.  We are looking for a developer that is comfortable
> working with existing code as well as creating new code.  You must be
> skilled in PHP and MySQL in addition to HTML and javascript.  Experience in
> jQuery is a plus!
>
> We're looking for candidates from the U.S. and UK only right now.
>
> If you meet the requirements and are intersted, please respond with a
> resume and contact information.
>
> We'll be making a decision in the next couple weeks, so please respond
> soon!
>


[PHP] Re: Seeking developer for short term project

2010-06-20 Thread Dev Job
Just wanted to let everyone know that we will be finishing up with interview
this week in order to make a decision.  So, if anyone is interested, please
let me know so we can discuss the project further.

U.S. and UK solo developers (no teams) please.

Thanks!


On Mon, Jun 14, 2010 at 12:46 PM, Dev Job  wrote:

> Our company is looking to hire a PHP Developer for a short term project.
>  We're currently in the last couple weeks of the interview phase to narrow
> down our options.  We are looking for a developer that is comfortable
> working with existing code as well as creating new code.  You must be
> skilled in PHP and MySQL in addition to HTML and javascript.  Experience in
> jQuery is a plus!
>
> We're looking for candidates from the U.S. and UK only right now.
>
> If you meet the requirements and are intersted, please respond with a
> resume and contact information.
>
> We'll be making a decision in the next couple weeks, so please respond
> soon!
>


[PHP] different menus for different roles

2011-10-19 Thread drupal dev
Hi Gurus,

 I am new to php and drupal both .


I have created two domains in drupal. and two different roles.

Now i wanted to show different page for each role.can you anybody tell me
how to do it.

Or share with me if something is readily available.


Thanks,
S


[PHP] updating php

2005-02-07 Thread blackwater dev
Hello,

I have installed php5 fine on my Fedora 3 box.  I know need to
recompile to add in a feature and did the same steps as the install
./configure, make, make install which went fine but when restart
apache and go to the php.ini, my new configuration is not shown and
the code throws errors because it isn't there.  Is the process to
upgrade different?

Thanks!

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



[PHP] Re: updating php

2005-02-07 Thread blackwater dev
just tried it with make clean and still didn't seem to take.


On Mon, 7 Feb 2005 16:22:37 -0500, blackwater dev
<[EMAIL PROTECTED]> wrote:
> Hello,
> 
> I have installed php5 fine on my Fedora 3 box.  I know need to
> recompile to add in a feature and did the same steps as the install
> ./configure, make, make install which went fine but when restart
> apache and go to the php.ini, my new configuration is not shown and
> the code throws errors because it isn't there.  Is the process to
> upgrade different?
> 
> Thanks!
>

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



[PHP] traversing multi-dimensional arrays

2005-02-17 Thread blackwater dev
Hello all,

What is the best way to do this?  I have two arrays:

$cars=array("ford","chevy");
$models=array("ford"=>array("ranger","escape"),"chevy"=>array("malibu","tahoe"));

then I need to traverse both arrays:

   foreach ($cars as $car){
   //now I need to get into the models array and echo out all 
of the
models that
 //coincide with the specific car so it should print
out ford-ranger
//I basically want to do this but can't
   //how can I get into this second array without looping
through the whole thing each time?
   foreach($cars[$car] as $model){
  
  }

  }

Thanks!

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



[PHP] web testing

2005-03-01 Thread blackwater dev
Hello,

I have a very large php web app and I am curious as to what others are
using for testing.   I know I can use simpletest to test at the code
level and also do some front end testing but I am looking for a nice
robust product to use to test the entire site.  I mean to touch every
page, fill out forms, etc.  What are others using...doesn't have to be
open source.

Thanks!

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



Re: [PHP] Re: incrementing a number from a text file

2005-03-09 Thread blackwater dev
file_put_contents is only for PHP5 so if you are using PHP4, this won't work.


On Thu, 10 Mar 2005 04:26:41 +0200, Eli <[EMAIL PROTECTED]> wrote:
> Ross Hulford wrote:
> > I want to read a number from an external (txt) file and increment it.then
> > save the number back on the text file.
> > I know this is possible but want a simple amd economical way to do this.
> 
> Try:
> 
> file_put_contents("file.txt",((int)file_get_contents("file.txt"))+1);
> 
> --
> 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] validating input

2005-04-12 Thread blackwater dev
I want to check a string for only numbers and letters but am banging
my head with regex:

$good = "joh_'";

// Let's check the good e-mail
if (preg_match("/[a-z0-9]/", $good)) {
echo "Good";
} else {
echo "Bad";
}

This returns Good, why?

Thanks!

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



[PHP] get_parent_class-certification

2005-04-19 Thread blackwater dev
Hello,

Running this code in Zend studio returns string(3) "mom";

class grandparent{
};
class mom extends grandparent{
};
class son extends mom{
};

echo var_dump(get_parent_class("son"));

However, the Zend certification book has a question like this and says
it should return grandparent...which is correct?

Thanks!

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



[PHP] array diff with both values returned

2005-05-06 Thread blackwater dev
Hello,

Is there a good way to get the difference in two arrays and have both
values returned?  I know I can use array_dif to see what is in one and
not the other but...I need it to work a bit differently.

I have:

$array1=array("name"=>"fred","gender"=>"m","phone="=>"555-");
$array2=array("name"=>"fred","gender"=>"f","phone="=>"555-");

I want to compare these two and have it return:

array("gender"=>array("m","f"));

I want it to return all of the differences with the key and then the
value from array 1 and 2.

How?

Thanks!

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



[PHP] what am I missing..interpolation?

2005-05-15 Thread blackwater dev
Hello,

this works fine:

$name="fido";
$string="my dog's name is $name";
echo $string;//prints my dog's name is fido

but when I store the string "my dog's name is $name" in the db and pull it out:

//do the query
$row=$datab->fetch();
$name="fido";
$string=$name['db_column'];
echo $string//prints my dog's name is $name

How can I get it to work with the db?

Thanks!

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



Re: [PHP] what am I missing..interpolation?

2005-05-15 Thread blackwater dev
Thanks for the info but I tried it both ways and get this error:

Parse error: parse error, unexpected T_FOR, expecting ',' or ';' in
dogs.php(11) : eval()'d code on line 1


On 5/15/05, Krid <[EMAIL PROTECTED]> wrote:
> Hi!
> Try
> eval("echo $string");
> 
> blackwater dev wrote:
> > Hello,
> >
> > this works fine:
> >
> > $name="fido";
> > $string="my dog's name is $name";
> > echo $string;//prints my dog's name is fido
> >
> > but when I store the string "my dog's name is $name" in the db and pull it 
> > out:
> >
> > //do the query
> > $row=$datab->fetch();
> > $name="fido";
> > $string=$name['db_column'];
> > echo $string//prints my dog's name is $name
> >
> > How can I get it to work with the db?
> >
> > Thanks!
> >
>

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



[PHP] good os, php drive classifieds package?

2007-08-20 Thread blackwater dev
I need to put together a car classifieds site and before I re-invent the
wheel was curious if anyone new of any good php driven OS packages
available.  Does anyone have any recommendations?

Thanks!


[PHP] nusoap service + php5 soap client problems

2007-10-02 Thread blackwater dev
Hello,

I have this nusoap service:

$server= new soap_server();
$server->register('authenticate_user', array(), array());

// Initialize WSDL support
$server->configureWSDL('authenticate', 'urn:authenticate');
// Register the method to expose
$server->register('authenticate_user',  // method name
array('key' => 'xsd:string','params'=>'xsd:array'), // input parameters
array('return' => 'xsd:array'), // output parameters
'urn:authenticate', // namespace
'urn:authenticate#authenticate_user',   // soapaction
'rpc',  // style
'encoded',  // use
'Authenticates User'  // documentation
);

function authenticate_user($key=null,$params=null){
$data['message']=true;
$data['key']=$key;
$data['params']=$params;
 return $data;
}

/* "start" the service */
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);


I then have a php5 box calling the service:


$client = new SoapClient("http://mysite.com/authenticate.php?wsdl";);
$return=$client->authenticate_user("fdsfds",array("username"=>"mynameis","password"=>"fred"));

Problem is, it throws an error of:

*Fatal error*: Uncaught SoapFault exception: [HTTP] Unable to parse URL in
/var/www/mysite/html/webservices/test_authenticate_service.php:9 Stack
trace: #0 [internal function]: SoapClient->__doRequest('http:///~me...', 'urn:authenticat...', 1, 0) #1 [internal function]:
SoapClient->__call('authenticate_us...', Array) #2
/var/www/mysite/html/webservices/test_authenticate_service.php(9):
SoapClient->authenticate_user('fdsfds', Array) #3 {main} thrown in *
/var/www/mysite/html/webservices/test_authenticate_service.php* on line *9

How can I fix this?

Thanks!
*


Re: [PHP] nusoap service + php5 soap client problems

2007-10-02 Thread blackwater dev
Yeah, because that was just changed so I could post it here:

Here is the actual wsdl:


−

−

http://schemas.xmlsoap.org/soap/encoding/"/>
http://schemas.xmlsoap.org/wsdl/"/>


−




−



−

−

Authenticates Getloaded User




−

http://schemas.xmlsoap.org/soap/http"/>
−


−

http://schemas.xmlsoap.org/soap/encoding/"/>

−

http://schemas.xmlsoap.org/soap/encoding/"/>



−

−

http:///~jack/development/webservices/authenticate.gl"/>




On 10/2/07, Nathan Nobbe <[EMAIL PROTECTED]> wrote:
>
> this doesnt look like a wsdl file to me
> http://mysite.com/authenticate.php?wsdl
>
> -nathan
>
> On 10/2/07, blackwater dev <[EMAIL PROTECTED]> wrote:
>
> > Hello,
> >
> > I have this nusoap service:
> >
> > $server= new soap_server();
> > $server->register('authenticate_user', array(), array());
> >
> > // Initialize WSDL support
> > $server->configureWSDL('authenticate', 'urn:authenticate');
> > // Register the method to expose
> > $server->register('authenticate_user',  // method name
> > array('key' => 'xsd:string','params'=>'xsd:array'), // input
> > parameters
> > array('return' => 'xsd:array'), // output
> > parameters
> > 'urn:authenticate', // namespace
> > 'urn:authenticate#authenticate_user',   // soapaction
> > 'rpc',  // style
> > 'encoded',  // use
> > 'Authenticates User'  // documentation
> > );
> >
> > function authenticate_user($key=null,$params=null){
> > $data['message']=true;
> > $data['key']=$key;
> > $data['params']=$params;
> >  return $data;
> > }
> >
> > /* "start" the service */
> > $HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA :
> > '';
> > $server->service($HTTP_RAW_POST_DATA);
> >
> >
> > I then have a php5 box calling the service:
> >
> >
> > $client = new SoapClient(" http://mysite.com/authenticate.php?wsdl";);
> > $return=$client->authenticate_user("fdsfds",array("username"=>"mynameis","password"=>"fred"));
> >
> >
> > Problem is, it throws an error of:
> >
> > *Fatal error*: Uncaught SoapFault exception: [HTTP] Unable to parse URL
> > in
> > /var/www/mysite/html/webservices/test_authenticate_service.php:9 Stack
> > trace: #0 [internal function]: SoapClient->__doRequest(' > version="...',
> > 'http:///~me...', 'urn:authenticat...', 1, 0) #1 [internal function]:
> > SoapClient->__call('authenticate_us...', Array) #2
> > /var/www/mysite/html/webservices/test_authenticate_service.php(9):
> > SoapClient->authenticate_user('fdsfds', Array) #3 {main} thrown in *
> > /var/www/mysite/html/webservices/test_authenticate_service.php* on line
> > *9
> >
> > How can I fix this?
> >
> > Thanks!
> > *
> >
>
>


[PHP] sftp connecting to remove server via php

2007-12-11 Thread blackwater dev
I have to write a script that will connect to a remove server using sftp and
pull in specific files for processing.  Currently I can get to the server by
just using sftp [EMAIL PROTECTED]  How can I open these files via php?  Is the
only way to use fopen with the PECL sftp, ssh2 modules?

Thanks!


Re: [PHP] sftp connecting to remove server via php

2007-12-11 Thread blackwater dev
Sorry, thanks for the info!

On Dec 11, 2007 3:26 PM, Jay Blanchard <[EMAIL PROTECTED]> wrote:

> [snip]
> Yes but will these handle sftp? I have a key on the other server so don't
> need a password.
> [/snip]
>
> http://us.php.net/manual/en/function.ftp-ssl-connect.php
>
> always reply to all so the mail gets back on the list
>


[PHP] automatic caller

2008-01-02 Thread blackwater dev
I'm working on a prototype now and was wondering if anyone new of a service
where I could pass in text and a number and the service would call the
number and read the text.  I know I can do this with asterisk and it's php
api but don't have time to set up all the outgoing code/functionality.  Does
anyone know of a service that does this so I can show it as a proof of
concept.  I looked at GrandCentral but it doesn't appear to have this
feature.

Thanks!


[PHP] sftp

2008-01-04 Thread blackwater dev
I have a script that has to make a connection via sftp and read the contents
of a file.  In the shell, I can simply type

sftp [EMAIL PROTECTED]

As I use the keys on the server so don't need a password.  How can I make
this connection in php so I can get the data contents nightly?  We installed
teh ssh2 pecl package and I saw an example showing:


$file=fopen("ssh2.sftp://[EMAIL PROTECTED]:22/files/myfile.txt","r");


Yet php throws the error that it can't find the ssh2.sftp wrapper.  First,
if ssh2 installed properly is this fopen syntax correct?  Second, how would
I know if ssh2 is install properly?

THanks!


[PHP] a better way to do a data import?

2008-01-21 Thread blackwater dev
I  have a text file that contains 200k rows.   These rows are to be imported
into our database.  The majority of them will already exists while a few are
new.  Here are a few options I've tried:

I've had php cycle through the file row by row and if the row is there,
delete it and do a straight insert but that took a while.

Now I have php get the row from the text file and then to array_combine with
a default array I have in the class so I can have key value pairs.  I then
take that generated array and do array_diff to the data array I pulled from
the db and I then have the columns that are different so I do an update on
only those columns for that specific row.  This is slow and after about
180,000 rows, php throws a memory error.  I'm resetting all my vars to NULL
at each iteration so am not sure what's up.


Anyone have a better way to do this?  In MySQL, I could simply a replace on
each row...but not in postgres.

Thanks!


Re: [PHP] a better way to do a data import?

2008-01-21 Thread blackwater dev
I think that's possible, so I'll give it a shot.

For some reason, even with straight inserts my php script is dying around
180,000 rows.  Basically, I took out all the compare/update code so now I
grab the row from the db and if there isn't one, do an insert.  I've wiped
my db so should do straight inserts so I'm not sure what's taking up the
memory.



private function processFile($table, $key){

$this->openFileForReading(); //foudn in GLFile class
while (!feof($this->fileHandle)) {
$file_data = fgets($this->fileHandle);

$this->insert($table, $key, $file_data);

}
  $this->closeFile();

}

private function insert($table, $key, $data){
if (strlen($data)<10) return false;

$data=$this->db->escape_string($data);

//this is the data we will use should we need to do an insert
$insert_data = str_replace("\"", "'", $data);

//this is a hack we need to change the separator of the file
//we need this because we need to put the data into an array and if
//we simply use the comma, then it splits address fields
$data = str_replace("\",\"", "~", $data);
$data = str_replace("\"","",$data); //let's remove the double quotes
$this->setDelimiter("~");
$dataToArray=$this->stringToArray($data);
//set it back for other functions
$this->setDelimiter(",");

//get the id, we trust it is the first column


$key_data=$dataToArray[0];

//does the value exist in the database already?
$sql="select * from prelim_$table where $key='$key_data'";
$handle=$this->db->select($sql);
if ($this->db->row_count($handle)>0){
$textData=array();
$colsToUpdate="";
$dataRow="";
$dataRow=$this->db->fetch_row($handle);
//now that we have the data, let's merge the row from the
//file with the column names

$textData=array_combine($this->carrierColumns,
$dataToArray);
//cast some values that are strings in the text file
$textData['cars1']=(int) $textData['cars1'];
$textData['car_amount']=(int)
$textData['car_amount'];

$textData['total_work']=trim($textData['total_work']);

$textData['business_zip']=trim($textData['business_zip']);
  //clean up some old db data
$dataRow['rfc_number']=trim($dataRow['rfc_number']);

$dataRow['business_zip']=trim($dataRow['business_zip']);



  $colsToUpdate=array_diff($textData,$dataRow);

//if we have columns to update, do it
if (count($colsToUpdate)>0){

$colset="";
foreach ($colsToUpdate as $column=>$value){
$colset.="$column='$value',";
}
//strip last comma
$colset=substr($colset, 0, -1);
$sql="update prelim_$table set $colset where
$key='$key_data'";
$this->db->write($sql);

}

$dataRow=NULL;
$colsToUpdate=NULL;
$colset=NULL;
$textData=NULL;
 }
else{

//insert the row
$sql="insert into prelim_$table values (";
$sql.=trim($insert_data);
$sql.=");";
$this->db->write($sql);
}




}


On Jan 21, 2008 12:55 PM, Robert Cummings <[EMAIL PROTECTED]> wrote:

>
> On Mon, 2008-01-21 at 12:35 -0500, blackwater dev wrote:
> > I  have a text file that contains 200k rows.   These rows are to be
> imported
> > into our database.  The majority of them will already exists while a few
> are
> > new.  Here are a few options I've tried:
> >
> > I've had php cycle through the file row by row and if the row is there,
> > delete it and do a straight insert but that took a while.
> >
> > Now I have php get the row from the text file and then to array_combine
> with
> > a default array I have in the class so I can have key value pairs.  I
> then
> > take that generated array and do array_diff to the data array I pulled
> from
> > the db and I then have the columns that are different so I do an update
> on
> > only those columns for that specific row.  This is slow and after about
> > 180,000 rows, p

[PHP] text messages

2008-02-04 Thread blackwater dev
I know this isn't specific to php but I need to add some code to my php
pages to start sending out text messages.  If anyone does this, how do you
do it?  Do you simply use a free service like teleflip or do you use a paid
aggregator company?

Thanks!


Re: [PHP] text messages

2008-02-05 Thread blackwater dev
Thanks,

We are basically just looking to prototype something with about 50 users for
now so I'll check these out.

Thanks again!

On Feb 5, 2008 12:30 PM, Richard Lynch <[EMAIL PROTECTED]> wrote:

> On Mon, February 4, 2008 9:15 pm, blackwater dev wrote:
> > I know this isn't specific to php but I need to add some code to my
> > php
> > pages to start sending out text messages.  If anyone does this, how do
> > you
> > do it?  Do you simply use a free service like teleflip or do you use a
> > paid
> > aggregator company?
>
> If you want to do ANY kind of volume or have ANY kind of certainty
> that somebody at least tried to deliver the message, then pay an
> aggregator.
>
> If you're setting it up to let grandma send you a text, use teleflip.
>
> --
> Some people have a "gift" link here.
> Know what I want?
> I want you to buy a CD from some indie artist.
> http://cdbaby.com/from/lynch
> Yeah, I get a buck. So?
>
>


[PHP] saving outside website content via php...

2008-05-31 Thread blackwater dev
I'm using the google api to allow people to search the web via my site.  The
pages are simply iframed within my site.  Is it possible for me to give them
a 'save' button and let them save the page they are viewing in it's current
state?  I don't mean save to their computer but I would use php to save it
to disk or the db.  How can I do this and pull in all the css, images, etc?



Thanks!


Re: [PHP] saving outside website content via php...

2008-06-01 Thread blackwater dev
Yes, but file_get_contents will get me the code which I could then echo back
out to the browser but that wouldn't give me any external images, css files
or js.



On Sun, Jun 1, 2008 at 11:23 AM, Shawn McKenzie <[EMAIL PROTECTED]>
wrote:

> Gabriel Sosa wrote:
>
>> why no just save the searhed url in a db field. next time you just
>> need call the iframe with the last or N search
>>
>> anyway if you still want to save all the searched page try using curl
>>
>> http://ar.php.net/manual/en/function.curl-exec.php
>>
>> saludos
>>
>>
>> On Sat, May 31, 2008 at 8:11 PM, blackwater dev <[EMAIL PROTECTED]>
>> wrote:
>>
>>> I'm using the google api to allow people to search the web via my site.
>>>  The
>>> pages are simply iframed within my site.  Is it possible for me to give
>>> them
>>> a 'save' button and let them save the page they are viewing in it's
>>> current
>>> state?  I don't mean save to their computer but I would use php to save
>>> it
>>> to disk or the db.  How can I do this and pull in all the css, images,
>>> etc?
>>>
>>>
>>>
>>> Thanks!
>>>
>>>
>>
>>
>>
> Or if you don't have access to curl, you can use file_get_contents() on a
> URL if allow_url_fopen=on.
>
> -Shawn
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


[PHP] upload file then move between servers

2007-04-20 Thread blackwater dev

I need to allow a user to upload a file.  Once the file is up, I need to
then move it to another server and wsync it to our webclusters.  What's the
best way to do this with php?  I don't really want php issuing root
commands.  I've considered storing the file in the db but really need it to
be scanned (they should just be images) then pushed out to my servers.

Thanks!


[PHP] cloning $this php5

2007-05-11 Thread blackwater dev

I have a method within an class that should make a copy of itself, do some
stuff on the copy and return it.  The object contains data members that are
references to other objects.  I basically want a brand new copy of the
object.  The problem is, certain methods I call on the object throw this
error:

Call to undefined method stdClass::methodname

I've tried to copy it with just =, =& and clone but they all through
errors.  What am I doing wrong?

Thanks!

function morph(){

$cloned_ob= clone $this;

$cloned_ob->run();
$cloned_ob->data_member="john";

return $cloned_ob;

}


[PHP] Re: cloning $this php5

2007-05-11 Thread blackwater dev

Actually, the error seems to be coming with inner objects call some of their
methods.  For example the object as a datamember that is a reference to
another object.  When I clone it, I can't seem to call methods on the data
member object.

Thanks!

On 5/11/07, blackwater dev <[EMAIL PROTECTED]> wrote:


I have a method within an class that should make a copy of itself, do some
stuff on the copy and return it.  The object contains data members that are
references to other objects.  I basically want a brand new copy of the
object.  The problem is, certain methods I call on the object throw this
error:

 Call to undefined method stdClass::methodname

I've tried to copy it with just =, =& and clone but they all through
errors.  What am I doing wrong?

Thanks!

function morph(){

$cloned_ob= clone $this;

$cloned_ob->run();
$cloned_ob->data_member="john";

return $cloned_ob;

}



[PHP] php hosting-mediatemple/dreamhost

2007-05-24 Thread blackwater dev

Forgive me if this is a bit off topic but I currenly have several sites
hosted with dreamhost, it's cheap and well prone to be slow.  Does anyone
have experience with mediatemple?  I would just be running php/mysql sites.

Thanks!


[PHP] ob_start <> eval?

2007-07-05 Thread blackwater dev

I have a template system that takes some data, scrubs it and then with a
load method includes the required template.  I need to add a param so it
doesn't simply include but returns the contents of the template in a string
with all of the vars populated.  I tried:

ob_start();
 include my template
$template=ob_get_contents();
ob_clean();
return $template;

But this returns the template it's it's raw for with all of tha
 tags.  Can I fill these in and still pass as another var
without using eval()?

What do other template systems to do return a template as a string on load?


Thanks!


Re: [PHP] ob_start <> eval?

2007-07-05 Thread blackwater dev

We have short tags enabled as our templates work fine with them.

Thanks!

On 7/5/07, Larry Garfield <[EMAIL PROTECTED]> wrote:


If I understand what you're doing correctly, then it should work and I've
done
it many times.  First thing you should do, though, is switch from short
tags
to proper tags, .  If you have short tags
disabled,
it will not parse  I have a template system that takes some data, scrubs it and then with a
> load method includes the required template.  I need to add a param so it
> doesn't simply include but returns the contents of the template in a
string
> with all of the vars populated.  I tried:
>
> ob_start();
>   include my template
> $template=ob_get_contents();
> ob_clean();
> return $template;
>
> But this returns the template it's it's raw for with all of tha
>  tags.  Can I fill these in and still pass as another var
> without using eval()?
>
> What do other template systems to do return a template as a string on
load?
>
>
> Thanks!


--
Larry Garfield  AIM: LOLG42
[EMAIL PROTECTED]  ICQ: 6817012

"If nature has made any one thing less susceptible than all others of
exclusive property, it is the action of the thinking power called an idea,
which an individual may exclusively possess as long as he keeps it to
himself; but the moment it is divulged, it forces itself into the
possession
of every one, and the receiver cannot dispossess himself of it."  --
Thomas
Jefferson

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




[PHP] headers-excel file-bad data

2007-07-31 Thread blackwater dev
Hello,

I have an excel file that I am generating.  If I copy over the generated
file and then open it in excel, it works fine, if I try to let the user
download it using the headers below, when I then open it excel complains
that it is an unrecognizable format and the info is garbled...any ideas???

Thanks!

header('Pragma: public');
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");  //
Date in the past
header('Last-Modified: '.gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate'); //
HTTP/1.1
header('Cache-Control: pre-check=0, post-check=0, max-age=0');//
HTTP/1.1
header ("Pragma: no-cache");
header("Expires: 0");
header('Content-Transfer-Encoding: none');
header('Content-Type: application/vnd.ms-excel;'); //
This should work for IE & Opera
header("Content-type: application/x-msexcel");//
This should work for the rest
header('Content-Disposition: attachment; filename="myfile.xls"');
readfile("/tmp/myfile.xls");


[PHP] Re: headers-excel file-bad data

2007-07-31 Thread blackwater dev
Looks like I have an empty space somewhere...this code is called down in a
class and if I just cut this out and copy into it's own file and call that
file from the browser, it works fine.  It is someone getting garbled down in
the class.

On 7/31/07, blackwater dev <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> I have an excel file that I am generating.  If I copy over the generated
> file and then open it in excel, it works fine, if I try to let the user
> download it using the headers below, when I then open it excel complains
> that it is an unrecognizable format and the info is garbled...any ideas???
>
> Thanks!
>
> header('Pragma: public');
> header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");  //
> Date in the past
> header('Last-Modified: '.gmdate('D, d M Y H:i:s') . ' GMT');
> header('Cache-Control: no-store, no-cache, must-revalidate'); //
> HTTP/1.1
> header('Cache-Control: pre-check=0, post-check=0, max-age=0');//
> HTTP/1.1
> header ("Pragma: no-cache");
> header("Expires: 0");
> header('Content-Transfer-Encoding: none');
> header('Content-Type: application/vnd.ms-excel;'); //
> This should work for IE & Opera
> header("Content-type: application/x-msexcel");//
> This should work for the rest
> header('Content-Disposition: attachment; filename="myfile.xls"');
> readfile("/tmp/myfile.xls");
>
>
>
>


[PHP] OT- why is network solutions more than godaddy?

2007-08-03 Thread blackwater dev
I have to register a bunch of names and am trying to figure out why I would
pay $35 when I can just pay $9 at godaddy.  Does godaddy own it and I lease
it from them???

Thanks!


[PHP] automated gui testing of php apps

2006-08-03 Thread blackwater dev

What do you all recommend for testing the gui side of your php
applications?  I've played with badboy a bit but we all run linux here at
work and I was looking for something more robust and would live to find a
free/inexpensive tool.  I've also tried SimpleTest for the ui side but it
seemed to be cumbersome to use for ui stuff.

Thanks!


[PHP] writing to fild on another server

2006-08-04 Thread blackwater dev

I have a web server and an images server.  My web server doesn't have
enought space for the images, hence the images server.  I have to download
properties from a realty database hourly and the data goes in to a db on my
webserver while the image needs to be taken from a MSSQL db and written to
the images server as an actual .jpg or .gif file.  Fopen, however, won't let
me write using the http protocol.  How can I open and write files between
servers?

Thanks!


[PHP] yahoo thinks html mail is spam, what's wrong with header?

2006-08-07 Thread blackwater dev

Hello all,

When I try to send email from my server as html, my yahoo account and
several of my user's email accounts mark it as spam.  I can send a normal
email via mail() just fine but when I try to to html, it's bad.  I've played
with a few things but can't seem to figure it out.  The html I am sending
just includes a table, no body, head, etc, just table html code.Here is what
I am using for the header:


$header="From:[EMAIL PROTECTED] <[EMAIL PROTECTED]>
\r\nContent-Type:text/html\r\n";

Here are some of the headers from yahoo:

X-Apparently-To: [EMAIL PROTECTED] via 66.196.97.50; Sun, 06 Aug 2006
13:46:30 -0700 X-YahooFilteredBulk: 64.140.230.68 X-Originating-IP: [
64.140.230.68] Return-Path: <[EMAIL PROTECTED]>
Authentication-Results: mta333.mail.re4.yahoo.com from=bwdev.com;
domainkeys=neutral (no sig) Received: from 64.140.230.68 (EHLO
localhost.localdomain) (64.140.230.68) by mta333.mail.re4.yahoo.com with
SMTP; Sun, 06 Aug 2006 13:46:30 -0700 Received: from
localhost.localdomain(web5 [
127.0.0.1]) by localhost.localdomain (8.13.1/8.13.1) with ESMTP id
k76JlHch008629 for <[EMAIL PROTECTED]>; Sun, 6 Aug 2006 15:47:17 -0400
Received: (from [EMAIL PROTECTED]) by localhost.localdomain 
(8.13.1/8.13.1/Submit)
id k76JlH8k008628; Sun, 6 Aug 2006 15:47:17 -0400 Date: Sun, 6 Aug 2006
15:47:17 -0400 Message-Id: <
[EMAIL PROTECTED]>

Thanks for any info!


[PHP] stupid question...compiling php

2006-08-07 Thread blackwater dev

Ok,

I am using a hosted server and php is installed from the linux distro.  I
usually have all the stuff in a php file somewhere so I can just go back
./configure, etc.  I can't seem to find the configure for php on this box so
I can recompile but I know it is there as I can use php and see the version,
how can I find the configure to use?

Thanks!


Re: [PHP] stupid question...compiling php

2006-08-07 Thread blackwater dev

Ok, doing that now and it's taking a while.  I can do phpinfo but that tells
me the config line and where the ini files are, not necessarily where the
configure stuff is to recompile...correct?

On 8/7/06, Jochem Maas <[EMAIL PROTECTED]> wrote:


blackwater dev wrote:
> Ok,
>
> I am using a hosted server and php is installed from the linux
distro.  I
> usually have all the stuff in a php file somewhere so I can just go back
> ./configure, etc.  I can't seem to find the configure for php on this
> box so
> I can recompile but I know it is there as I can use php and see the
> version,
> how can I find the configure to use?

php -l | grep configure

or


> Thanks!
>




[PHP] sessions no longer work

2006-08-09 Thread blackwater dev

Hello,

I have a site that was coded a while ago.  I was just told that the admin
side no longer works.  I looked and the host recently put php 4.4.2 on the
site.  I have tried a few things but nothing seems to work.  The problem is
once you log in the admin page always kicks you back, doesn't see the
session vars.  What could be wrong?  Here is the code:


0){
session_start();
 $_SESSION['wardadmin']="yes";
 header("location: admin.php");
 }
   else {$bad="Incorrect username and Password";}
}

I can echo out the session here and see yes, but I have this code in
admin.php



Thanks!


Re: [PHP] sessions no longer work

2006-08-09 Thread blackwater dev

Sorry if you are getting this multiple times, email is acting a bit screwy.

Nope. still doesn't work.  Sessions just aren't saved.


On 8/9/06, Jochem Maas <[EMAIL PROTECTED]> wrote:


blackwater dev wrote:
> Hello,
>
> I have a site that was coded a while ago.  I was just told that the
admin
> side no longer works.  I looked and the host recently put php 4.4.2 on
the
> site.  I have tried a few things but nothing seems to work.  The problem
is
> once you log in the admin page always kicks you back, doesn't see the
> session vars.  What could be wrong?  Here is the code:
>
> 
>  $uname=$_POST["uname"];
> $pword=md5($_POST["pword"]);
>  $SQL="select * from users where admin=1 and pword='$pword' and
> uname='$uname'";
> mysql_select_db($database, $wards);
>$Result1 = mysql_query($SQL, $wards) or die(mysql_error());
>$affected_rows = mysql_num_rows($Result1);
> if ($affected_rows>0){
> session_start();
>  $_SESSION['wardadmin']="yes";

try this here:

session_write_close();

>  header("location: admin.php");
>  }
>else {$bad="Incorrect username and Password";}
> }
>
> I can echo out the session here and see yes, but I have this code in
> admin.php
>
>  session_start();
> if ($_SESSION['wardadmin']!="yes") { header("location: login.php");
> exit;
> }
> ?>
>
> Thanks!
>




Re: [PHP] sessions no longer work

2006-08-09 Thread blackwater dev

It doesn't matter if I just surf to the page and they do seem to get the
same phpsessionid..interestingly enough the first three cars are 'BAD'.  Not
sure if the path is writable through.

On 8/9/06, Jochem Maas <[EMAIL PROTECTED]> wrote:


blackwater dev wrote:
> Sorry if you are getting this multiple times, email is acting a bit
screwy.
>
> Nope. still doesn't work.  Sessions just aren't saved.

check that the session save path is writable and have a look to
see if you are getting a new session id each time.

>
>
> On 8/9/06, Jochem Maas <[EMAIL PROTECTED]> wrote:
>>
>> blackwater dev wrote:
>> > Hello,
>> >
>> > I have a site that was coded a while ago.  I was just told that the
>> admin
>> > side no longer works.  I looked and the host recently put php 4.4.2on
>> the
>> > site.  I have tried a few things but nothing seems to work.  The
>> problem
>> is
>> > once you log in the admin page always kicks you back, doesn't see the
>> > session vars.  What could be wrong?  Here is the code:
>> >
>> > 
>> > > > $uname=$_POST["uname"];
>> > $pword=md5($_POST["pword"]);
>> >  $SQL="select * from users where admin=1 and pword='$pword' and
>> > uname='$uname'";
>> > mysql_select_db($database, $wards);
>> >$Result1 = mysql_query($SQL, $wards) or die(mysql_error());
>> >$affected_rows = mysql_num_rows($Result1);
>> > if ($affected_rows>0){
>> > session_start();
>> >  $_SESSION['wardadmin']="yes";
>>
>> try this here:
>>
>> session_write_close();
>>
>> >  header("location: admin.php");
>> >  }
>> >else {$bad="Incorrect username and Password";}
>> > }
>> >
>> > I can echo out the session here and see yes, but I have this code in
>> > admin.php
>> >
>> > > > session_start();
>> > if ($_SESSION['wardadmin']!="yes") { header("location: login.php");
>> > exit;
>> > }
>> > ?>
>> >
>> > Thanks!
>> >
>>
>>
>




  1   2   >