Re: [PHP] Re: Development Tools

2002-07-12 Thread Matt Williams

On Wednesday 10 July 2002 20:51, Matthew K. Gold wrote:

> Of course, Macromedia recently bought Allaire, so who knows what the next
> version of Homesite will look like...

Dreamweaver MX

They seem to have merged all the editing bits of Homesite in with Dreamweaver.

I must say this is the is best incarnation of DW yet, I've been using it 
since v1.2 and find MX great, especially now they've improved there support 
for CSS positioning in the preview window.

I haven't had time to look into the php side of things on it.

I currently use Zend 2.5 which is a vast improvement over 2. The php/html 
code completion is very good. I got it cheap or I probably wouldn't have 
shelled out that much for it. Zend now have released 2.0.1 as freeware, but 
I'm not sure if this is a cutdown 2 or the full thing, but as I say, this 
really is not reflection of how much better 2.5 is.

I use Zend mainly due to the fact that most of my development is on linux and 
due to the fact that it is java, it looks and feels the same  wheter I'm on 
doze or linux.

For a free windows php editor I like phpedit, which despite it's bugs is very 
good.

I also like ultraedit for general editing, etc...

I haven't tried any other as it would consume far too much time and I 
probably never get any work done.

matt

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




Re: [PHP] $name = "My $row['name']" not longer possible?

2002-07-02 Thread Matt Williams

On Tuesday 02 July 2002 13:49, Uwe Birkenhain wrote:

> Hi,
> I upgraded to 4.2 and now I get those errormessages
> "Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting
> T_STRING or T_VARIABLE or T_NUM_STRING in ..."
>
> when doing sth like:
> $name = "My $row['name']";
>

Try 

$name = "My {$row['name']}";

or

$name = "My ".$row['name'];

AFAIR you can't use array variables straight within strings.

Maybe I'm just about to be proved wrong :)

matt

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




Re: [PHP] php install

2002-07-01 Thread Matt Williams

On Monday 01 July 2002 11:20, Nigel George wrote:

> Hi, I'm trying to install PHP 4.2.1 on SuSE SLES 7.3 and I get the
> following error message
>
> checking lex output file root... ./configure: lex: command not found
> configure: error: cannot find output from lex; giving up
>
> any ideas?

install flex

matt

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




Re: [PHP] PHP include_path

2002-06-27 Thread Matt Williams

On Thursday 27 June 2002 17:13, you wrote:

> I am running php4.2.1.  I tried to use a simple include() coommand, but the
> path that it defaults to is /usr/local/lib/php.  Can anyone tell me how to
> change this?
>
> Thanks

You can change this either in your php.ini or add it to a .htaccess as;

php_value include_path ".:/path/to/your/dir"

if your system is setup for it.

matt

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




Re: [PHP] PHP --> HTML

2002-05-09 Thread Matt Williams

On Thursday 09 May 2002 1:23 pm, Dan Hardiker wrote:

> You could also use some form of spider to go through your website. These
> are usually aimed at downloading a website to your local machine, or for
> mass caching.
> This should have the effect your after with minimum fuss and no rewriting
> of the .php scripts (or need to write another tool).

do a google for HTTRACK, very impressed with the sites we've had to cache 
locally

matt

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




Re: [PHP] PHPlib sessions without a DB?

2002-04-26 Thread Matt Williams

On Friday 26 April 2002 2:25 pm, Alan McKay wrote:

> Folks,
>
> I was going through PHPlib for the first time to assess whether or not I
> can use it on a current project, and it looks pretty clear to me that you
> need a DB in order to use the session management.
>
> My environment will be a Windows NT 4.0 SP5 box running Apache
> and PHP.  I have no DB on the box, and am not allowed to introduce one,
> nor am I allowed to rely on an external DB of any sort.
>
> Is there a way to use PHPlib sessions in this environment?

Hi Alan

I think this is primarily due to the fact that the phplib sessions were 
around before php built in sessions.

In the current CVS for phplib there are some files that allow you to utilise 
php's built in sessions. This enables you to use file storage for sessions. 

I've been using the session4 stuff with phplib for a while and works well, 
but this is using db storage. I wouldn't imagine there will be a problem just 
using a different session container.

As for the default distribution of phplib I don't know if this can use files 
for session storage I haven't had the need to find out.

HTH 

matt

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




Re: [PHP] extracting a html file name

2002-04-23 Thread Matt Williams

On Tuesday 23 April 2002 6:59 pm, [EMAIL PROTECTED] wrote:

> ie bill,  car, jack, moneypower   etc...
>
> example
>
> http://www.mydomain.com/member.php/moneypower/test.html
>
>
> I have experimented with the php variables that come in , but the only way
> I could figure out to get test.html out of there is If I captured the
> $PATH_INFO AND did a str_replace  on all the html filenames on that site
> and did another one to get rid of the /  .  then I would have the member
> name and then i could do a string replace on the member name from the path
> info, which works , for now but as I get more files etc, it's gonna be a
> pain in the butt,  there has to be a better way to do it.

Hi the function you need is explode.

try

$my_path = explode("/",$PATH_INFO);
array_shift($my_path);

so $my_path[0] will be moneypower using the above
$my_path[1] will be test.html

HTH

matt

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




Re: [PHP] Passing Arrays

2002-04-22 Thread Matt Williams

On Monday 22 April 2002 11:40 am, Boaz Yahav wrote:
> Suppose i have a multiple select posted to a script by a form.
> now i have to send this array again with a new form to a new
> script.
>  
> How do i do this?
>  
> thanks
>  
> berber


Hi Berber

you could serialize the array into a hidden field on the next form.

matt

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




Re: [PHP] Link

2002-04-18 Thread Matt Williams

On Wednesday 17 April 2002 15:37, SHEETS,JASON (Non-HP-Boise,ex1) wrote: 

> if(Criteria=$Input) {
> Header("Location: http://www.yourplace.com/Pagename.php";);
> exit;
> } elseif(Criteria=$SomethingElse) {
> Header("Location: http://www.yourplace.com/somewhereelse.php";);
> exit;
> } else {
> Header("Location: http://www.yourplace.com/error.php";);
> exit;
> }

remember to use == also, otherwise your doing an assignment

matt

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




Re: [PHP] Downloading files

2002-04-09 Thread Matt Williams


On Tuesday 09 April 2002 11:20, Declan Kenny wrote:
> Hi folks,
>
> Ok I am trying to make a download area for files (including word files).
> How do I force a download of a word document rather than have it opening in
> IE?
>
> Declan

You don't. This option is set in windows exploror. as part of the file type
options.

I can tell you where exactly if you want to go round updating all windows/IE
users machines. I'll do mine for you as a start ;)

matt

---

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




Re: [PHP] Apache

2002-03-21 Thread Matt Williams

On Thursday 21 March 2002 08:28, jtjohnston wrote: 

> I'm also looking at this in my .conf. I know putting something here is the
> answer, but what :)
>
> 
>     Options FollowSymLinks
>     AllowOverride All
> 
>
> J

Options -Indexes

matt


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




[PHP] LDAP and 2k

2002-03-20 Thread Matt Williams

Hi all

Has anyone been successful in authenticating ldap via win2k using 
samaccountname (username) instead of the users container name.

I can successfully do it against the cn but this is not always the same as 
the username.

All help/guidelines will be gratefully received.

matt

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




[PHP] Re: Congrats to Rasmus?

2002-03-11 Thread Matt Williams



> > "Well, everyone's favorite PHP developer multiplied last night - Rasmus
> > Lerdorf now has a son (9.0lbs, 19.25in. - a big boy) was born at 13:26
> > PDT on Wednesday March 6, 2002. If you'd like to see some pics from the
> > family, check out this page - or to send congrats, email
> > [EMAIL PROTECTED]"

congratulations Rasmus

matt

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




Re: [PHP] using a variable to a function call

2002-03-08 Thread Matt Williams

On Thursday 07 March 2002 19:21, Lars Torben Wilson wrote: 

> // The direct way:
> $foo->{$test . '_foo'}();

Thanks Lars

This was what I was looking for, just couldn't remember the syntax


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




[PHP] using a variable to a function call

2002-03-07 Thread Matt Williams

Hi all
 
I get a variable that is set be a select box on a page.
I want to use this variable to call a function within a class that is based 
on it's name.

so if $var = "me"

I want to call $class->me_function();

or if

$var = "you"

call

$class->you_function();

How can I use the variable as part of the function name to call.

TIA

matt

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




Re: [PHP] permision denied when reading directory contents on fat32

2002-02-25 Thread Matt Williams

On Monday 25 February 2002 16:02, narko wrote:

> when i do directory listing with readfile('c:\some\dir\name') warning is
> generated
> Warning: readfile("c:\temp\") - Permission denied in
> c:\programming\apache\htdocs\downloads\update.php on line 15
>
> filesystem is fat32 so permissions are fake
> configuration: php 406 on windows2000
>
> is there any way to do directory listing with php

Try using forward slashes or double backslashes


-- 
m:

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




Re: [PHP] Problem about Reading input from a Form

2002-02-25 Thread Matt Williams

On Monday 25 February 2002 12:57, Kostas Karadamoglou wrote:
> I can't take the variables $user and $address from the form to the php
> file. Below I have the code.When I test the examble I only see the html
> text but not the variables. Thank you
>

Whic version of PHP are you using? If it's 4.1 I think php ships with 
register_globals off.

I think you have to access your variables with $_GET & $_POST. I'm not too 
sure as I haven't upgraded yet.

m:


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




RE: [PHP] Breadcrumbs in PHP

2002-02-18 Thread Matt Williams

Hi Laurie

Not really looked at the script there. But I wrote one a while back which is
similar.

http://oozoo.co.uk/nobba/php-here.php

Have look at that and see if you have the same problems

m:

> I was trying out this breadcrumbs code found at evolt.org:
>
> http://www.evolt.org/article/Breadcrumbs_for_PHP_Lovers/17/4455/
>
> and tried it on my site. The same problem as documented on that page
> exists on my page, being that it doesn't include any directories between
> the "home" and the current page, such as:
>
> home > about us > contact us.
>
> Instead it shows as
>
> home > contact us
>
> I've made some changes as recommended by the postings below, such as
> changing SCRIPT_URL to PATH_INFO, but still no changes.
>
> Has anyone had any experience and workaroudn with this particular script,
> or if there's a better script that I can use for breadcrumbs?
>
>
> --
> Laurie Landry
> [EMAIL PROTECTED] - email
> (604) 693-1120 - voicemail/fax
>
>
>
> --
> 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] determining script url

2002-02-08 Thread Matt Williams

> Hi all,
> How can I get the full URL of the currently running script? 
> $DOCUMENT_ROOT is not what I need, instead I need the url (be it 
> domain if exists, or ip if not).  $SERVER_NAME works but if a 
> domain isn't paired with the server, I could get some useless 
> information (right?).

$SCRIPT_NAME or $SCRIPT_FILENAME

See http://uk.php.net/manual/en/language.variables.predefined.php

For more details

m:



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




RE: [PHP] Re: DreamWeaver/PHP ability?

2002-02-08 Thread Matt Williams

> Luke Crouch wrote:
>
> > I know Dreamweaver UltraDev has nice site management features
> for using a
> > JSP/SQL type serverdoes it have similar capabilities with PHP/MySQL?
> > Does anyone know?
> >
> > -L

Search the archives on this one.

There is a project called php4ud or something like that but I can't remember
the url.

I've never used it so I couldn't comment

m:


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




RE: [PHP] Using $PATH_INFO as variables (inspired by www.DevShed.com)

2002-01-30 Thread Matt Williams



m:

> my main URL (for example) is www.mycompany.com
> I want the central page about our projects to be found under
> www.mycompany.com/projects
> and project LovePeaceAndBananas under
> www.mycompany.com/projects/LovePeaceAndBananas
>
> I already know that this can be achieved by using the $PATH_INFO as
> variables, to be used in de main file in the root of the site.
> So far I have my Apache webserver accept files with no extention
> (index, in
> stead of index.php) to be parsed as PHP. But if I look at the site of
> DevShed, I don't see them using a file at all! I can't get it to
> work on my
> local test system to make an URL like
> www.mycompany.com/projects/LovePeaceAndBananas without the existens of a
> file called 'projects'.
> Can anyone tell me their 'trick'? (unfortunately, they don't show
> their page
> source anymore like they used to do ...)
>

Hi

see this page for more details

http://www.phpbuilder.com/columns/tim19990117.php3

You do actually need the file called projects. This is the file that does
all the work.

It didn't quite work exactly as that for me, so here's what I did just in
case you need it.

add the follwoing into  .htaccess under you site root

## set rewrite rule for author
RewriteRule ^/projects/(.*) /projects?rest_of_url=/$1

Then add this to your projects file

$_MY_PATH = explode("/",$PATH_INFO);
array_shift($_MY_PATH);

This will give you the array of elements that come after projects.
i.e /projects/LovePeaceAndBananas/one

$_MY_PATH[0] // this will be LovePeaceAndBananas
$_MY_PATH[1] // this is one

etc

HTH

m:


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




RE: [PHP] phplib???

2001-12-14 Thread Matt Williams


> It is a external library with useful PHP functions. It was designed
> by some German guys, but you can now forget it. Main feature was the
> session function and that function is now integrated in the PHP
> extensions.
> 

Maybe not quite forget as easily as that.

PHPLib offers very good user management and authentication.

It also allows to use native php session management.

m:

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




RE: [PHP] a piece of PHP history

2001-12-13 Thread Matt Williams


> http://groups.google.com/groups?selm=1991Apr14.200541.755%40napc.uucp
> 

So did you ever find the book Rasmus 

m:

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




RE: [PHP] is_int with HTML FORM

2001-11-30 Thread Matt Williams


> or remove the  {$len} to not check for a length
> 

Sorry I meant replace the above with *

m:

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




RE: [PHP] is_int with HTML FORM

2001-11-30 Thread Matt Williams


> Ok for the question. I was under the impression that PHP would
> automatically
> select the type for the vars to use. However if I have a field in my form
> where I insert only a 4 in I'd expect the var to be an integer
> (or atleast
> some other whole number type of var). However is_int fails on the
> 4 and sees
> it as a string. So how am I going to check whether it's nothing
> but digits
> [0-9]. The field can hold 4 characters but they don't neccesarily
> need to be
> filled. So the input could be 1 through . Now I could check
> with > or <
> but that won't work since they would still eval true if they'd
> enter 3a. Ok
> it would fail if they'd enter a3 but that still leaves a
> possibility to crash
> my script with 3a. Perhaps somebody could hand me a nice regexp or
> something... I'm not yet familiar with those.

Try this

// checks wether a variable is a n integer of a certain length
// $var = variable to check
// $len = length
function check_int($var,$len)
{
if(eregi("^[0-9]{$len}$",$var))
{
return 1;
}
else
{
return 0;
}
}

or remove the  {$len} to not check for a length

>
> Kind regards and have a nice weekend.
>

Thanks I will

M:


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




RE: [PHP] HTTP_REFERER

2001-11-23 Thread Matt Williams

> Hi,
> When I use HTTP_REFERER it gives me the name of the php script which is
> handling the 404's?!
>
> Should that happen?

As someone put in one of the other reply's don't rely on HTTP_REFERER.
This is set (or not) by the browser and they all have different ideas about
they want to play ball with it.

You said you wanted to find the url they were trying to get at.
Use the variable I told you about before to get his

Regards
M:

>
> Jord
>
> On Friday 23 November 2001 11:41, you wrote:
> > > Hi,
> > > I'm writing a 404 handler and in order to report the item that
> > > was requested
> > > I was trying to get the value of HTTP_REFERER. But, it does seem
> > > to get set.
> > > Does anyone know how to find thi value? Is there a reason why it
> > > would not
> > > get set?
> >
> > Hi
> >
> > I think you're looking for this
> >
> > $HTTP_SERVER_VARS["REQUEST_URI"]
> >
> > M:
>
> --
> Jordan Elver
> Web Developer
> http://www.theinternetone.co.uk
> testing? What's that? If it compiles, it is good, if it boots up it is
> perfect. --- Linus Torvalds
>


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




RE: [PHP] HTTP_REFERER

2001-11-23 Thread Matt Williams

> Hi,
> I'm writing a 404 handler and in order to report the item that 
> was requested 
> I was trying to get the value of HTTP_REFERER. But, it does seem 
> to get set. 
> Does anyone know how to find thi value? Is there a reason why it 
> would not 
> get set?
> 

Hi 

I think you're looking for this

$HTTP_SERVER_VARS["REQUEST_URI"]

M:

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




RE: [PHP] Re: apache + ftp!

2001-11-12 Thread Matt Williams


> on win32 i like g6ftp server

I go along with this recommendation.

Had some problems on 2k with serv-u

M:

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




RE: [PHP] Week of month

2001-11-01 Thread Matt Williams

Please find attached a very good date class.

I can't remeber where I got it from and who wrote it but it's pretty good.

M:

> --
> > Is there any way to find out the week of the month. Today is in
> the first
> > week of month.
> >
> > That is, a function like weekofmonth() which displays 1 today & 2 next
> week.
>
> No builtin function in PHP. You will need to search to see if
> some kind and
> generous soul has published their code for this purpose or write your own.
> Remember the actual first day of a week can be country specific.
>
>

 Date_Calc-1.2.4.tar.gz

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


RE: [PHP] setting member variables out of class

2001-10-31 Thread Matt Williams


> Hello,
> I want to set member variables out of their class. The code class is:
>
> 
> class translator {
>
>  var $nombre;
>  var $departamento;
>  var $despacho;
>  var $telefono;
>  var $correo_electronico;
>  var $pagina_personal;
>
>  function translator(){
>   $nombre = array("Nombre","Name");
>   $departamento = array("Departamento","Department");
>   $despacho = array("Despacho","Office");
>   $telefono = array("Teléfono","Phone");
>   $correo_electronico = array("Correo Electrónico","E-mail");
>   $pagina_personal = array("Página Personal","Personal HomePage");
>  }
> }
> ?>
>
>
> I access to this class from another php file and want to set this
> member variable:
>
> $c = new translator();
> echo $c->telefono;   /* this member isn't set but in
> constructor method has been set*/

So what error message do you get?

$c->telefono is an array so you will not be able to echo it straight out.
It will echo 'Array'.

Is this what you're getting?
If so, read up on arrays from the manual, specifically each

M:


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




RE: [PHP] Popup Window Problems & Refresh

2001-10-31 Thread Matt Williams


> The action for the form is only fired if the  onClick="window.close() is
> removed. My question is how can I close the window and refresh or reload
> the specified window.
> 

function endWindow()
{
window.opener.location.reload();
window.close();
}

Close Window

M:

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




RE: [PHP] Zipping a folder on a win2000 server with php4.06

2001-10-31 Thread Matt Williams

pkzip's the name.

M:
> Does someone out there know, how I can zip a folder with some files in it?
> It should be readable for Winzip.
>
> Enviroment: Win2000 Server.
> VB was available if useful.
> Additional Components (applications, dll's or whatever) could be loaded if
> needed.
>
> I didn't find a usable entry in the manual, so if you tell me to rtfm -
> please point me to the corresponding entry also :)


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




RE: [PHP] Quick array question

2001-10-30 Thread Matt Williams

Just found this in the manual notes

http://www.php.net/manual/en/ref.array.php

To delete an element from an array in an easy way, use
unset($array["element"]);...

Funny those... manuals

M: 

> -Original Message-
> From: David Yee [mailto:[EMAIL PROTECTED]]
> Sent: 30 October 2001 19:03
> To: [EMAIL PROTECTED]
> Subject: [PHP] Quick array question
> 
> 
> Hi.  Is there an array function that deletes an array element 
> (that's not at the beginning or the end of the array) and return 
> the resultant array?  E.g. this is what I want to do:
> 
> $a = array(1, 2, 3, 4, 5);
> 
> $b = array_element_delete_function($a, 2);
> 
> $b now has 4 elements with the following values: (1, 2, 4, 5)
> 
> Thanks.
> 
> David
> 

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




RE: [PHP] PHP General Archive

2001-10-30 Thread Matt Williams

http://www.progressive-comp.com/Lists/?l=php3-general&r=1&w=2

M: 


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




RE: [PHP] Re: Zipping a folder on a win2000 server with php4.06

2001-10-30 Thread Matt Williams


> Well, I would do that but I don't know such an application.
> Please, can you suggest me one?
> 

pkzip of course :)

M:

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




RE: [PHP] Win98 + Apache + PHP4

2001-10-30 Thread Matt Williams


> Thanks for the replies, I think it has more to do with configuration
> settings than anything else as all the scripts work fine on remote Linux
> server, it is just on my win98 set-up the problem occurs..
> 
> I am looking in the php.ini, file the only reference to a tmp directory I
> can see is for file uploads, not too sure what I should add 
> change to set a
> temp directory for cookies??

Line 629 on my php.ini 

session.save_path = /tmp

try c:\\tmp or c:/tmp

create the dir first

M:



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




RE: [PHP] Win98 + Apache + PHP4

2001-10-30 Thread Matt Williams

> I have the above configuration installed along with mySQL, all
> works fine on
> my local machine except for error/warning messages whenever previewing the
> page in my browser where I am calling/setting a cookie variable...
>
A little more info re the error message would be useful.


Make sure there is no whitespace before you try and set you cookie This
includes included files also

M:


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




RE: [PHP] How to protect MySQL password

2001-10-23 Thread Matt Williams

Move it outside the document root

or put a .htaccess file inside the dir to deny access. This will still allow
system access but will prevent other fopen.

M:

> In a PHP application using MySQL i have to connect the database using
>
>   $iDBhandle = mysql_connect( $sDBhost, $sDBuser, $sDBpsw );
>
> Problem is, that I cannot see any solution to protect the value
> of $sDBpsw.
> Of course I wont set the value of $sDBpsw in the same PHP script. I do
> that including a file pa/pa.php (protected area) but this file also has to
> have read access to all users and could be read with fopen( "URL", "r" ).
>


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




RE: [PHP] class problems

2001-10-18 Thread Matt Williams

Ok got it from here.

http://uk.php.net/manual/en/keyword.paamayim-nekudotayim.php

using :: allows use of a class function but doesn't allow access the object,
so to access $this I do need to instantiate the class

Thanks

M:

> Try to create an instant of the class like this:
>  class test
> {
> var $table = "val";
>
> function showName()
> {
> return $this->table;
> }
>
> }
> $test = new Test;
> echo $test->showName();
>
> ?>
>

M:

> -Original Message-
> From: Valentin V. Petruchek [mailto:[EMAIL PROTECTED]]
> Sent: 18 October 2001 14:39
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] class problems
>
>
> Try to create an instant of the class like this:
>  class test
> {
> var $table = "val";
>
> function showName()
> {
> return $this->table;
> }
>
> }
> $test = new Test;
> echo $test->showName();
>
> ?>
> - Original Message -
> From: "Matt Williams" <[EMAIL PROTECTED]>
> To: "PHP General List" <[EMAIL PROTECTED]>; "PHP_UK@egroups."
> <[EMAIL PROTECTED]>
> Sent: Thursday, October 18, 2001 4:25 PM
> Subject: [PHP] class problems
>
>
> > Any ideas why this won't output anything
> >
> >  > class test
> > {
> > var $table = "matt";
> >
> > function showName()
> > {
> > return $this->table;
> > }
> >
> > }
> >
> > echo test::showName();
> >
> > ?>
> >
> > I have other classes along the similar lines but a lot bigger which work
> > fine.
> > I'm also using phplib which has a lot of this stuff going on...
> >
> > I remeber seeing something regarding it in the manual but i
> don't get how
> > it's all worked before.
> >
> > I'm using php4.06 apache 1.3.19 on win2k.
> >
> > TIA
> >
> > M:
> >
> >
> > --
> > 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 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] class problems

2001-10-18 Thread Matt Williams

Any ideas why this won't output anything

table;
}

}

echo test::showName();

?>

I have other classes along the similar lines but a lot bigger which work
fine.
I'm also using phplib which has a lot of this stuff going on...

I remeber seeing something regarding it in the manual but i don't get how
it's all worked before.

I'm using php4.06 apache 1.3.19 on win2k.

TIA

M:


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




Re: [PHP] Rebuild PHP

2001-10-02 Thread Matt Williams

Once upon a time, Duncan Hill wrote:

>
>I_think_ that this is dependent on whether you use the DSO feature
of
>Apache.  IIRC, I've been able to do an upgrade on PHP and just
>reloaded
>apache to take advantage of the new library module.

Correct the manual explains have to compile with DSO.
It makes life so much easier
--
Matt Williams
[EMAIL PROTECTED]



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




RE: [PHP] I'm back

2001-09-25 Thread Matt Williams

> Oh well, who didn't know me can whether ignore this message or just say
> hi :-)
> 
> Cheers Everybody!
> Maxim Maletsky

Welcome back Max

M@

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




RE: [PHP] Detecting an image form submission via PHP

2001-09-21 Thread Matt Williams

> When a form is submitted using a standard SUBMIT button it is possible
> to catch this via php using  if ($submit) but how do you catch this if
> you are using an image for submitting instead of the button?
>
> Any help would be greatly appreciated.
>

values of image_x and image_y will be set if you use a button.
Also be aware that if someone submits the form via keyboard none of these
maybe set.

You could use a hidden field containing the formname and look for that

HTH

M@


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




RE: [PHP] Book

2001-09-13 Thread Matt Williams

> I just got the book entitled "PHP and MySQL web development" by Luke
> Wellington and Luara Thomson.
>
> I wondering how others liked the book...I haven't gotten a chance to look
> at it yet..and I'm wondering if i should :-)

Now that you've got it you might as well read it. Then you could tell us
what it's like :-)

M@


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




RE: [PHP] Using mod_rewrite with PHP

2001-07-20 Thread Matt Williams

 
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

> I've been wrestling with mod_rewrite and trying to understand how
> to  use it for my particular purpose. I've got two php URLs I'd
> like to  rewrite to make them search-engine friendly. Currently
> they look like:  
> 
> Example 1:
> http://mysite.com/foobar.html?c=23
> 
> Example 2:
> http://mysite.com/foobar.html?c=23&p=45
> 
> What I'd like to end up with is something like:
> 
> Example 1:
> http://mysite.com/foobar/23
> 
> Example 2:
> http://mysite.com/foobar/23/45
> 
> I'm kind of new to mod_rewrite and regexp's, so can anybody give 
> me a clue?
> 

This is how I do it.

Use this rewrite
RewriteRule ^/foobar/(.*) /foobar?rest_of_url=/$1

Then everything after foobar/ will be put into $PATH_INFO.

I then call these lines at the top of every page

$PATH = explode("/",$PATH_INFO);
array_shift($PATH);

now $PATH[0] = 23
$PATH[1] = 45
etc...

Get it

HTH

M@

-BEGIN PGP SIGNATURE-
Version: PGPfreeware 7.0.3 for non-commercial use 

iQA/AwUBO1fz66W0/zC+QxWwEQLhpQCfS4a43fa3uxCcx2q/i3KukAw5KJsAn1uJ
5c5sd5weQLr7AoXasYCkqJZO
=sGVV
-END PGP SIGNATURE-


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




RE: [PHP] a good PHP editor

2001-07-18 Thread Matt Williams

 
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

- -BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

> I haven't seen any other programs for Windows you can edit remote
> files instead of the usual "download, edit, upload". Let me know if
> there are other good editors with this feature.

HTMLedit (www.chami.com) let's you edit remotely. and has good syntax
higlighting, browser and there are loads of extensions for it.
 And it's free

> There are three bad things about this program though;
> 1, The price - $99 usd ($89 if you download it).
not too bad.

> 2, It takes alot of system resources.

Agreed, it's very hungry and buggy.

> 3, There are still some bugs in their ftp engine.

Not really used this much

 M@

- -BEGIN PGP SIGNATURE-
Version: PGPfreeware 7.0.3 for non-commercial use


iQA/AwUBO1X9/6W0/zC+QxWwEQJ0mQCeKHQVjMGgLyY51U6XN1omS04y50cAn3ND
yorwcdfkYxpe1M0oT41bMn1e
=bxMi
- -END PGP SIGNATURE-

-BEGIN PGP SIGNATURE-
Version: PGPfreeware 7.0.3 for non-commercial use 

iQA/AwUBO1X+s6W0/zC+QxWwEQI2MQCg4MGQG0+q7K19KbNEVOs2WQMm67QAn263
oeyU9rCo8NfwdPQRGrzg/zUK
=mqmi
-END PGP SIGNATURE-


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




RE: [PHP] Security of PHP code

2001-07-05 Thread Matt Williams

 
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

> The only foolproof method for restricting access is to strip
> forward  slashes.  In the above example, I can change the file to:
> /www/sites/mysite/teaching/../../../../etc/passwd
> And it will be allowed
> If you were to do this, however:
> $allowed_path = "/www/sites/mysite/teaching";
> $file = ereg_replace("/","",$file);
> show_source($allowed_path."/".$file);
> That would block any attempt to trick the server into going into
> another  directory.

You could also check for/ remove any instances of ..

M@

-BEGIN PGP SIGNATURE-
Version: PGPfreeware 7.0.3 for non-commercial use 

iQA/AwUBO0QmZ6W0/zC+QxWwEQJwEgCgkvHAwNgR+tHvlyWgfefw5tipb24AoPXn
QNZ72t51rOmh7dts2zZd0S3p
=q64c
-END PGP SIGNATURE-


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




RE: [PHP] Missing arguments for function in class? (object-orientedprogramming)

2001-06-28 Thread Matt Williams

 
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

> I have a function that works perfectly (from within a script).  But
> when I make it a class (object) and call it from an external file,
> I get the following error:
> 
> Warning: Missing argument 1 for display_records() in
> http://www.friendshipcenter.com/Objects/display_records.inc on
> line 5  
> 
> Warning: Missing argument 2 for display_records() in
> http://www.friendshipcenter.com/Objects/display_records.inc on
> line 5  
> 
> After the warnings, it executes the function without passing values
> to the variables (i.e., it doesn't work), and then it executes the
> function a second time perfectly (with the appropriate variables).
> 
> Line 5 is this: 
> 
> function display_records($row, $record_count)
> 
> It displays the first error message for $row, and the second error
> message for $record_count.

Because your function has the same name as your class whenever you
create a new instance of the class the function will automatically
run.

So by creating a new class you are calling the function without
passing any arguments.

either

a) rename the function

or 

b) call the class like this

$my_records = new Display_Records($row, $record_count);

sorry for any wrong use of terminology

HTH

M@

-BEGIN PGP SIGNATURE-
Version: PGPfreeware 7.0.3 for non-commercial use 

iQA/AwUBOzrpgaW0/zC+QxWwEQLkWwCg+ZTT0Kwld191fqnfQMNRKUEk9FYAoM8X
9oD3Bf5U9eTiGo/mRPU/dEEX
=rbZj
-END PGP SIGNATURE-


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




RE: [PHP] Filtering out \ when a ' is user entered?

2001-06-27 Thread Matt Williams

 
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

> Hello,
> 
> I'm pretty new to PHP but all I've seen of it so far I pretty much
> love!  
> 
> I've built a web log but when the user enters their data and they
> use ' or "  (and you know they will)   php always shows it from the
> included web log as
> 
> \'  How can I filter out these backslashes so they don't appear on
> the final public viewable page?

stripslashes()

www.php.net/stripslashes

HTH

M@

-BEGIN PGP SIGNATURE-
Version: PGPfreeware 7.0.3 for non-commercial use 

iQA/AwUBOzncFqW0/zC+QxWwEQIGiQCg+WcEtXTo3uE5EBpLqVZW0lYw9qMAnA1o
rJOoQt2zlKDzJaU85Clk4TOL
=lBUy
-END PGP SIGNATURE-


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




RE: [PHP] Need recommendation: good user management system (PHP/MySQL)

2001-06-21 Thread Matt Williams

> I'm just starting to learn PHP and it's going to
> take a while before I can create a really good
> script to password protect a section of my site,
> with a good admin control center to manage my
> user's accounts. Therefore I'm asking for
> recommendations on a good retail script that can
> handle this for me until I'm skilled enough to
> create my own. I'm a little desperate since I'm
> using a poorly written CGI script at the moment.
> 
> I'm looking for a customizable PHP/MySQL script to
> password protect an area of my site and add/edit
> user's accounts. You know the usual member
> management script.
> 

Try phplib 

http://phplib.netuse.de

This will do what you need and you will save time writing you're own.

M@

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




RE: [PHP] All URL's calling one script

2001-05-24 Thread Matt Williams

> Hi All
> 
> This is possibly more of an apache/linux question...  does anyone 
> know a way
> to force ANY url to run ONE PHP script on a virtual server... eg. 
>  the same
> script is run if a user goes to www.myserver.co.uk or
> www.myserver.co.uk/dfkgjdfl/ or www.myserver.co.uk/hello.htm or 
> WHATEVER!!!
> :o)

If you're using apache and have rewrite enable. you could use

RewriteRule ^/(.*) /my_script?rest_of_url=/$1

or just

RewriteRule ^/(.*) /my_script

HTH

M@

-- 
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] Compressing uploads

2001-05-15 Thread Matt Williams

Does anyone have an example of compressing file uploads or files in general?

Basically some big files are being uploaded and I want to be able to zip/tar
them to cut down on disc usage.
I've tried playing with the zlib functions but haven't had much/any success
at adding files into archives.
The file sizes end up as 0.

Many thanks in advance

M@


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




RE: [PHP] Site search engine suggestion.

2001-05-15 Thread Matt Williams

Hi

Try DGS Search form http://www.digitalgenesis.com

Looks pretty tidy

Only downside is you can't exclude directories

HTH

M@

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




RE: [PHP] php4 & phplib problems

2001-05-15 Thread Matt Williams

Hi

>
> is anyone using phplib with php4?

yes

> I seem to be unable to get it working on a win98 machine with php4.0.5

with apache or PWS?

> I have been using it with php3 before successfully
>
>
> Please help
> I am missing something obvious?

I would suggest searching the phplib archives. Using phplib with php 4 has
come up quite a few times.
It should work "as is" but there are a few files in CVS to make use of
php4's native session handling.

M@


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




RE: [PHP] bulletin board or forum

2001-05-10 Thread Matt Williams

phorum.org

M@


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




RE: [PHP] Ultradev PHP Server Model

2001-04-27 Thread Matt Williams


> > I was wondering, is anyone aware of a PHP server model, for Ultradev?
> >
> > Or, any leads on how I can create one?
> >
> > I'm developing a site with PHP+MS Access+Ultradev. I wanted to use some
> > of the Ultradev server model features (and convenience), but
> > they only support ASP/JSP/JScript.
>
> I'm not aware of one -- I wish I were!
>
> The book "Extending Dreamweaver 4" from Macromedia documents their API's,
> including server models. I've got the book...it's pretty hefty. I *think*
> it's fairly complete, though I can't immediately determine if it has all
> the info necessary to create a new server model.
>
> I sincerely hope someone does this! I would give it a shot if I weren't so
> green...
>

Check out

http://www.geocities.com/php4ud/

I've never tried it but it was in my bookmarks to have a look at.

I would be grateful of any feedback on it.

Cheers

M@



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




RE: [PHP] forms and RETURN key

2001-04-27 Thread Matt Williams


> If I run this form using IE, hitting the Return/Enter key submits the form
> but the 'ok' variable is not set; it just redraws the form.  If however, I
> uncomment the third echo line (the one for Name2), then hitting the
> Return/Enter key does have the desired effect in IE.  In NS, the first
> version acts just like IE; the form redraws and that is all. But using the
> second variant with both text fields, hitting the Return key in NS does
> nothing at all.
>

I think this is the way it is.

Rather than testing for the value of submit, I have started adding a hidden
field called formname with the value being which ever form it is.
I then look for this instead of the value of the submit button

HTH

M@


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




RE: [PHP] rounding up

2001-04-25 Thread Matt Williams

Hi

> 
> Is there a PHP command to round up to the nearest integer?

www.php.net/ceil
www.php.net/round

HTH

M@

-- 
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] Regular expressions

2001-04-20 Thread Matt Williams

Hi

I have the script below which encases every occurance of span in a 
tag

The problem is I don't want it to replace any occurance of span that is
inside a tag.
how could I acheive this?
I'm using perl regular expressions to keep the original case of the string.
So, how could I replace occurances of span that aren't in a tag?

Many thanks

M@ ' my regular expressions book is in the post
#



span, span the span";
echo $string.NL;
$search = array("span");
echo "Count = ".count($search).NL;
for($i=0;$i < count($search); $i++)
{
$result =$string;
if(next($search) == false)
{
reset($search);
}
$bgstring = current($search);
$result = preg_replace("/($bgstring+)/ie", "'\\1'", 
$result);

}
echo $result;
?>



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




RE: [PHP] how do I find out which checkbox is checked when form get submit

2001-04-18 Thread Matt Williams

Hi Jacky

In it's simpliest form try this
###






##



>
> Hi all,
> Extremely desparate here as I still cannot get my problem sought
> out, so decided
> to post my question again.
> Allow me to repeat my question again:
> I have a form with the checkbox like this
> 
>  $query="select id from foo";
> $result=($query,$con);
> while ($row = mysql_fetch_array($result))
>  {
> print("");
>  }
> submit button and stuffs here...
> ?>
> 



>
> After I tried check on few checkboxes and submit to next page, at
> next page, how do I check which check box is
> checked so that I can get value of the checked one to process to
> next step?
> I did try isset() and empty() to check if variable exist ( as shown below)
> and did not work as the result always turn up to be "off"
>
>if((empty($id))=='true'){
> echo "off";
>  }else{
>echo "on";
>}
>
> And I also try
> if(isset($id))
> {
>   ..do echo off here...
> }else{
>   ...do echo on
> }
>
> And the result is always "off" as well.
>
> Somene advice me to use $http_var_gets btu I could not find it
> from manaual,
> is that the solution I need?
> cheers
>
> Jack
> [EMAIL PROTECTED]
> "There is nothing more rewarding than reaching the goal you set
> for yourself"
>


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




RE: [PHP] highlighting search results (revisited)

2001-04-18 Thread Matt Williams

Hi James

I'll paste the code I use..

$string = search string entered in the text box.
#
// REPLACE SPACES FOR MULTIWORD SEARCH
$string = str_replace(" ","%",$string);

$db->query("SELECT title,description FROM files WHERE (title LIKE
'%$string%') || (description LIKE '%$string%')");
// SPLIT THE SEARCH INTO PARTS FOR HIGHLIGHTING
$bg = explode("%",$string);
while($db->next_record())
{
$title = $db->f("title");
$des = $db->f("description");
for($z=0; $z <  count($bg); $z++)
{
// reset the array if it's at the end
if(next($bg) == false)
{
reset($bg);
}
$bgstring = current($bg);
$title = preg_replace("/($bgstring+)/ie", "'\\1'", $title);
$des = preg_replace ("/($bgstring+)/ie", "'\\1'", $des);
}
echo $title.NL;
echo $des.NL.NL;

}

###

The above code works as expectedexcept if I search for span and say
class;

now this will highlight span in the search string found from the database
but on the second run ie. hightlighting class, it will re-highlight the
  in the span tags from the original pass.

Do you get what I mean??


preg_replace is used to keep the original case of the results as it's a case
insensitive search

I need to be able to replace only result that aren't enclosed in a class tag

Cheers

M@


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




RE: [PHP] checkbox validation

2001-04-18 Thread Matt Williams


> After I submit to next page, at next page, how do I check which 
> check box is checked?
> like this?
> 
> if ($id=="on") {
> do something
> }else{
> do something
> }

Hi 

try this assuming you have no toher check boxes called $id

if(isset($id))
{
  do something
}else{
  do other
}

M@

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




FW: RE: [PHP] highlighting search results (revisited)

2001-04-18 Thread Matt Williams


> The input from the search form is $searchtext.  The Returned
> Search data is
> $searchdata.
>
> 
> $sql = "SELECT searchdata FROM table WHERE searchdata LIKE
> '%$searchtext'";
> $result = @mysql_query($sql, $connection)
> or die (mysql_error());
>
> $num = mysql_num_rows($result);
>
> $x = 0;
>
> if ($num == 0) {
> echo "No results";
> } else {
>
> while($row = mysql_fetch_array($result)) {
> $searchdata = $row['searchdata'];
>
> $x++;
>
> $searchdata = eregi_replace("$searchtext", " color=\"#FF\">$searchtext", $searchdata);
>
> echo "$x. $searchdata";
>
> }
>
> }
>
> ?>
>
> Make sense?  And does it help?

Hi James

Yes and no.

I've got it to do that but what if the user enters more than one word?
I need to be able to loop inside the while for each word to be able to
highlight it. I think!
The problem is if someone enters a word which is used within the
hightlighting code. ie. font in your example.
This would then hightlight this again and screw the resulting code.

M@


-- 
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] highlighting search results (revisited)

2001-04-17 Thread Matt Williams

I am trying to write a little search script to search a mysql db.

I would like to highlight the search words for the displayed results, like
sourceforge etc...

After a little help, I have got it to hightlight when searching for one
word. The problem is if I do a search for more than one word it repeats the
hightlighting.

here's the code I got so far

$bg = explode("%",$string);
while($db->next_record())
{
$title = $db->f("title");
$des = $db->f("description");
for($z=0; $z <  count($bg); $z++)
{
if(next($bg) == false)
{
reset($bg);
}
$bgstring = current($bg);
$title = preg_replace("/($bgstring+)/ie", "'\\1'", $title);
$des = preg_replace ("/($bgstring+)/ie", "'\\1'", $des);
}
echo $title.NL;
echo $des.NL.NL;

}
The problem is is I search for class or span it screws up the code as it
replaces the span or class in the original tag.

How could I stop this?
I know this another rex ex thing and I'm gonna get the oreilly book when I'm
next in the city but untill then it's driving me bonkers.

TIA

M@


-- 
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] search highlighting

2001-04-12 Thread Matt Williams

Hi

I'm implementing a simple keyword search.
I want the results to be displayed with the keywords highlighted.
I am currently using this to highlight the keywords

str_replace($string,"$string",$field);

If I search for php, it will find PHP, PhP etc... but using the above only
php will will be highlighted, not PHP.
I've tried eregi_replace but I could only get that to change the case and
highlight that ie. PHP would become php.

Can anyone point me in the direction of how to highlight the string
regardless of case but keep the case for the match.

TIA

M@


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




RE: [PHP] Are calling COM applications a trojan?

2001-04-12 Thread Matt Williams


> Honestly, I still don't get you.
>
> How can the client's Word not open if the script didn't make it open with
> COM.
?

Anyway,

The only way PHP can make Word open on a clients machine is if a word
document is sent to the client, or the clients browser believes that is
receiving a word document.

You may be able to open word and insert text client side by using activex or
vbscript but PHP is server side and cannot spawn Word on a clients machine
using COM.

You would have to use COM server side to create the document the send it to
the browser
NB. This requires word to be installed server side.

M@


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




RE: [PHP] mail function????

2001-04-12 Thread Matt Williams



> Hi,
> I have PHP 4.0 with IIS on Win2K and I think compiled
> everything right.
> I'm not sure how this works on Win32, but on unix it's fine. It's
> the mail()
> function.
> ex. mail("[EMAIL PROTECTED]","My Subject","My Test");
> and it returns: Warning: Server Error in C:\PHP/index.php on line 4

Hi

Firstly, you need to add your smtp server in php.ini under the [mail
function] heading
ie.

SMTP= smtp.mydomain.com

and secondly your connection to this needs to be open.

I've had php report errors before depending on whether the mail server likes
\r or \n or neither.

But if you're just sending the one liner like above this obviously rules
that out.

HTH

M@


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




RE: [PHP] inlude_path not in php.ini

2001-04-06 Thread Matt Williams


> I tried
> php_value include_path ".:./foo"
> php_value include_path=".:./foo"
> php_value include_path .:./foo
> php_value include_path=.:./foo
> php_flag include_path .:./foo  # but flag is not right 
> according to the
> documentation 
> 
> nothing :-(
> 
> It seems I must change al my includes to relative pathnames (../../php)
> 

It maybe you are not allowed to change the stuff in .htaccess.
I think rights for this are assigned in httpd.conf.

HTH

M@

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




RE: [PHP] inlude_path not in php.ini

2001-04-05 Thread Matt Williams


> > How do I set the php-iclude path if I have not acess to php.ini?
> >
> > I know in .htacess but al I try ends in an Internal Server Error
> > I use php4.0.4pl1
> 

php_value include_path "/path1:/path2"

HTH

M@

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




RE: [PHP] [ANSWER] problem uploading big (50MB) file

2001-03-30 Thread Matt Williams

> > Try replacing "100M" with it's byte equivalent.  Or maybe it's
> > kilobytes.  One on of my systems they had "2M" and it wouldn't upload
> > anything cause it didn't parse it right.
> > In other words, set that value to what you had with say php4.0.1
> > good luck!
>
>   replaced 100M by 104857600,
>   and it WORKED !
>

Further on from this, how do I work out the given byte value for a size in
M??

TIA

M@


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




RE: [PHP] Session Varables with PHP3

2001-03-29 Thread Matt Williams

See http://phplib.netuse.de

regarding sessions in php3

HTH 

M@

> -Original Message-
> From: Sean Weissensee [mailto:[EMAIL PROTECTED]]
> Sent: 29 March 2001 11:38
> To: [EMAIL PROTECTED]
> Subject: [PHP] Session Varables with PHP3
> 
> 
> How can I create Session Varables, the docs I have read only 
> provide funtions
> for PHP4.
> 
> 
> Sean Weissensee
> 
> Ion Solutions.
> 

-- 
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] removing $HTTP_POST_VARS

2001-03-28 Thread Matt Williams

Hi

Is there a way I can remove all the values of $HTTP_POST_VARS?

I'm trying to check where a form has been posted from and if it's not the
right plac I want to remove all the post vars so they can't any damage.

I've tried unset($HTTP_POST_VARS) but it doesn't seem to do anything.

TIA

M@


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




RE: [PHP] Spacing between $row["City"],$row["State"]

2001-03-27 Thread Matt Williams


> Is there a way to get spacing between
> $row["City"],$row["State"] in the html output?
> I've tried echo "$row["City"], nbsp; $row["State"]";
> and a bunch of other things and get Parse error: parse
> error, expecting `STRING' or `NUM_STRING' or `'$'' . 

Try

echo $row["City"]." ".$row["State"];


M@

-- 
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] string->integer

2001-03-23 Thread Matt Williams

Hi

I am trying to validate a form to check the user has entered there date of
birth correctly
There are three fields day, month & year.

how can I check whether a string is a number?

I have tried using is_long(), is_int(), is_integer() to check the values
,but it doesn't seem to be working.

the code I have tried is

if(!is_int($dobd))
{
  print "error";
}
else
{
  //carry on
}

could someone help me as to where I'm going wrong

TIA

M@


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




RE: [PHP] Response.Write [OK]

2001-03-21 Thread Matt Williams


> 
> I have built a shopping cart and have made connection to an Internet 
> payment company.  Now once transaction is processed they want from my 
> confirmation page to receive an "[OK]".  How can I do this with php3/4?
> 
> Response.Write"[OK]" is what ASP uses, I think???

try 

echo "alert('OK')";

I think this is the same thing

M@

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




RE: [PHP] site root variable (for Generic Unix and Windows)

2001-03-19 Thread Matt Williams


> Agreed - use absolute paths - but DONT include the protocol://server
Sorry, I didn't mean it to sound like I meant include the above

M@

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




RE: [PHP] site root variable (for Generic Unix and Windows)

2001-03-19 Thread Matt Williams


you could make your links absolute
ie..

/cat.html

so if you're in http://green/admin/admin.html

you would link to

http://green/cats.html

HTH

M@
> I am developing a PHP site under windows which is going to be deployed
> eventually on Unix (indeed when life gets less hectic will also
> be developed
> under Unix but that's another story).
>
> Anyway the header.html (included at top of every page) has links in it.
> However depending where the page is which is including
> header.html the links
> (from a relative point of view) will be different.  For example for the
> index.php (which is in site root) the catalogue page is simply referred to
> as cat.html but from admin.html (which is in the admin directory
> under site
> root) ../cat.html would be required.
>
> A way to get round this problem seems to be to have a variable
> with the site
> root in it (i.e. $siteroot = "c:/pages/") however this is causing
> me a real
> headache.  using
>
>   echo "Catalogue
>
> renders href to c:/pages/cat.php but then the browser tries to
> download the
> page as a file.  I have also tried
>
> $siteroot = "http://green/
>
> (green being the domain) but this douse not work either.
>
> I would really like the solution to this to be platform independent.
>
> Ta in Advance,
> ben
> --
> [EMAIL PROTECTED] (ben@work until end March)
> [EMAIL PROTECTED] (ben@home)
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


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




RE: [PHP] Can you recommend an ISP with the following?

2001-03-19 Thread Matt Williams


> *PHP4
> *MySQL
> *Telnet access
> *Decent Support
> *Preferably a Cobalt server (or one with a VERY good Web-based
> administrator, most other types of Web administrators I've seen have
> been clunky and a PITA)
> *Pretty Cheap

www.blueboxwebhosting.com

especially good for support

M@

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




RE: [PHP] Website, Design, hosting and maintenance for only $999.00 per year

2001-03-16 Thread Matt Williams


> [EMAIL PROTECTED] wrote:

too bad they can't even spell their own email address

M@

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




RE: [PHP] URL / address

2001-03-15 Thread Matt Williams


> Does anyone know how I can read the address of URL the user filled in in
> his/her browser???

I presume you mean when asking for page on your server.

$REQUEST_URI

see. 

http://uk.php.net/manual/en/language.variables.predefined.php

for more details and others

M@

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




RE: [PHP] switch with multiple case

2001-03-14 Thread Matt Williams

switch($something)
{
  case "this":
do this;
break;
  case "those":
  case "them":
do other;
break;
  case "crap":
  case "doesn't matter":
  case "whatever":
do nothing;
break;
  default:
print error;
}

> 
> <%
>   select case something
>   case "this" do that
>   case "those","them" do other
>   case "crap","doesn't matter","whatever" do nothing
>   case else print error
>   end select
> %>
> 
> 
> IN PHP you can't do cases like that, because like in C, u must have a 
> constant, not a list of them.
> Is there anyway to get pass this? Doing a case for each thing 
> even tough it 
> does the exact same thing as 10 others is going to get a little 
> stupid code.
> 
> . Christian Dechery (lemming)
> . http://www.tanamesa.com.br
> . Gaita-L Owner / Web Developer
> 
> 
> -- 
> 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] PHPLib & Phorum

2001-03-12 Thread Matt Williams

Hi

Does anyone know if anyone has built phorum or any other BB with PHPLib
authentication??

I was wondering if I could save myself a lot of time..

TIA

M@


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




RE: [PHP] MySQL problem - stumped

2001-03-10 Thread Matt Williams

> > >The following code is giving an me problems, I can't figure it
> > out to save
> > >my soul.  The last line gives:
> > >
> > >Here is the code:
> > >
> > >$link = db_connect();
> > >$query = "UPDATE Users SET firstname='$firstname', lastname='$lastname'
> > >WHERE username='$user' && password='$password'";
> > >$result = mysql_query($query, $link);
> > >$err = mysql_error();
> > >echo "Errors:".$err;
> > >$rows = mysql_affected_rows($result);
> > >
> > >And here is the output:
> > >Errors:
> > >Warning: Supplied argument is not a valid MySQL-Link resource in
> > >//*//**..***/db.php on line 147

Hi

OK my thoughts, no disrespect intended.

Is the table Users and not users? Are all the column names correct and are
they really in this tables??

also try
$result = mysql_query($query, $link) or die ($mysql_error())

to see what output mysql is giving as to why the query failed.

As I say no disrespect but you need to go back and try to unsderstand why it
is failing

M@


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




RE: [PHP] Getting form name

2001-02-28 Thread Matt Williams

Thanks Simon.

You would have though as it there they would make it part of the form.

thanks again.

M@

-- 
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] Getting form name

2001-02-28 Thread Matt Williams

Hi

Is there a way I can get the name of the form that has been posted?

Looking at the form vars I don't see a name var or such in there.

TIA

M@

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




RE: [PHP] array headaches

2001-02-22 Thread Matt Williams



> Why do you need to put the values in an array, then read through the
> array to print the values? Why not just print each record as you get it
> from the DB?

The array is formed before the page is called. This is then passed to the
page which prints it out.

M@

> On Thu, 22 Feb 2001 02:11, Matt Williams wrote:
> > I have done it this way...
> >
> > $menu = array();
> > $count = $db->num_rows();
> > for($i = 0; $db->next_record(); $i++)
> > {
> > $menu[$i]["name"] = $db->f("name");
> > $menu[$i]["url"] = $db->f("topic_id");
> > }
> >
> > OK, so is there a better way of acheiving the same end result?
> > and this is what I've got to print the results
> >
> > while ( list($name, $subarray) = each($menu) )
> >
> >
> > echo " > href=\"".$subarray["url"]."\">".$subarray["name"]."\n";
> >
> > }
> >
> > is there any better way of doing this??
> >
> > thanks
> >
> > M@
>

>
> --
> David Robley| WEBMASTER & Mail List Admin
> RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
> AusEinet| http://auseinet.flinders.edu.au/
> Flinders University, ADELAIDE, SOUTH AUSTRALIA
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


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




RE: [PHP] array headaches

2001-02-21 Thread Matt Williams

I have done it this way...

$menu = array();
$count = $db->num_rows();
for($i = 0; $db->next_record(); $i++)
{
$menu[$i]["name"] = $db->f("name");
$menu[$i]["url"] = $db->f("topic_id");
}

OK, so is there a better way of acheiving the same end result?
and this is what I've got to print the results

while ( list($name, $subarray) = each($menu) )


echo "".$subarray["name"]."\n";

}

is there any better way of doing this??

thanks

M@

> -Original Message-
> From: Pavel Kalian [mailto:[EMAIL PROTECTED]]
> Sent: 21 February 2001 15:00
> To: Matt Williams; [EMAIL PROTECTED]; PHP_UK@egroups. com
> Subject: Re: [PHP] array headaches
>
>
> a) $menu[] = array("name" => $db->f("name"), "url" => $db->f("topic_id"));
>
> b) echo $menu[0]["name"]; //for example - depends on what you want to do
>
> BTW have a look into the manual, the array stuff is described pretty well
>
> Pavel
>
> - Original Message -
> From: "Matt Williams" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>; "PHP_UK@egroups. com"
> <[EMAIL PROTECTED]>
> Sent: Wednesday, February 21, 2001 3:56 PM
> Subject: [PHP] array headaches
>
>
> > Hi
> >
> > could anybody please help me get my head around the following.
> >
> > I get some url information from the database (title, url)
> > I am trying to then put this into an array so I can pass it to
> the page to
> > display a menu.
> > so
> > a) how do I get the data into the array. would this be the way
> to do it??
> >
> > $menu = array();
> > while($db->next_record())
> > {
> > $menu[]["name"] = $db->f("name");
> > $menu[]["url"] = $db->f("topic_id");
> > }
> > which leads me onto
> > b) how do I get the data back out. I can't test to see if the
> above works
> as
> > I can't get at the data
> >
> > TIA
> >
> > M@
> >
> >
> > --
> > 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 General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] array headaches

2001-02-21 Thread Matt Williams


> a) $menu[] = array("name" => $db->f("name"), "url" => $db->f("topic_id"));
>
> b) echo $menu[0]["name"]; //for example - depends on what you want to do

Thanks, maybe I should have made myself a little clearer though

I am expecting more than one row to be returned from the db.

So how would I get the all the rows returned into an associative array??
The manual tells you how how it should, but I need to do it from
mysql_fetch_array

M@
>
> BTW have a look into the manual, the array stuff is described pretty well
>
> Pavel
>
> - Original Message -
> From: "Matt Williams" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>; "PHP_UK@egroups. com"
> <[EMAIL PROTECTED]>
> Sent: Wednesday, February 21, 2001 3:56 PM
> Subject: [PHP] array headaches
>
>
> > Hi
> >
> > could anybody please help me get my head around the following.
> >
> > I get some url information from the database (title, url)
> > I am trying to then put this into an array so I can pass it to
> the page to
> > display a menu.
> > so
> > a) how do I get the data into the array. would this be the way
> to do it??
> >
> > $menu = array();
> > while($db->next_record())
> > {
> > $menu[]["name"] = $db->f("name");
> > $menu[]["url"] = $db->f("topic_id");
> > }
> > which leads me onto
> > b) how do I get the data back out. I can't test to see if the
> above works
> as
> > I can't get at the data
> >
> > TIA
> >
> > M@
> >
> >
> > --
> > 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] array headaches

2001-02-21 Thread Matt Williams

Hi

could anybody please help me get my head around the following.

I get some url information from the database (title, url)
I am trying to then put this into an array so I can pass it to the page to
display a menu.
so
a) how do I get the data into the array. would this be the way to do it??

$menu = array();
while($db->next_record())
{
$menu[]["name"] = $db->f("name");
$menu[]["url"] = $db->f("topic_id");
}
which leads me onto
b) how do I get the data back out. I can't test to see if the above works as
I can't get at the data

TIA

M@


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




RE: [PHP] undefined functions question

2001-02-16 Thread Matt Williams


>
> This has been an ongoing problem, when I include a file which contains a
> call to a function I get undefined function errors but when I try
> to include
> the file containing the function I get cannot redeclare function error
> messages, I can't win how do I make sure my functions are available to any
> script whether included or whatever.
>
is the function declared before file is included?
I'm not sure but this may cause a problem.

As for getting the redeclare error, are you sure the function is not
declared in the page or any other file that is included.

Sorry if this seems a little obvious..

Regards

M@


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




RE: [PHP] Where is my directory on server..?

2001-02-16 Thread Matt Williams

> 
> Is there a php function to find out the path to my
> directory..or is there any other way..?

Have a look here

http://www.php.net/manual/en/language.variables.predefined.php

$PATH_TRANSLATED

I think gives you the full path to your script. If not one of these will

M@

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




RE: [PHP] Installation on win32

2001-02-14 Thread Matt Williams

You will also need to add this for the module

LoadModule php4_module "c:/php/sapi/php4apache.dll"


M@
> -Original Message-
> From: Maxim Maletsky [mailto:[EMAIL PROTECTED]]
> Sent: 14 February 2001 08:02
> To: 'Sean Kennedy'; PHP Mailing List
> Subject: RE: [PHP] Installation on win32
>
>
> add this into your httpd.conf file:
>
> ## PHP 4.0.3pl1 
> AddType application/x-httpd-php .php .phtml .php3 .html .inc
> AddType application/x-httpd-php-source .phps
> 
>
> Cheers,
> Maxim Maletsky
>
>
>
> -Original Message-
> From: Sean Kennedy [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 14, 2001 4:32 PM
> To: PHP Mailing List
> Subject: [PHP] Installation on win32
>
>
> Ok, I am trying to install php4 on a win32 system as a module for
> apache.  I
> have followed all the instructions for both apache and php.  Now, when I
> load up a page, it is blank, and when I view the source, I see my
> php file.
> For example...
>
>  /*index.php*/
> echo ('Hello');
> ?>
>
> Now, when I load this in my browser, I see this as the source, but nothing
> displays on the page.  Anybody recognize this?  Can anybody point
> me in the
> right direction?
>
> Thank you in advance.
>
> Sean Kennedy
>
>
> --
> 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 General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] shows up in IE but not Netscape

2001-02-09 Thread Matt Williams


> 
>  
>
> 
>

No 
>
>Welcome back to the ColoradoPTAC website,  $row['company']; ?>.
> Please click  target="_top">here to
> complete the login process and begin using the site.
> 
> 
> 
> 
> 

HTH M@

-- 
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] Apache Directory Browsing OT

2001-02-02 Thread Matt Williams

Hi

Could someone please tell me how I can disable Directory Browsing with
Apache

I've been trawling the apache docs all afternoon with no success

TIA

M@


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




RE: [PHP] Parse error

2001-01-23 Thread Matt Williams

Which line is producing the error??
M@

> -Original Message-
> From: Liam Gibbs [mailto:[EMAIL PROTECTED]]
> Sent: 23 January 2001 17:32
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Parse error
> 
> 
> Should probably put the whole thing.
> 
> Why does this produce a parse error (I know that include 
> statements do weird
> things to if structures):
> 
> if($username != "") {
> 
> 
> 
> } else {
> include("file.php3");
> }
> 
> 
> -- 
> 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] Getting warning using split

2001-01-23 Thread Matt Williams

Hi

I'm trying to split a string into an array but keep getting the following
message:

Warning: unexpected regex error (13) in z:/www_root/staff.php on line 34

The code is just

$query_string = split("+",$search);

where $search is from a form.

Any clues??

TIA

M@


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




RE: [PHP] url hide

2001-01-22 Thread Matt Williams







http://www.foo.co.uk">



your browser does not support frames - click http://www.oozoo.co.uk">here to go to http://www.blah.co.uk">http://www.blah.co.uk





> -Original Message-
> From: Jørg V. Bryne [mailto:[EMAIL PROTECTED]]
> Sent: 22 January 2001 10:40
> To: AJDIN BRANDIC; [EMAIL PROTECTED]
> Subject: Re: [PHP] url hide
>
>
> I saw this done with a frameset recently. The domain blah.com had
> a frameset
> which opened the real page (at www.hotel.com/blahblah ) in a frame.
>
> -J
> - Original Message -
> From: "AJDIN BRANDIC" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, January 22, 2001 11:30 AM
> Subject: [PHP] url hide
>
>
> > Perhaps not related to php but I was wandering, is it possible to hide
> > site's real url and replace it with something else (some other
> URL).  ie.
> > someone clicks on a link on www.blah.co.uk which takes the user to an
> > designated area (ie. /house-search/) on www.foo.co.uk.  I want
> > the user still to see www.blah.co.uk. This is just for aesthetic reasons
> > since ones the user finishes the search for houses (on
> > www.foo.co.uk/house-search/) he/she will return to www.blah.co.uk.
> >
> > I have tried www.javascripts.com but no success??
> >
> > Thanks
> >
> > Ajdin
> >
> > --
> > 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 General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] how do i hide my .inc files in apache??

2001-01-18 Thread Matt Williams


> My vote is still just for include files to have a standard (already
> accepted) extension.

I think you may be missing the point on this one.
The question wasn't what to name included files but how to stop apache
parsing or showing the contents of the include files.

The obvious solution of course is to have the included files outside the web
tree.

M@


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




RE: [PHP] how do i hide my .inc files in apache??

2001-01-17 Thread Matt Williams


Order allow,deny
Deny from all


in either your httpd.conf or a .htaccess file will deny users access to your
*.inc files

M@

> -Original Message-
> From: Jon Haworth [mailto:[EMAIL PROTECTED]]
> Sent: 17 January 2001 13:01
> To: 'Jamie Burns'
> Cc: '[EMAIL PROTECTED]'
> Subject: RE: [PHP] how do i hide my .inc files in apache??
>
>
> I take it you're talking about normal html .inc files, and not the PHP
> include() function? If so, this is well off-list, try the
> comp.infosystems.www.servers heirarchy for this sort of thing.
>
> But...
>
> You can't, AFAIK. The whole *point* of an include file is that the entire
> contents of that file are included in whatever document you call it from.
> You use them for holding repetitive information that you don't
> want to type
> out for every page, such as a footer, eg:
>
> This page is copyright blah blah blah
> mailto:[EMAIL PROTECTED]">E-mail the webmaster
>
> would be a candidate for a .inc file.
>
> If I have completely missed the point, please forgive me.
>
>
> Cheers
> Jon
>
>
> -Original Message-
> From: Jamie Burns [mailto:[EMAIL PROTECTED]]
> Sent: 17 January 2001 12:48
> To: [EMAIL PROTECTED]
> Subject: [PHP] how do i hide my .inc files in apache??
>
>
> hi..
>
> can anyone tell me how i get apache to never send out the contents of my
> include files (*.inc) to users?
>
> i dont want my source sode to be visible to browsers.
>
> thanks,
>
> jamie.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


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




RE: [PHP] File Uploading Security - Urgent please

2001-01-11 Thread Matt Williams


if(ereg("jpg|jpeg|gif$",$userfile_name))
{
do something
}
else
{
this file is not allowed
}
This will check that the uploaded file has the correct extension.

Where $userfile is the upload field name in the form

M@
> -Original Message-
> From: Statbat [mailto:[EMAIL PROTECTED]]
> Sent: 11 January 2001 11:00
> To: PHP-General
> Subject: [PHP] File Uploading Security - Urgent please
> 
> 
> Hello,
> 
> I am doing file uploading of only jpg file format, It first copys 
> in tmp directory then I copy it in main well you all know the 
> procedure... neways what I am concerned is how can I check that 
> the file in temp is correct file and is safe for me to copy it in 
> the main folder?
> 
> Regards
> Statbat
> 

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




  1   2   >