[PHP] solution

2002-06-23 Thread Austin Marshall
I figured it out, not what i'd wanted it to be, but it works, if anyone can improve upon it, please let me know. $value) { if ($key==$original) { $bar[$replacement]=$replacement_value; } else $bar[$key]=$value; } return $bar; } $foo=array("col

[PHP] Re: UPDATE mysql

2002-06-22 Thread Austin Marshall
Phil Schwarzmann wrote: > I can't get UPDATE to work properly when querying MySQL. > > $query = "UPDATE $table SET field1='$var1' WHERE id='$id'"; > > I want to update one field of one row in a table. Is this syntax > correct? > yes -- PHP General Mailing List (http://www.php.net/) To unsu

[PHP] Re: Current date & time in MySQL datetime format

2002-06-22 Thread Austin Marshall
Phil Schwarzmann wrote: > I want to produce the current date & time in a MySQL datetime format > that I can then put into a MySQL database. > > How do I do this? I've tried mktime() and getdate() but it's not > working. > > Thanks!! > If you want to do it with mysql (i.e. insert the current t

[PHP] Re: checkboxes

2002-06-22 Thread Austin Marshall
M.E. Suliman wrote: > Hi > > I know this might be a bit easy for all you experts out there. I have > multiple checkboxes and text areas in a form. In the confirmation email > sent to the user I manage to get the text areas to display in the email. > How would I get the results of the checkboxe

[PHP] Re: Function needed

2002-06-09 Thread Austin Marshall
Gaylen Fraley wrote: > I am in need of a function/script that will take a directory and search all > filenames, recursively down, for a given file. Can anyone point me to a > source? Thanks. > > > $result=`grep -r 'expression' ./`; -- PHP General Mailing List (http://www.php.net/) To unsu

[PHP] Re: Generate every possible combination

2002-05-15 Thread Austin Marshall
Austin Marshall wrote: > Evan Nemerson wrote: > >> I need to generate every possible combination of the the values in an >> array. For example, if... >> >> $array = Array("A", "B", "C"); >> >> I want to be able to do someth

[PHP] Re: Generate every possible combination

2002-05-15 Thread Austin Marshall
Evan Nemerson wrote: > I need to generate every possible combination of the the values in an array. > For example, if... > > $array = Array("A", "B", "C"); > > I want to be able to do something like > > print_r(magic_function($array)); > > which would output > > Array > ( > [0] => "ABC

[PHP] Re: byte order of integers

2002-05-15 Thread Austin Marshall
decbin() will convert an integer to it's corresponding binary representation of 32 bits. Divide that into 4 groups and you have it separated into bytes. John Horton wrote: > Hi! > Is there any way of decomposing an integer into it's constituent bytes so > that a new byte order can be created?

[PHP] Re: How can obtain referer's name?

2002-05-12 Thread Austin Marshall
Alex Shi wrote: > Hi! > > I want to know how can a script obtain the page name where > it was linked. e.g., there's a link on page.html, and the link > points to script.php, how can script.php know the name of > page.html? Thanks in advance for all answer! > > Alex $_SERVER["HTTP_REFERER"]

[PHP] Re: forever cookie

2002-05-12 Thread Austin Marshall
Larry Linthicum wrote: > is it possible to set a cookie that never expires? > > Not really, but be realistic. If you want a cookie that lasts longer than what seems reasonable give it a lifetime of a year or longer. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: h

[PHP] Re: Yahoo/Cobalt servers/PHP

2002-05-11 Thread Austin Marshall
Todd Cary wrote: > One of my clients signed up for service at Yahoo for space on a Cobalt server. > The specs say that it has Php and Interbase. I go to the server and do a > phpinfo() and find out that Interbase is not compiled into PHP but MySQL is. > Then I find out that MySQL is *not* install

[PHP] Re: an sql_layer

2002-05-11 Thread Austin Marshall
Http://Www.Promoozz.Org wrote: > i'm sweating on this one : > > function sql_fetch_row($res, $nr) > { > global $dbtype; > switch ($dbtype) { > > case "MySQL": > $row

[PHP] Re: Newbie question to everybody....PHP

2002-05-11 Thread Austin Marshall
R wrote: > Greetings people, > Special greetings to all of you who have helped me in the past. > > As most of you know i am a newbie, I learned a bit of PHP via webmonkey and > a few other places, seeing the power of PHP i decided to convert from Java > servlets and JSP (JSP coz its expensive to

[PHP] Re: Any difference between these 2 forms of syntax?

2002-05-10 Thread Austin Marshall
Richard Davey wrote: > "Austin Marshall" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > >>It all depends on what you use as a key... you just follow the normal >>string standards. If you want a variable evalua

[PHP] Re: Any difference between these 2 forms of syntax?

2002-05-10 Thread Austin Marshall
Richard Davey wrote: > Hi, > > I am wondering if there is any tangible difference between the following two > commands: > > $x = $foo["status"]; > $x = $foo['status']; > > The part in question being the use of ' or " around the "status" element of > the array $foo. > Both have the same end resu

[PHP] Re: MySQL or FlatFile

2002-05-10 Thread Austin Marshall
David Duong wrote: > To store large values (100k+) and load them as much as 6+ times within the > same hour what would be better MySql or Flatfile? > > I think it really depends on the content. If you are storing 100K+ per entry it sounds like it is probably something along the lines of an i

[PHP] Re: Layout Help

2002-05-10 Thread Austin Marshall
Jason Soza wrote: > Hey all... I really do want to thank everyone for all the help and > advice you give. I know my questions sometimes are probably more > annoying than anything else, but your input really does help. > > Anyway, I have a stack of 76 playlists I need to consolidate and > displ

Re: [PHP] Re: Alternating Table Rows, Part Deux..

2002-05-10 Thread Austin Marshall
Miguel Cruz wrote: > On Fri, 10 May 2002, Austin Marshall wrote: > >>>This not only takes care of the table row colors, but also removes >>>duplicate company names so it looks MUCH neater this way : >> >>Is there not a GROUP BY clause in MS SQL? I'

[PHP] Re: Alternating Table Rows, Part Deux..

2002-05-10 Thread Austin Marshall
Glenn Sieb wrote: > Hey everyone! > > Thanks for all the hints--here's what my boss and I eventually came out > with: > > /* ## > ## And for every row of data we pull, we create a table row... > ## */ > $company = 0; >

[PHP] Re: Debugger

2002-05-10 Thread Austin Marshall
Jose Leon wrote: >>php -l will let you know where your syntax errors are. > > > What? > > Regards > If you invoke the interpreter from the command line (CGI). You can use the -l flag to enable lint mode... that will check your script for parse errors. So in a way, PHP does have a "debug"

[PHP] Re: Debugger

2002-05-10 Thread Austin Marshall
Jose Leon wrote: > Hello: > I have been browsing the web for a good solution to debug php code, I > have found several ones, but none of them meet my requeriments. I > create a development tool for PHP (QaDRAM Studio) and I want to be able > to debug php code with it, my question here is: >

[PHP] Re: Alternating table rows...

2002-05-10 Thread Austin Marshall
Glenn Sieb wrote: > Hi everyone, > > I have a PHP script that reads data from an MS SQL server and outputs > the data into a table. I've been asked if I can alternate the colors of > the rows to make the report more legible. The relevant piece of code > looks like: > > for ($i = 0; $i < mssql

[PHP] Re: parsing HTML text

2002-05-07 Thread Austin Marshall
Lee Doolan wrote: > > I have written form screen which has as one of it's elements a > box in which a user can input some text --like a simple > bio-- which will appear on another screen. I'd like to edit check > this text. It would be a good idea to make sure that it has, among other > things,

[PHP] Re: newbie needs help with array-checking

2002-05-07 Thread Austin Marshall
Moritz Helten wrote: > Hello, > > I have a problem with checking an array if it is empty: > > if ($artikel[$i] != ""){ > ... > } > > That code does not work! > > May somebody help me? > > thanx, > Moritz > > take a look at the manual... there is a empty() function that checks for this ver

[PHP] Re: how to generate a date between 1998 and today by random?

2002-05-07 Thread Austin Marshall
Try making use of a timestamp via the strtotime. You'll have to do the math, but you can generate a random number with the range being the number of seconds in the date range and then adding the remaining offset. Then convert the timestamp back to a date with everyones favorite date() functi

[PHP] Re: Registering an Array in a Session

2002-05-07 Thread Austin Marshall
Alexis Antonakis wrote: > Hi, > > I am trying to register an array in a session, but am having no luck. > > > What I have is a form with set fields on which is processed a certain number > of times. > > > Upon submitting the form each time, I run the following: > > session_register("fieldtex

Re: [PHP] file_exists

2002-05-06 Thread Austin Marshall
Craig Westerman wrote: > I found my problem. Try fopen() if it fails it will return false, otherwise it will return an integer file pointer. You get use it to fetch files via http://, https://, ftp://, and more. > > From manual: > "file_exists() will not work on remote files; the file to be e

[PHP] Re: file_exists

2002-05-06 Thread Austin Marshall
Craig Westerman wrote: > What am I doing wrong? I get parse error between first echo statement and > else. > > Thanks > > Craig ><> > [EMAIL PROTECTED] > > > $fn = "image.gif"; > if (!file_exists($fn)) { > echo ""; > else > echo ""; > } > ?> > You've got your semicolons in the wrong spots.

[PHP] Re: Alternate To Making Form Variables Global (Clerified)

2002-05-06 Thread Austin Marshall
Dr. Shim wrote: > Sorry, I'll have to clerify myself a bit. I'm rather tired. :) > > I have a script that verifys and inserts (into and Access databse) form > values. I had to make the form variables "global", in order to use them in > my functions. Since the new PHP is out, the script doesn't wo

[PHP] Re: Sorting, sort of

2002-05-06 Thread Austin Marshall
Jason Soza wrote: > I have a 'name' field in a MySQL table that contains people's first and > last names, i.e. "John Smith" - but some people may choose not to > include their last name, so they're just "John" in the table, or they > may choose to include themselves and someone else, but not th

Re: [PHP] Re: Making a Client-side HTTPS Request

2002-05-06 Thread Austin Marshall
can I download binaries to my directory & > execute it from there using PHP? or, does the executable have to > run with special permissions? > > >>-Original Message- >>From: Austin Marshall [mailto:[EMAIL PROTECTED]] >>Sent: Monday, May 06, 2002 1:35 PM >

Re: [PHP] Re: Making a Client-side HTTPS Request

2002-05-06 Thread Austin Marshall
> experience, web & otherwise). > > Where can I learn more about what "installed and available from > the command line" means? > > >>-Original Message- >>From: Austin Marshall [mailto:[EMAIL PROTECTED]] >>Sent: Monday, May 06, 2002 1:1

[PHP] Re: Making a Client-side HTTPS Request

2002-05-06 Thread Austin Marshall
Jonathan Rosenberg wrote: > I would like to be able to make a client side HTTPS request from > one of my pages. From searching around, I see that I can do > everything I want using the CURL library. But the ISP I am using > does not have the CURL library installed. > > I'll ask them if they'll

[PHP] Re: sum

2002-05-06 Thread Austin Marshall
Mike Fifield wrote: > I am using the mysql sum() function to return the "sum" of a bunch of dolor > amounts stored "float" values. But what I get back it something like this > "98.18855591" it is to precise. All I want is the dolor amounts added up > and rounded up to the closest penny. Is th

[PHP] Re: pass. vars. betn. javascript and php

2002-05-06 Thread Austin Marshall
Pushkar Pradhan wrote: > Is it possible to pass variables from a php page to a page using > javascript, and vice versa, > I've the variable - an array passed in the url of the page. > > -Pushkar S. Pradhan > Yes and no. You can pass variables to a php script with the normal HTTP POST ang GET m

[PHP] Re: mail function

2002-05-05 Thread Austin Marshall
Diana Castillo wrote: Diana Castillo wrote: > Hi, if I use the mail function, as in : > mail("[EMAIL PROTECTED]", "My Subject", "Line 1\nLine 2\nLine 3"); > The mail comes from "Webserver" How can I change the from ? > > > > Just as the manual says, the 4th parameter which is optional allows

[PHP] Re: help!!!

2002-05-05 Thread Austin Marshall
J. H. wrote: > Can anyone here help me write a simple auto shop > scheduling program? Would really appreciate it if you > would help me out. > > Jane H. > > __ > Do You Yahoo!? > Yahoo! Health - your guide to health and wellness > http://health.y

[PHP] Re: Php Sessions

2002-05-05 Thread Austin Marshall
Daniel SvanbäCk wrote: > Hi > > I have a problem. I can't send the session_id to the next page. It worked > before (when I had an old version of php, now I have 4.2.0). It can send the > session_id() if it's a link, but not a header(). If it is a header I have to > do this: > > define('MYSID', s

Re: [PHP] global variables

2002-05-05 Thread Austin Marshall
Jule wrote: > Hey, > i'm just wondering if there is another way to write global variables to a > global.php, now i just the whole fopen etc script, where i open a file and > write the sctring $number_right = [whatever number it is] to the file, but is > there a different way to write it to the

[PHP] Re: Best BBS

2002-04-30 Thread Austin Marshall
R wrote: > Hey all, > > This email is not for any questions/suggestions etc but a thank you note. > Some time back i posted an email asking if anyone had any recomendation for > a BBS system and I got a lot of replies. > I thank each and every one of you who wrote in, > after checking out the lin

Re: [PHP] PHP 4.2.0 on win2k, can't use mysql_fetch_* functions

2002-04-29 Thread Austin Marshall
1lt John W. Holmes wrote: > Did you turn on Display_errors in php.ini? > > ---John Holmes... Of Course, i think i even had it at the highest alert level. No errors whatsoever, ... or die(mysql_error()) yields nothing either. > > - Original Message - > From: "Austin W. Marshall" <[EM