Hi all how are yas?
I have one question for which I could not find the answer:
How do I remove an element of an array with a specific key or index?
To be clearer:
Lets say I have an array $shoppingCart[] (quite a lot of them)
I want to delete $shoppingCart[345] (whi
[snip]
PHP is a scripting language I am pretty much
aware of that... But is there a way to translate
php into binary/machine code or would one
have to write a translator program?
[/snip]
PHP has an underlying binary translator, but I don't think that the source
code is available from Zend. Are y
thx
"Jason Wong" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Thursday 18 July 2002 19:32, JJ Harrison wrote:
> > if I do this:
> >
> > if(validate($_POST['password'], $_POST['username']) != 0)
> > echo validate($_POST['password'], $_POST['username']);
> >
PHP is a scripting language I am pretty much
aware of that... But is there a way to translate
php into binary/machine code or would one
have to write a translator program?
Kondwani...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Firstly, many thanks to Richard and Dan...
>>A quick test script in PHP would have been faster than asking... :-)<<
It was just one of those questions that I had burning in my mind at the time, and
since I don't have access to PHP at work (As if the Government would allow that!), I
had to ask
hello everybody,
I have a real problem, and a vague description to it (can you guess?: newbie).
I've created a site which retrieves a word from a database and displays it.
The user enters another word (a translation) which is checked against the
solution and feedback is given. These words are pa
In article <[EMAIL PROTECTED]>, php-
[EMAIL PROTECTED] says...
> On Friday 19 July 2002 14:08, David Robley wrote:
>
> > You might consider running the first query just to get a COUNT(), rather
> > than extracting all the resulting rows and using mysql_numrows to
> > determine how many were retur
On Thursday 18 July 2002 19:32, JJ Harrison wrote:
> if I do this:
>
> if(validate($_POST['password'], $_POST['username']) != 0)
> echo validate($_POST['password'], $_POST['username']);
>
> will it execute the function twice or use the same result twice?
Function executes twice.
> would it be (s
if I do this:
if(validate($_POST['password'], $_POST['username']) != 0)
echo validate($_POST['password'], $_POST['username']);
will it execute the function twice or use the same result twice?
would it be (slightly) faster to do this:
$uid = validate($_POST['password'], $_POST['username'])
if($
1) you use whats called an "Itterative Server Model". That is to say you
create an list of all the sockets you are using and pass them to
"socket_select" (http://www.php.net/manual/en/function.socket-select.php)
and it will tell you which ones are ready to be read from, which can be
written to and
Peter a écrit :
> If you removed the
> ErrorDocument 404 /phpinfo.php
> from the apache conf (or reset it to original value), what happens? Do you
> get a standard 404 not found error page?
Sure. But it's an apache problem, it drops the body as soon as you do
have a 404 error. Sux :p
--
Eh.. probably should be:
$result = mysql_query("SELECT id FROM ma_users WHERE
user='$PHP_AUTH_USER'");
$row=mysql_fetch_row($result)
print $row['id'];
René
René Moonen wrote:
> Well if you *know* your query only returns one row or you are just
> interessed in the first row, just forget about
Well if you *know* your query only returns one row or you are just
interessed in the first row, just forget about the while construction
$result = mysql_query("SELECT id FROM ma_users WHERE user='$PHP_AUTH_USER'");
$id=mysql_fetch_row($result)
print $id;
Good luck
René
John Wulff wrote:
>Di
Johan Holst Nielsen wrote:
>> > //DATEFORMAT MMDD
>> if($dir=@opendir("/yourdirwithpdf")) {
>> echo "Found following files:"
>> while(($file=readdir($dir))!==false) {
>> if(ereg("^[a-zA-Z0-9]+\.$INPUTDATE\.pdf")) {
>> echo ''.$file.'<\n>';
>> }
>> }
>> }
>> ?>
>
>
> UPS
> From: René Moonen [mailto:[EMAIL PROTECTED]]
> Sent: Friday, July 19, 2002 11:01 AM
> $result = mysql_query("SELECT COUNT(DISTINCT IP) AS ips FROM ma_counter");
You _might_ need to add "GROUP BY ip" (without quotes) to the end of that
query.
> Disclaimer: code not tested. You might want to
> //DATEFORMAT MMDD
> if($dir=@opendir("/yourdirwithpdf")) {
> echo "Found following files:"
> while(($file=readdir($dir))!==false) {
> if(ereg("^[a-zA-Z0-9]+\.$INPUTDATE\.pdf")) {
> echo ''.$file.'<\n>';
> }
> }
> }
> ?>
UPS
if(ereg("^[a-zA-Z0-9]+\.$INPUTDATE\.pdf", $fi
Jack wrote:
> Dear all
> I had a folder which contains a lot of pdf file, the name format of the pdf
> files are : x.dateformat.pdf (eg : abcdefg.20020718.pdf).
> Now i want to use the php script to detect what files it got in a specific
> folder.
> i want to make a user input form which wil
I'd use something like:
to retrieve dir listing. If you make a function from it, which you'll give a
path for argument you can make the script index an entire dir struct. With
is_file() you can check to see if the dirlist entry is a file.
Then, you can split every filename in different parts
Dear all
I had a folder which contains a lot of pdf file, the name format of the pdf
files are : x.dateformat.pdf (eg : abcdefg.20020718.pdf).
Now i want to use the php script to detect what files it got in a specific
folder.
i want to make a user input form which will let user to input the da
hmm... seems a MySQL topic.
I suppose that your table is filled with correct data at some other
point. So what you need is a count query that returns
*one* result and not all records in that table. You do not want a
*while* loop in your PHP script, because that would show a list of
unique ips. S
Hello,
can you tell me what i have to do to generate more than one pdf document
with pdflib. At the moment i am not able to do this. the only thing i can do
is actually to make one pdf.
It is really important for me to bring more sites in one document. the
problem is not solved if i just make mo
> $mode = "entrance";
> if ($mode == "entrance") {
>
I suppose you added the first line ($mode = "entrance"; ) for testing
purposes during debugging, but in order for the script to work you
should now remove it, because now $mode will always have th
> From: Justin French [mailto:[EMAIL PROTECTED]]
> Sent: Friday, July 19, 2002 7:39 AM
> To: php
> Subject: [PHP] best way to delete char# 4-7 from a string?
>
>
> Hi,
>
> Let's say I have the following string:
>
> $str = 'abcdefghijklmnop';
>
> ...and I want to strip out char #'s 4 through t
En réponse à Mantas Kriauciunas <[EMAIL PROTECTED]>:
Hi
You use = instead of ==
So, the first condition is always true
Regards
Julien
> Hello John,
>
> Friday, July 19, 2002, 12:25:12 AM, you wrote:
>
> JW> Any ideas on why this won't work? It will only
> include("inc/entrance.php")
> JW> It n
On Friday 19 July 2002 14:08, David Robley wrote:
> You might consider running the first query just to get a COUNT(), rather
> than extracting all the resulting rows and using mysql_numrows to
> determine how many were returned
Am I missing something? If you do a COUNT() in the query then, in ge
On Friday 19 July 2002 15:43, Peter wrote:
> You can try this.
>
>
> $datafile = file("..."); // Here comes your filename
>
> for ($k=0; $k<=count($datafile)-1; $k++) {
>
> echo "$datafile[$k]"; // Display each line read from datafile
>
> }
>
> ?>
foreach ($datafile as $line) {
echo "$li
I think more info is probably needed here. Is it always the literal string
"line3" that you want to catch, or always the second last line?
Some kind of regular expression solution is probably what you need.
Michael
On Fri, 19 Jul 2002, Peter wrote:
> You can try this.
>
>
> $datafile = fi
Is there a way to get and store the name of a referenced variable into
another variable? Example...
$varname = "blah";
checkit($varname);
function checkit(&$name) {
...code...
}
In the function above, I'd like to find out the name of the referenced
variable (pointed to by $name) which shoul
You can try this.
"; // Display each line read from datafile
}
?>
"Yamin Prabudy" <[EMAIL PROTECTED]> schreef in bericht
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I got a file line like this
>
>
> This is a line1
> this is a line2
> this is a line3
> this is a line4
>
>
>
>
> how can i
I've just downloaded a bunch of stuff from www.gingerall.org, which I hope
will set up Sablotron on my RH7.2/Apache1.3.24/PHP4.2.1 box.
Can I just use the rpms?:
sablotron-0.95-1.i386.rpm
sablotron-devel-0.95-1.i386.rpm
There is also a "Sablot-0.95-PHP.patch" in there, plus a
Sablot-0.95.tar.g
Hello Rasmus,
Friday, July 19, 2002, 12:26:45 AM, you wrote:
RL> You need == instead of = there
RL> On Fri, 19 Jul 2002, John Wulff wrote:
>> Any ideas on why this won't work? It will only include("inc/entrance.php")
>> It never, no matter what the value of $mode, displays collection.php.
>>
You probably do not have a background of C / C++ programming ;-)
assignments:single equal sign
comparison:dual equal sign
The *assignments* in your if statements are always TRUE, so it will
always execute the statements after the first *if*
So use
if ($mode == "entrance") {
and
Well, first thing I see is that you need to change this:
if ($mode == "entrance")
You need the double equal signs for string comparison.
> From: [EMAIL PROTECTED] (John Wulff)
> Newsgroups: php.general
> Date: Fri, 19 Jul 2002 00:25:12 -0700
> To: [EMAIL PROTECTED]
> Subject: Why won't th
You need == instead of = there
On Fri, 19 Jul 2002, John Wulff wrote:
> Any ideas on why this won't work? It will only include("inc/entrance.php")
> It never, no matter what the value of $mode, displays collection.php.
>
>$mode = "entrance";
>if ($mode = "entrance") {
> include(
Hello John,
Friday, July 19, 2002, 12:25:12 AM, you wrote:
JW> Any ideas on why this won't work? It will only include("inc/entrance.php")
JW> It never, no matter what the value of $mode, displays collection.php.
thinking logicaly:
JW>$mode = "entrance"; $mode is "entrance"
JW>
Any ideas on why this won't work? It will only include("inc/entrance.php")
It never, no matter what the value of $mode, displays collection.php.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
36 matches
Mail list logo