Re: [PHP] in_array()/finding page Problem

2003-10-23 Thread Marek Kilimajer
You solution is quite resource expensive. I would do: [find $maxpages] SELECT COUNT(*)/12 FROM table WHERE id <= $real_id; list($maxpages) = fetch_row() In result.php use "ORDER BY id" Ben G. McCullough wrote: I think I have a flaw of logic in trying to find the correct page in a mutli-page sql

Re: [PHP] fsock sending bad request

2003-10-23 Thread Curt Zirzow
* Thus wrote [EMAIL PROTECTED] ([EMAIL PROTECTED]): > Hi there the following code doesnt seem to work, i am getting a bad request > sent back from the server, what could be the problem of something so > simple ? > > $header .= "POST test.php HTTP/1.0\r\n"; > $header.= "Host: host\r\n"; > $header .

[PHP] in_array()/finding page Problem

2003-10-23 Thread Ben G. McCullough
I think I have a flaw of logic in trying to find the correct page in a mutli-page sql result. Goal - find the correct page [results.php?page=x] when linking from another page. Current method - loop through a pagination function looking for the matching $id in an array [simplified for illustrat

Re: [PHP] array of java-objects

2003-10-23 Thread Raditha Dissanayake
Hi, please post your full code Helke Schröder wrote: Hi, I'm trying to use our java-code in php. But strange things happens Maybe I did a simple mistake.. $MyInf=new Java("myUtil.myInfo"); This is inside of a loop through 3 items: $MyAttributes=array(); $MyAttributes=$MyInf->MyAttrReader($v

Re: [PHP] problem with intval and !=

2003-10-23 Thread Marek Kilimajer
What versio of php? I get Bad (which is good ;) Cesar Cordovez wrote: Can somebody explain me why is this happening? $value = "12.3"; $number = intval($value); echo "Number: $number, Value: $value"; // echoes: Number: 12, Value: 12.3 if ($number != $value) { echo "Bad"; } else { echo "Go

Re: [PHP] problem with intval and !=

2003-10-23 Thread Curt Zirzow
* Thus wrote Cesar Cordovez ([EMAIL PROTECTED]): > Can somebody explain me why is this happening? > > $value = "12.3"; > $number = intval($value); > > echo "Number: $number, Value: $value"; > // echoes: Number: 12, Value: 12.3 I'm guessing you wondering why the .3 is removed. Thats because 12.3

Re[2]: [PHP] fsock sending bad request

2003-10-23 Thread Tom Rogers
Hi, Thursday, October 23, 2003, 10:32:18 PM, you wrote: deo> $req = "&field=1"; deo> its the data i need to post But you are sending it twice, and there has to be a cr/lf between the header and the data I think. -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscrib

Re: [PHP] Array Hell

2003-10-23 Thread Curt Zirzow
* Thus wrote Richard Cook ([EMAIL PROTECTED]): > Hi All, > Im having a headache trying to sort this out... > > If the customer inputs the value 0 into quantity the array looks like this: > > $array[0][0] = 22 > $array[0][1] = 0 > > > The question is who can i filter the array removing a

[PHP] problem with intval and !=

2003-10-23 Thread Cesar Cordovez
Can somebody explain me why is this happening? $value = "12.3"; $number = intval($value); echo "Number: $number, Value: $value"; // echoes: Number: 12, Value: 12.3 if ($number != $value) { echo "Bad"; } else { echo "Good"; // echoes Good!! } The previous should be echoing "Bad

[PHP] Re: link question

2003-10-23 Thread Richard Cook
nextpage.php?recordset= then use the value of recordset to link back to that information on the next page. Is that what you mean? Regards R "Davy Campano" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] I have a php page that makes a table from data in a mySQL database. What I

Re: [PHP] is_uploaded_file() security

2003-10-23 Thread Raditha Dissanayake
hi, I think marek's recent message has answered this already, but i also believe that even in the older system where you have form fields like result in global variables like userfile_name etc the global variables don't get populated unless you send the correct enctype. best regards Alexand

[PHP] array of java-objects

2003-10-23 Thread Helke Schröder
Hi, I'm trying to use our java-code in php. But strange things happens Maybe I did a simple mistake.. $MyInf=new Java("myUtil.myInfo"); This is inside of a loop through 3 items: $MyAttributes=array(); $MyAttributes=$MyInf->MyAttrReader($v, "","", $item); $c=null; $c=count($MyAttributes); s

Re: [PHP] Opening Files via PHP

2003-10-23 Thread Curt Zirzow
* Thus wrote Stephen Tiano ([EMAIL PROTECTED]): > > A file to read and write to has been provided on the book's CD. I've > copied this file, named "oders.txt", in a folder (directory) on my hard > drive, the path which runs like so: > >[hard drive name]/Library/WebServer/Documents/orders/or

[PHP] Array Hell

2003-10-23 Thread Richard Cook
Hi All, Im having a headache trying to sort this out... I have my array which is created each time a user adds an item to my basket, this all works fine. The problem im having is that when the user adds the item to the cart they have the option of selecting '0' as the quantity which in effect

Re: [PHP] Attachments with Mail()

2003-10-23 Thread Evan Nemerson
PEAR has a class which may be helpful. http://pear.php.net/package/Mail_Mime On Thursday 23 October 2003 04:13 am, Don Mc Nair wrote: > Hi > > Can anyone tell me how to add a file as an attachment to an email sent with > something like the following ? > > $headers = "From: <".$fromaddress.">\

Re: [PHP] is_uploaded_file() security

2003-10-23 Thread Alexander Mueller
Raditha Dissanayake wrote: > > Hi, > Multipart/form-data sends the entire file, if you don't use that enctype > yes, just the file name is sent. > > best regards I see, but then $_FILES is probably not set. So it wouldnt be necessary to use is_uploaded_file() if one solely uses $_FILES (but shou

Re: [PHP] Newbie - Can't get sessions to work

2003-10-23 Thread Curt Zirzow
* Thus wrote Shaun Campbell ([EMAIL PROTECTED]): > That's it. Setting use_trans_sid to 1 got sessions working. I'm now getting > PHPSESSID=7398a182a64f0b2603e369812e130727 appended to the end of the > page2.php URL and only one session file in my temp directory. > > One final question. In the php

Re: [PHP] is_uploaded_file() security

2003-10-23 Thread Marek Kilimajer
I tried: Fake: $_FILES superglobal still wasn't poisoned. Alexander Mueller wrote: Raditha Dissanayake wrote: This does not work with multipart/form-data you need www-urlencoded (or just don't set an enctype attribute in your form) What would happen in this case? The given filename would

Re: [PHP] is_uploaded_file() security

2003-10-23 Thread Raditha Dissanayake
Hi, Multipart/form-data sends the entire file, if you don't use that enctype yes, just the file name is sent. best regards Alexander Mueller wrote: Raditha Dissanayake wrote: This does not work with multipart/form-data you need www-urlencoded (or just don't set an enctype attribute in your f

[PHP] Re: Page Reload with after POST request

2003-10-23 Thread Alexander Mueller
Robert Sedlacek wrote: > > I don't know such a script, but my preferred way would be to make a > 'header("Location: $site");' statement right after processing the > POST-request and lead the user to the site where the changes can be seen. > > This also avoids duplicate db-entries and stuff... >

Re: [PHP] is_uploaded_file() security

2003-10-23 Thread Alexander Mueller
Raditha Dissanayake wrote: > > This does not work with multipart/form-data you need www-urlencoded (or > just don't set an enctype attribute in your form) What would happen in this case? The given filename would be passed to the script?! Alexander -- PINO - The free Chatsystem! Available at htt

Re: [PHP] fsock sending bad request

2003-10-23 Thread Raditha Dissanayake
hi, deo> $header.= "$req\n"; Tom is right but as usual IIS is wrong and expects it :-( so better to use it anyway. deo> $fp = fsockopen("host", "80", $errno, $errstr, $timeout = 30); errno and errstr will not be set unless you pass it by reference. deo> $header.= "Host: host\r\n"; Host header

Re: [PHP] is_uploaded_file() security

2003-10-23 Thread Raditha Dissanayake
I don't think so. Test this, but I think you can just type /etc/passwd into the file name box (instead of using the "browse" button) and have that value submitted in the form. May be dependent upon the browser on how it's handled, though. This does not work with multipart/form-data you need www

[PHP] Attachments with Mail()

2003-10-23 Thread Don Mc Nair
Hi Can anyone tell me how to add a file as an attachment to an email sent with something like the following ? $headers = "From: <".$fromaddress.">\r\n"; $headers .= "Reply-To: <$fromaddress>\r\n"; mail($toaddress, $subject, $mailcontent, $headers); Thanks Don --- Outgoing mail is certifie

Re: [PHP] Email Body

2003-10-23 Thread Marek Kilimajer
I use str_pad() for this, it can handle strings that vary in length much better then tabs: tab way: echo "long long name\t1000\t200.00\n"; echo "name\t10\t2.00\n"; output: long long name 1000200.00 name10 2.00 str_pad way: echo str_pad('long long name', 20,' '). str_pad('1000',

Re: [PHP] Page Reload with after POST request

2003-10-23 Thread Marek Kilimajer
After handling the post request and taking the necessery actions (update db...), redirect the browser using header('Location: ..'); Alexander Mueller wrote: I am doing most of my data transfers by POST requests and found it to be problematic when I want to browse the history with the browser

Re: note: [PHP] ob_get_length() returns uncompressed buffer length (after ob_start('ob_gzhandler'))

2003-10-23 Thread Marek Kilimajer
I forgot the obvious: echo $output; after header(...) Marek Kilimajer wrote: One option I can think of would be to handle the compression in your code: print "aa"; // 30 a's print "bb"; // 30 b's print "aa"; //

[PHP] Page Reload with after POST request

2003-10-23 Thread Alexander Mueller
I am doing most of my data transfers by POST requests and found it to be problematic when I want to browse the history with the browser's navigation buttons. Although it works without problems in Opera (I didnt try it with Netscape) it leads to a "Warning: Page has Expired" message in IE. I unders

Re: note: [PHP] ob_get_length() returns uncompressed buffer length (after ob_start('ob_gzhandler'))

2003-10-23 Thread Marek Kilimajer
One option I can think of would be to handle the compression in your code: print "aa"; // 30 a's print "bb"; // 30 b's print "aa"; // 30 a's $output=gzcompress(ob_get_contents()); $ob_get_length=length($output); h

Re: [PHP] fsock sending bad request

2003-10-23 Thread daniel
$req = "&field=1"; its the data i need to post > Hi, > > Thursday, October 23, 2003, 7:58:19 AM, you wrote: > deo> Hi there the following code doesnt seem to work, i am getting a > bad request deo> sent back from the server, what could be the problem > of something so deo> simple ? > > deo> $heade

Re: [PHP] Problem with SELECT statement and reference material wanted..

2003-10-23 Thread Eugene Lee
On Thu, Oct 23, 2003 at 01:57:38PM +0200, P M wrote: : : I'm having trouble retrieving a selection of my database contents. The : problem is when I search for entries that exactly match a search : criteria, see below: : : (database connection established successfully here..) : : $result = mysq

Re: [PHP] Problem with SELECT statement and reference material wanted..

2003-10-23 Thread Binay
Sorry for my previous post .. no need of removing ' '(single quotes) echo you query and then run it on mysql and see u getting the desired result.. Binay - Original Message - From: "P M" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, October 23, 2003 5:27 PM Subject: [PHP] Pr

Re: [PHP] Problem with SELECT statement and reference material wanted..

2003-10-23 Thread Marek Kilimajer
$authorf is empty, I guess register_globals is off, you should use "select * from complete where authorf = '$_POST[authorf]'" or "select * from complete where authorf = '$_GET[authorf]'" depending if you use get or post variable. P M wrote: Hi all! I'm having trouble retrieving a selection of my

Re: [PHP] Problem with SELECT statement and reference material wanted..

2003-10-23 Thread Binay
remove ' '(single quotes) around variable name.. cheers binay - Original Message - From: "P M" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, October 23, 2003 5:27 PM Subject: [PHP] Problem with SELECT statement and reference material wanted.. Hi all! I'm having trouble ret

[PHP] Problem with SELECT statement and reference material wanted..

2003-10-23 Thread P M
Hi all! I'm having trouble retrieving a selection of my database contents. The problem is when I search for entries that exactly match a search criteria, see below: (database connection established successfully here..) $result = mysql_query("select * from complete where authorf = '$authorf'")

Re: [PHP] PHP scripts are not executed

2003-10-23 Thread Bas
You can now try it again, on http://212.120.120.108:3/forumBT/index.php. I have installed as module now... "Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > favicon.ico is not the problem. The problem is "The specified network > name is no longer available". Check

[PHP] Is it worth $49? - codeSECURE 1.0 released - - Protecting PHP code

2003-10-23 Thread aka MacGuru
Hi, I have read announcement about CodeSecure. I am sorry to say, but I am not sure this product is worth $49. The problem is not $49, which is very small amount indeed, but the features available with other Open Source software. 1) If someone need just PHP obfuscator - here is proven GPL prod

Re: [PHP] Newbie - Can't get sessions to work

2003-10-23 Thread Shaun Campbell
That's it. Setting use_trans_sid to 1 got sessions working. I'm now getting PHPSESSID=7398a182a64f0b2603e369812e130727 appended to the end of the page2.php URL and only one session file in my temp directory. One final question. In the php.ini file it says that "Use of trans sid may risk your use

Re: [PHP] Screwing up my results...please help

2003-10-23 Thread Marek Kilimajer
Wait, I think I got you. You want company with the best offer listed first toghether with the company's other offers - and these offers should be ignored in the next comparation. So now should be listed another company with second best offer - without using the offers from the first company. Is

Re: [PHP] Create Popup Window using PHP

2003-10-23 Thread Marek Kilimajer
I use something like:

function myconfirm(str, href) {
if(!confirm(str)) {
return false;
} else {
document.location.href=href + "&confirm=1";
}
}

In delete.php check for $_GET['confirm'], if set, delete, if not,

Re: [PHP] Newbie - Can't get sessions to work

If you want to check for cookie add echo "cookie = ".$_COOKIE[session_name()]; to the second page. To check if transparent sessions are enabled look into phpinfo() output -> session.use_trans_sid Shaun Campbell wrote: I've tried the suggested code changes and no difference :( I just don't thi

Re: [PHP] Newbie - Can't get sessions to work

I've tried the suggested code changes and no difference :( I just don't think sessions are working for me at all. I said in my original posting that the second page was creating an empty file in my session.save_path directory as though the second page has no reference to the first one. In my sav

Re: [PHP] Create Popup Window using PHP

Impossible, PHP is server side, look into javascript of some other client side language to create pop-up windows. - Original Message - From: <[EMAIL PROTECTED]> To: "php" <[EMAIL PROTECTED]> Sent: Thursday, October 23, 2003 3:00 AM Subject: [PHP] Create Popup Window using PHP > > > Hi a

[PHP] Re: Create Popup Window using PHP

need a little bit of "Javascript" Here's a cut and paste from one of my projects
function confirmEdit()
{
var f = document.frmEdit;
if(confirm('Are you sure you want to save the changes. This operation CANNOT BE REVERSED'))
{
f.submit();
}



[PHP] Create Popup Window using PHP

2003-10-23 Thread irinchiang
Hi all, I have a "Delete" function here whereby when I click on "Delete" it will actually have some kinda "popup" window to prompt user whether they are sure to delete the following data.So, anyone have any idea how to create this popup window using PHP?? Appreciate very much fo

[PHP] Re: Simple array question

2003-10-23 Thread pete M
$array = array( 'fruit1' => 'apple', 'fruit2' => 'orange', 'fruit3' => 'grape', 'fruit4' => 'apple', 'fruit5' => 'apple'); // this cycle echoes all associative array // key where value equals "apple" while ($fruit_name = current($array)) { if ($fruit_name == 'apple') {

Re: [PHP] Opening Files via PHP

2003-10-23 Thread Marek Kilimajer
Stephen Tiano wrote: And the code the book uses to write to this file is: // open file for appending $fp = fopen("$DOCUMENT_ROOT/../orders/orders.txt", 'a'); This is what is in the book, you need to change the path to suit your setup. Or move the file, it seems moving ./orders/ directory

Re: [PHP] setlocale Q

2003-10-23 Thread Christophe Chisogne
jsWalter wrote: setlocale(LC_TIME, "de_GR"); gives me 'October'? setlocale(LC_TIME, "de"); gives me 'October'? setlocale(LC_TIME, "d"); gives me 'oktober'? I'm on a Win 2k box. Because locales are really system dependant, as you could clearly see using gettext translations. (I did fight wi

[PHP] Opening Files via PHP

2003-10-23 Thread Stephen Tiano
Anyone familiar with PHP AND MYSQL WEB DEVELOPMENT, 2nd edition, by Luke Welling and Laura Thomson? And perhaps working on the Macintosh-UNIX side of things via OS X.whatever? If so, I ask for your indulgence and assistance. Following advice given me a coupla weeks ago--on this very list, I be

Re: [PHP] Exporting Data to Excel

2003-10-23 Thread Marek Kilimajer
Damn exploder, use session_cache_limiter('private_no_expire'); before session_start() Ben C. wrote: I am using the code below to export my data into an excel file. The code is located in a password protected area which is checked against saved session variables. However when I put session_start

<    1   2