RE: [PHP-DB] Call an Image from local Harddisk thru PHP file in Remote Host.

2002-12-09 Thread Beau Lebens
This won't work, because the HOST needs to be able to access the files on
your machine, which is a gross security risk, and isn't possible in this
manner.

The only way I can think of that you would be able to do anything useful
like that would be to have an HTML page load an image using

img src=C:\images\map.gif

or somthing like that, but you wouldn't be able to modify that image using
PHP (tho you could use DIVs or something to overlay other details perhaps?)

HTH

beau

// -Original Message-
// From: dufronte [mailto:[EMAIL PROTECTED]]
// Sent: Tuesday, 10 December 2002 2:51 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Call an Image from local Harddisk thru PHP file in
// Remote Host.
// 
// 
// 
// Hello again,
// 
// I have another few question.
// Actually, it's a little bit ridiculous so don't laugh at me :D
// 
// I want to make a webgame with php., there.. I want to 
// put an Image
// Locally in order to Increase the speed. What I'm going to do 
// is put my
// Image in my Local Harddisk...(I'm using Windows), and I put 
// my PHP file
// in my Host (such as Host.sk or something).
// 
// So... I wanna call my Image from my Harddisk thru that 
// file... using a
// GD function...
// 
// I've tried this two silly things.. but it doesn't work 
// 
// $map=ImageCreateFromJPEG(c:/myfiles/img/mdmap.jpg);
// and $map=ImageCreateFromJPEG(file:///c|/myfiles/img/mdmap.jpg);
// 
// what should I do then. Please help me...
// 
// --www.kapsul.org--
//   DuFronte
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] Call an Image from local Harddisk thru PHP file in Remote Host.

2002-12-09 Thread Beau Lebens
rather than use a dynamically modified image, you could use floating DIVs to
represent the cities (i.e. float a 10x10 image in a DIV over the background
map).

This way, you would only need the person to load the actual map once (which
would then cache it locally), and each of the city images once as well (so
you could have cooler icons to!)

this will require you to work out some more fancy HTML tho, rather than PHP
code.

// -Original Message-
// From: dufronte [mailto:[EMAIL PROTECTED]]
// Sent: Tuesday, 10 December 2002 3:17 PM
// To: [EMAIL PROTECTED]
// Subject: RE: [PHP-DB] Call an Image from local Harddisk thru 
// PHP file in
// Remote Host.
// 
// 
// But somehow... I'm still curious...
// 
// Please check this link to make clear what I plan to do...
// http://binusti2002.host.sk/sf/start_map.php
// 
// Here, I put my Image in my Host.. It does work... but the Image is so
// big and it slows down the access... so that's why I want to put it
// locally... 
// 
// By the way... all the 'city' symbols on the map is changed 
// automatically
// using mysql when user is success in attacking some 'city' 
// 
// To test the map... you can simply click on one of the 'city' 
// symbols...
// 
// So... what I gonna do to increase the speed ??? 
// 
// --www.kapsul.org--
//   DuFronte
// 
// -Original Message-
// From: Beau Lebens [mailto:[EMAIL PROTECTED]] 
// Sent: Tuesday, December 10, 2002 1:55 PM
// To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED]
// Subject: RE: [PHP-DB] Call an Image from local Harddisk thru 
// PHP file in
// Remote Host.
// 
// This won't work, because the HOST needs to be able to access 
// the files
// on
// your machine, which is a gross security risk, and isn't 
// possible in this
// manner.
// 
// The only way I can think of that you would be able to do 
// anything useful
// like that would be to have an HTML page load an image using
// 
// img src=C:\images\map.gif
// 
// or somthing like that, but you wouldn't be able to modify that image
// using
// PHP (tho you could use DIVs or something to overlay other details
// perhaps?)
// 
// HTH
// 
// beau
// 
// // -Original Message-
// // From: dufronte [mailto:[EMAIL PROTECTED]]
// // Sent: Tuesday, 10 December 2002 2:51 PM
// // To: [EMAIL PROTECTED]
// // Subject: [PHP-DB] Call an Image from local Harddisk thru 
// PHP file in
// // Remote Host.
// // 
// // 
// // 
// // Hello again,
// // 
// // I have another few question.
// // Actually, it's a little bit ridiculous so don't laugh at me :D
// // 
// // I want to make a webgame with php., there.. I want to 
// // put an Image
// // Locally in order to Increase the speed. What I'm going to do 
// // is put my
// // Image in my Local Harddisk...(I'm using Windows), and I put 
// // my PHP file
// // in my Host (such as Host.sk or something).
// // 
// // So... I wanna call my Image from my Harddisk thru that 
// // file... using a
// // GD function...
// // 
// // I've tried this two silly things.. but it doesn't work 
// // 
// // $map=ImageCreateFromJPEG(c:/myfiles/img/mdmap.jpg);
// // and $map=ImageCreateFromJPEG(file:///c|/myfiles/img/mdmap.jpg);
// // 
// // what should I do then. Please help me...
// // 
// // --www.kapsul.org--
// //   DuFronte
// // 
// // 
// // 
// // -- 
// // PHP Database Mailing List (http://www.php.net/)
// // To unsubscribe, visit: http://www.php.net/unsub.php
// // 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] Brand New to PHP

2002-12-08 Thread Beau Lebens
Look at the section in the manual on how to upload files via HTTP (Under the
Features chapter from memory) for working with the images. a couple other
things to think about;

1. some sort of validation on the images to make sure they are images
   (extension/mim-type?)
2. confirm that you can successfully upload/copy the files *before*
inserting
   their names into the DB, otherwise you might end up with false pointers.
3. your output is hard-coded to your local address - not a great idea. set
it
   all up as a local webserver and emulate the environment where it will be
   deployed as closely as possible - it will make your life much easier in
the
   long run.

HTH

Beau


// -Original Message-
// From: John [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 9 December 2002 1:10 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Brand New to PHP
// 
// 
// Hi and thanks in advance,
// 
// I am quite new to php and appreciate the help and patience.  
// I am trying to have a form that allows uploading of user 
// info and accompanying images into MySQL DB.  Text enters 
// fine into the DB but the images will not.  I hope I provided 
// enough info below (didnt want to post much more code for all 
// to sift thru if not necessary)
// 
// 
// 
// ?php
// if ($submit) {
//   // process form
//   $db=mysql_connect(66.220.69.20,***,**);
//   mysql_select_db(sammies models,$db);
//   $sql=INSERT INTO models (first, last, age, email, 
// location, eye, hair, experience, aspirations, mtype, 
// picname1, picname2, picname3, picname4, picname5, picname6, 
// picname7, picname8) 
//   VALUES 
// ('$first','$last','$age','$email','$location','$eye','$hair',
'$experience','$aspirations','$mtype','$picname1','$picname2','$picname3','$
picname4','$// picname5','$picname6','$picname7','$picname8');
//   mysql_query($sql) or die(mysql_error());
//  exec(cp $picname1 c:/sammiwww/pic/$picname1); 
//  exec(cp $picname2 c:/sammiwww/pic/$picname2);
//  exec(cp $picname3 c:/sammiwww/pic/$picname3);
//  exec(cp $picname4 c:/sammiwww/pic/$picname4);
//  exec(cp $picname5 c:/sammiwww/pic/$picname5);
//  exec(cp $picname6 c:/sammiwww/pic/$picname6);
//  exec(cp $picname7 c:/sammiwww/pic/$picname7);
//  exec(cp $picname8 c:/sammiwww/pic/$picname8);
// echo First: $firstbr\n; 
// echo Last: $lastbr\n; 
// echo Age: $agebr\n; 
// echo Email: $emailbr\n; 
// echo Location: $locationbr\n;
// echo Eye color: $eyebr\n;
// echo Hair color: $hairbr\n;
// echo Experience: $experiencebr\n;
// echo Aspirations: $aspirationsbr\n;
// echo Media Type: $mtypebr\n;
// echo Photo 1: $picname1br\n;
// echo img src=c:/sammiwww/pic/$picname1br\n;
// echo Photo 2: $picname2br\n;
// echo img src=c:/sammiwww/pic/$picname2br\n;
// echo Photo 3: $picname3br\n;
// echo img src=c:/sammiwww/pic/$picname3br\n;
// echo Photo 4: $picname4br\n; 
// echo img src=c:/sammiwww/pic/$picname4br\n;
// echo Photo 5: $picname5br\n; 
// echo img src=c:/sammiwww/pic/$picname5br\n;
// echo Photo 6: $picname6br\n;
// echo img src=c:/sammiwww/pic/$picname6br\n;
// echo Photo 7: $picname7br\n;
// echo img src=c:/sammiwww/pic/$picname7br\n;
// echo Photo 8: $picname8br\n;
// echo img src=c:/sammiwww/pic/$picname8br\n;
// echo  bcenterThank you for registering,nbsp; 
// $first /b/centerp;
//  ? 
// 
// 
// ---
// Outgoing mail is certified Virus Free.
// Checked by AVG anti-virus system (http://www.grisoft.com).
// Version: 6.0.427 / Virus Database: 240 - Release Date: 12/7/2002
// 

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




RE: [PHP-DB] calling function on submit instead of going to a new script

2002-12-04 Thread Beau Lebens
long story short - you can't

you can only call a function in javascript or some other client-side
scripting language like that, and you would use the onSubmit= attribute of
the form tag.

by the sounds of what you want to do - i would say you would do something
like;

1. load values from db and display in a form (with a submit button, and
perhaps a hidden field of some sort)
2. make your changes on the form and submit it
3. the form posts BACK TO THE SAME PAGE
4. on that page, you check for either the hidden variable (more reliable),
or the variable for the submit button (which gets created when the user
clicks it)
5. do whatever you want with the changes made (UPDATE?), then display the
form again, now with the new values in it.

HTH

Beau


// -Original Message-
// From: Gavin Amm [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 5 December 2002 1:31 PM
// To: Php-Db (E-mail)
// Subject: [PHP-DB] calling function on submit instead of 
// going to a new
// script
// 
// 
// Hi,
// 
// I'm using some form fields on a page to pick up existing 
// data from a MySQL
// database, make any changes, and update the database when i 
// hit submit.
// I've picked up the data ok, now i want to process the update...
// 
// How do i call a function(?) on the same page rather than use 
// another page
// through action=somescript.php?
// what i'd like to do (in seudo-code) is:
// 
// form action=myfunction()
//   ...
//   input type=submit
// /form
// myfunction(){
//   process update  send user back to homepage
// }
// 
// 
// cheers,
// Gav
// 
// 
// This e-mail and any attachments are intended solely for the 
// named addressee,
// are confidential and may contain legally privileged information. 
// 
// The copying or distribution of them or of any information 
// they contain, by
// anyone other than the addressee, is prohibited. If you 
// received this e-mail
// in error, please notify us immediately by return e-mail or 
// telephone +61 2
// 9413 2944 and destroy the original message. Thank you. 
// 
// As Email is subject to viruses we advise that all Emails and 
// any attachments
// should be scanned by an up to-date Anti Virus programme 
// automatically by
// your system. It is the responsibility of the recipient to 
// ensure that all
// Emails and any attachments are cleared of Viruses before 
// opening. KSG can
// not accept any responsibility for viruses that maybe 
// contained here in.
// Please advise KSG by return Email if you believe any Email 
// sent by our
// system may contain a virus. It should be noted that most Anti Virus
// programmes can not scan encrypted file attachments (example 
// - documents
// saved with a password). Thus extra care should be taken when 
// opening these
// files. 
// 
// Liability limited by the Accountants Scheme, approved under 
// the Professional
// Standards Act 1994 (NSW). 
// 
// 
// 
// Level 4 
// 54 Neridah StreetPO Box 1290 
// CHATSWOOD   NSW   2067   CHATSWOOD   NSW   2057 
// 
// 
// Ph: +61 2 9413 2944  Fax: +61 2 9413 9901
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] Assign a variable with another variables value

2002-12-01 Thread Beau Lebens
// Example:
$foo = BAR;

${'new' . $foo} = some string;
// this should do it i think, in this case creating a var called $newBAR

HTH

Beau

// -Original Message-
// From: Martin Allan Jensen [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 2 December 2002 10:30 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Assign a variable with another variables value
// 
// 
// Hi folks,
// 
// I probably need a little help the next couble of days, but 
// well here is the first question.
// 
// How can i assign a variable with the value of another variable ??
// 
// Example:
// $foo = BAR;
// 
// $newBAR = some string;
// 
// The BAR is supposed to be taken from the value of $foo.
// 
// THANKS A LOT!!!
// 
// Regards,
// Martin Allan Jensen
// 

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




RE: [PHP-DB] implode()

2002-11-25 Thread Beau Lebens
implode accepts an *array* as input, not a string.

you would need to change your $sqlUpdate to be an array, and each statement
look something like;
if($textfield12 != '') { $sqlUpdate[] = textfield12='$textfield12'; }

of course it would probably be easier to just do something like this;
if($image11_name != '') $sqlUpdate .= image11='$image11_name', ;
if($image12_name != '') $sqlUpdate .= image12='$image12_name', ;
...
if($textlink11 != '') $sqlUpdate .= textlink11='$textlink11', ;

$sqlUpdate = substr($sqlUpdate, 0, -2);

(note the commas at the end of each string being concatenated?)

(not tested or anything, but should give you the idea)

HTH

Beau

// -Original Message-
// From: Jef [mailto:[EMAIL PROTECTED]]
// Sent: Tuesday, 26 November 2002 2:52 PM
// To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
// Subject: [PHP-DB] implode()
// 
// 
// I am having difficulty with the implode function. What I am doing is
// building a string for an UPDATE SQL command. At the end of 
// the building
// portion of the code, I want to insert a comma between the 
// various fields
// that will be updated. However, it is not working. Here is a 
// portion of my
// code...thanks, in advance for any assistance received
// 
//   $sqlUpdate = SET ;
//   if($image11_name != '') $sqlUpdate .= image11='$image11_name';
//   if($image12_name != '') $sqlUpdate .= image12='$image12_name';
//   if($textfield11 != '') $sqlUpdate .= textfield11='$textfield11';
//   if($textfield12 != '') $sqlUpdate .= textfield12='$textfield12';
//   if($textlink11 != '') $sqlUpdate .= textlink11='$textlink11';
//   if($textlink12 != '') $sqlUpdate .= textlink12='$textlink12';
// 
//   $update = implode(,, $sqlUpdate);
//   $sql = UPDATE mp  .$sqlUpdate;
// 
// I get a bad parameter message on the line with the call to 
// the Implode
// function.
// 
// 
// 
// Questions? Comments? Suggestions?
// 
// 
// 
// Jef
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] standart variabels melfunction

2002-11-19 Thread Beau Lebens
[php.ini]
register_globals=On

Beau

// -Original Message-
// From: Martin Allan Jensen [mailto:[EMAIL PROTECTED]]
// Sent: Wednesday, 20 November 2002 12:41 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] standart variabels melfunction
// 
// 
// Hi all,
// 
// I have a problem with my settings of Apache and PHP i think..
// 
// When i call for example ($PHP_SELF) instead of 
// ($_SERVER[PHP_SELF]) i get no output, just like when i call the url
// www.servername.tld/test.php?mode=test
// And i want to call the mode like this:
// print($mode);
// I just get a empty string.
// But when i call:
// print($_GET[mode]);
// I get the real output...
// 
// I tried to walk troug the hole php.ini  the httpd.conf 
// file, but nothing came up, so i relly hope that you can help 
// me out here...!
// 
// Sorry if it's a little off topic..
// 
// And THANKS A LOT!!
// 
// Regards
// Martin Allan Jensen
// 

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




RE: [PHP-DB] A Question on Javascript

2002-11-13 Thread Beau Lebens
Not that there is actually a question in there...
 
I assume your question is How do I pass a value from a window which was
opened via JavaScript, back to the window which opened it
 
Short answer: window.opener -- read up in a javascript reference manual
about this object.
 
Longer answer
after reading up on the above, you will find that you can manipulate the
elements on the opener of a window via javascript. This will allow you to
do things like get an email, then drop it back into a form field
(window.opener.formName.formField.value = foundEmailAddress or something
like that)
 
not that this has anything directly to do with PHP or Databases, let alone
both.
 
enjoy, have fun
 
Beau

-Original Message-
From: Shahmat Dahlan [mailto:shahmatd;sains.com.my]
Sent: Thursday, 14 November 2002 2:27 PM
To: PHP DB Mailing List
Subject: [PHP-DB] A Question on Javascript


I have a question on Javascript, if you don't mind. 

Say if I have a main page, whereby I would also have a html form which
contains a button. Let's call it main document. 


When I click on the button it will open a new window, which refers to
another html page. Now, let's call it child document. 
Now on this html page, say, I would like to search for an e-mail address,
and returns the value of the e-mail address from the child document 
to the main document. 


Regards and thanks in advance. 
  
  




RE: [PHP-DB] Warning - newby question -- $_GET

2002-11-06 Thread Beau Lebens
did you try echoing the value of $id after you have assigned it?

you may find it's because you aren't connected to your database or something

and also, i am assuming that you are using a recent install/verison of PHP,
because $_GET wasn't available until the last few releases.


beau

// -Original Message-
// From: Gavin Amm [mailto:gavin;ksg.com.au]
// Sent: Thursday, 7 November 2002 9:55 AM
// To: Php-Db (E-mail)
// Subject: [PHP-DB] Warning - newby question -- $_GET
// 
// 
// Hi,
// 
// I'm trying to call a script with the ?= after the php 
// script name in the
// URL, but can't seem to pick up the variable to use in my script...
// any help would be greatly appreciated :)
// 
// I'm calling the script with this url:
// http://localhost/Data/test/dbconnect2c.php?id=TestPage
// 
// The section of the script i'm using is:
// $id = $_GET['id'];
// $sql=SELECT * FROM content where title=$id;
// $result=mysql_query($sql,$db);
// 
// Error message returned:
// Warning: mysql_fetch_array(): supplied argument is not a 
// valid MySQL result
// resource in...
// 
// 
// Thanks,
// Gav
// 
// 
// This e-mail and any attachments are intended solely for the 
// named addressee,
// are confidential and may contain legally privileged information. 
// 
// The copying or distribution of them or of any information 
// they contain, by
// anyone other than the addressee, is prohibited. If you 
// received this e-mail
// in error, please notify us immediately by return e-mail or 
// telephone +61 2
// 9413 2944 and destroy the original message. Thank you. 
// 
// As Email is subject to viruses we advise that all Emails and 
// any attachments
// should be scanned by an up to-date Anti Virus programme 
// automatically by
// your system. It is the responsibility of the recipient to 
// ensure that all
// Emails and any attachments are cleared of Viruses before 
// opening. KSG can
// not accept any responsibility for viruses that maybe 
// contained here in.
// Please advise KSG by return Email if you believe any Email 
// sent by our
// system may contain a virus. It should be noted that most Anti Virus
// programmes can not scan encrypted file attachments (example 
// - documents
// saved with a password). Thus extra care should be taken when 
// opening these
// files. 
// 
// Liability limited by the Accountants Scheme, approved under 
// the Professional
// Standards Act 1994 (NSW). 
// 
// 
// 
// Level 4 
// 54 Neridah StreetPO Box 1290 
// CHATSWOOD   NSW   2067   CHATSWOOD   NSW   2057 
// 
// 
// Ph: +61 2 9413 2944  Fax: +61 2 9413 9901
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] string

2002-10-31 Thread Beau Lebens
you can do this as a part of your db query

check the string functions available for your rdbms.

mysql would use something like;

SELECT SUBSTRING(monthname(blah), 0, 3) AS monthAbbrev FROM tablename

from memory

HTH

beau

// -Original Message-
// From: John Coder [mailto:jcoder;insightbb.com]
// Sent: Friday, 1 November 2002 9:47 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] string
// 
// 
// I want to list months found in db by the first three letters as in an
// abbrevaition of the months i.e.:
// Jan
// Feb
// Mar
// Apr 
// and so forth 
// I can get the names by monthname(blah) but am stuck on converting
// strings to first three letters Ive been trying explode(,$blah) but
// that doesn't work. I'm at a loss here I can't find the correct string
// function for this. help would be greatly appreciated.
// 
// John Coder
// 
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] exporting to xml

2002-10-29 Thread Beau Lebens
you don't see them because they are interpreted as HTML tags, they are
unknown, so they are ignored.

options;

1. View - Source

2. Encode all  as lt; (HTML version) and it will display it all
   as text, then you can copy-paste it to somewhere else

3. Wrap it all in a pre tag, then follow 2.

4. Output the proper XML declaration at the top of the file so that
   IE treats it like XML, and does it's fancy dynamic-tree style
   presentation.

   ?xml version=1.0?

   ^--- a very basic XML declaration

HTH

Beau

// -Original Message-
// From: Martin Hudec [mailto:corwin;corwin.sk]
// Sent: Wednesday, 30 October 2002 12:00 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] exporting to xml
// 
// 
// Hello,
// 
//   i am creating script which will make select and desc to table and
//   then based on results it will make xml file...all is okay, 
// but on my
//   IE it takes it as xml file (it is okay) BUT on my screen I dont see
//   any of something tags...how can i override that?
// 
//   script is here:
// 
// header(Content-type: text/xml);
// 
// db related stuff...
// 
// $fcount = mysql_num_fields($result);
// 
// print result; //will be table name
// 
// while($row = mysql_fetch_array($result)){
// print row;
// for($i=0; $i$fcount; $i++){
// $tag = mysql_field_name($result,$i);
// print $tag. $row[$i]. /$tag;
// }
// print /row;
// }
// 
// -- 
// Best regards,
//  Martin  mailto:corwin;corwin.sk
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] displaying flash from db

2002-10-21 Thread Beau Lebens
*** APOLOGIES FOR CROSS POSTING ***

I haven't done this directly, but I imagine the process would be similar to
working with images, and the same restrictions/rules of thumb would apply
regarding storing them in the db versus storing them on the filesystem, i.e.
store the flash files in the filesystem (save as an actual file) and then
just save a URL in the db to the location of the file.

then you either just drop that into your HTML to display it, or if the file
is saved outside your DocumentRoot for whatever reason, you would need to
send a header to say that you are about to pipe out some flash content (you
might need to check the mime-type for your files first to get this right),
then use readfile() or similar to read the file and spit out the contents.

HTH

Beau

// -Original Message-
// From: Yonatan Ben-Nes [mailto:da;canaan.co.il]
// Sent: Tuesday, 22 October 2002 4:25 AM
// To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
// Subject: [PHP-DB] displaying flash from db
// 
// 
// Hi all!
// 
// Does anyone know where can i find some information about 
// displaying flash from a db? 
// 
// I'm breaking my head over it, searching at newsgroups, 
// searching at the net, addressing newsgroups but still nothing!
// Help b4 im cutting my hands off!!!
// 
// 
// With hopes to be saved :P
// Yonatan Ben-Nes
// 

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




RE: [PHP-DB] Query error

2002-10-02 Thread Beau Lebens

If it's on MySQL, then the problem is that it doesn't support nested queries
:)

If it's on something else, i'm afraid i don't know :/

Back to MySQL, you can get around that by doing your select author_code
from authorxcat component query, then put the results into 'x', 'y', 'z'
format, then do something like
select author_code from author where author_code not in ($previousResults)

HTH

Beau

// -Original Message-
// From: Wilmar Perez [mailto:[EMAIL PROTECTED]]
// Sent: Wednesday, 2 October 2002 10:54 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Query error
// 
// 
// Hello guys
// 
// Does anybody have a clue on what wrong with the following sentence?
// 
// select author_code from author where author_code not in 
//  (select author_code from authorxcat);
// 
// Thanks
// 
// ***
//  Wilmar Pérez
//  Network Administrator
//Library System
//   Tel: ++57(4)2105145
// University of Antioquia
//Medellín - Colombia
//   2002
// ***  
//   
//  
//  
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB]opening and reading from file

2002-09-22 Thread Beau Lebens

just use

?php
$filename = C:\\Documents and Settings\\roslyn\\My Documents\\note.txt; //
note double-slashes
$contents = join('', file($filename));
echo $contents;
?

should work. your parse error is probably because of the \ in your
filename, you need to escape them with another \.

HTH

Beau

// -Original Message-
// From: roslyn jose [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 23 September 2002 12:54 PM
// To: [EMAIL PROTECTED]
// Subject: RE: [PHP-DB]opening and reading from file
// 
// 
// HI,IVE BEEN TRYING TO PRINT THIS CODE, BUT KEEP GETTING AN 
// ERROR: ?php
// $filename=C:\Documents and Settings\roslyn\My Documents\note.txt
// $fp = fopen (C:\Documents and Settings\roslyn\My 
// Documents\note.txt, r);
// $contents = fread ($fp, filesize ($filename));
// echo $contents;
// fclose ($fp);   
// ?
// THE ERROR I GOT WAS THIS:Parse error: parse error in 
// /var/www/html/learn/frames.php  COULD SOMEONE PLS HELP ME 
// OUT EHRE, I JUST WANT TO PRINT THIS FILE, THATS ALL. 
// THANKSREGARDS ROSLYN
// 
// 
//  
//  John Holmes wrote:Try $_POST['field_1'] instead of $field_1
// 
// ---John Holmes...
// 
//  -Original Message-
//  From: Warren Massengill [mailto:[EMAIL PROTECTED]]
//  Sent: Thursday, September 19, 2002 8:19 PM
//  To: [EMAIL PROTECTED]
//  Subject: [PHP-DB] Form response
//  
//  Hi,
//  
//  RedHat 7.2 RPM with PostgreSQL 7.1.x and PHP 4.0.6
//  
//  Page 111 of PHP and PostgreSQL, this form displays in 
// Mozilla. The
//  submit
//  button is expected to run a script called reaction.php but it opens
// the
//  script and displays the code. The response is the same 
// with or without
//  variable input.
//  
//  I changed the script file to executable: no effect.
//  
//  I can run 'reaction.php' from the shell and it works.
//  What is the problem here?
//  -
//  form
//  -
//  
//  
//  A Simple Form
//  
// 
// 
//  
//   [input] 
// 
// 
//   [input] 
//  
//  
//  
//  
//  -
//  Reaction.php
//  --
//  action.php
//  
//   if ($field_1)
//  {
//  echo field_1: $field_1;
//  }
//  else
//  {
//  echo nothing has been passed to this script;
//  }
//  ?
//  --
//  run as stand alone php file
//  -
//  
//  bash-2.05$ php  reaction.php
//  X-Powered-By: PHP/4.0.6
//  Content-type: text/html
//  nothing has been passed to this script
//  
//  
//  
//  In:
//  /etc/httpd/conf/httpd.conf
//  AddType application/x-httpd-php .php
//  (appears as above plus an entry for each of php2,3,4)
//  LoadModule php4_module modules/libphp4.so
//  LoadModule php_module modules/mod_php.so
//  
//  These were all uncommented in the RPM installation of RedHat 7.2.
//  Somehow PHP is partially working...
//  Any suggestions?
//  
//  I can create forms in php and tables in PostgreSQL but according to
//  phpinfo(), php is not configured for PostfreSQL.
//  
//  If I survive this problem, that one is on the horizon. Does anyone
// have a
//  generic list of things to do after an RPM installation of 
// RedHat Linux
// 7.2
//  in order to use PHP with PostgreSQL?
//  
//  Thanks,
//  Warren
//  
//  
//  _
//  Send and receive Hotmail on your mobile device: 
http://mobile.msn.com
 
 
 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


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



-
Do you Yahoo!?
New DSL Internet Access from SBC  Yahoo!

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




RE: [PHP-DB]opening and reading from file

2002-09-22 Thread Beau Lebens

what exact error are you getting, and what line is it on etc?

beau


// -Original Message-
// From: roslyn jose [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 23 September 2002 1:07 PM
// To: [EMAIL PROTECTED]
// Subject: RE: [PHP-DB]opening and reading from file
// 
// 
// 
// hello again,
// i tried what u told me but im still getting the same error 
// at the fopen(.). any other bright ideas. please help. thanx alot
//  
// ?php
// $filename=C:\\Documents and Settings\\roslyn\\My 
// Documents\\note.txt
// $fp = fopen (C:\\Documents and Settings\\roslyn\\My 
// Documents\\note.txt, r);
// $contents = fread ($fp, filesize ($filename));
// echo $contents;
// fclose ($fp);   
// ?
// 
// regards,
// roslyn
//  Beau Lebens wrote:just use
// 
// $filename = C:\\Documents and Settings\\roslyn\\My 
// Documents\\note.txt; //
// note double-slashes
// $contents = join('', file($filename));
// echo $contents;
// ?
// 
// should work. your parse error is probably because of the \ in your
// filename, you need to escape them with another \.
// 
// HTH
// 
// Beau
// 
// // -Original Message-
// // From: roslyn jose [mailto:[EMAIL PROTECTED]]
// // Sent: Monday, 23 September 2002 12:54 PM
// // To: [EMAIL PROTECTED]
// // Subject: RE: [PHP-DB]opening and reading from file
// // 
// // 
// // HI,IVE BEEN TRYING TO PRINT THIS CODE, BUT KEEP GETTING AN 
// // ERROR: // $filename=C:\Documents and Settings\roslyn\My 
// Documents\note.txt
// // $fp = fopen (C:\Documents and Settings\roslyn\My 
// // Documents\note.txt, r);
// // $contents = fread ($fp, filesize ($filename));
// // echo $contents;
// // fclose ($fp); 
// // ?
// // THE ERROR I GOT WAS THIS:Parse error: parse error in 
// // /var/www/html/learn/frames.php COULD SOMEONE PLS HELP ME 
// // OUT EHRE, I JUST WANT TO PRINT THIS FILE, THATS ALL. 
// // THANKSREGARDS ROSLYN
// // 
// // 
// // 
// // John Holmes wrote:Try $_POST['field_1'] instead of $field_1
// // 
// // ---John Holmes...
// // 
// //  -Original Message-
// //  From: Warren Massengill [mailto:[EMAIL PROTECTED]]
// //  Sent: Thursday, September 19, 2002 8:19 PM
// //  To: [EMAIL PROTECTED]
// //  Subject: [PHP-DB] Form response
// //  
// //  Hi,
// //  
// //  RedHat 7.2 RPM with PostgreSQL 7.1.x and PHP 4.0.6
// //  
// //  Page 111 of PHP and PostgreSQL, this form displays in 
// // Mozilla. The
// //  submit
// //  button is expected to run a script called reaction.php 
// but it opens
// // the
// //  script and displays the code. The response is the same 
// // with or without
// //  variable input.
// //  
// //  I changed the script file to executable: no effect.
// //  
// //  I can run 'reaction.php' from the shell and it works.
// //  What is the problem here?
// //  -
// //  form
// //  
// -
// //  
// //  
// //  A Simple Form
// //  
// // 
// // 
// //  
// //  [input] 
// // 
// // 
// //  [input] 
// //  
// //  
// //  
// //  
// //  -
// //  Reaction.php
// //  
// --
// //  action.php
// //  
// //   if ($field_1)
// //  {
// //  echo field_1: $field_1;
// //  }
// //  else
// //  {
// //  echo nothing has been passed to this script;
// //  }
// //  ?
// //  --
// //  run as stand alone php file
// //  
// -
// //  
// //  bash-2.05$ php  reaction.php
// //  X-Powered-By: PHP/4.0.6
// //  Content-type: text/html
// //  nothing has been passed to this script
// //  
// //  
// //  
// //  In:
// //  /etc/httpd/conf/httpd.conf
// //  AddType application/x-httpd-php .php
// //  (appears as above plus an entry for each of php2,3,4)
// //  LoadModule php4_module modules/libphp4.so
// //  LoadModule php_module modules/mod_php.so
// //  
// //  These were all uncommented in the RPM installation of 
// RedHat 7.2.
// //  Somehow PHP is partially working...
// //  Any suggestions?
// //  
// //  I can create forms in php and tables in PostgreSQL but 
// according to
// //  phpinfo(), php is not configured for PostfreSQL.
// //  
// //  If I survive this problem, that one is on the horizon. 
// Does anyone
// // have a
// //  generic list of things to do after an RPM installation of 
// // RedHat Linux
// // 7.2
// //  in order to use PHP with PostgreSQL?
// //  
// //  Thanks,
// //  Warren
// //  
// //  
// //  
// _
// //  Send and receive Hotmail on your mobile device: 
// http://mobile.msn.com
//  
//  
//  --
//  PHP Database Mailing List (http://www.php.net/)
//  To unsubscribe, visit: http://www.php.net/unsub.php
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP-DB]opening and reading from file

2002-09-22 Thread Beau Lebens

you have 2 spaces between My and Documents in those, not to mention that if
you are going to set $filename to be the path/file name, you may as well use
it in your fopen() call as well.

other than that is actually looks correct, although - you don't have  or 
around your HTML tag, you should use ?php rather than ? and I wouldn't
personally suggest storing files in a path with a space in it, if you can
avoid it, since that may actually cause problems.

hope something there helps

beau

// -Original Message-
// From: roslyn jose [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 23 September 2002 1:45 PM
// To: [EMAIL PROTECTED]
// Subject: RE: [PHP-DB]opening and reading from file
// 
// 
// 
// hi, the error is on line5. the error is: Parse error: parse error in 
// /var/www/html/learn/frames.php 
// 
// html
// 
// body
// 
// ?
// 
// $filename=C:\\Documents and Settings\\roslyn\\My  
// Documents\\note.txt;
//  $fp = fopen (C:\\Documents and Settings\\roslyn\\My  
// Documents\\note.txt, r);
//  $contents = fread ($fp, filesize ($filename));
//  echo $contents;
//  fclose ($fp); 
//  ?
// /body
// 
// /html
// 
// regards,
// 
// roslyn
// 
//  Beau Lebens wrote:what exact error are you getting, and 
// what line is it on etc?
// 
// beau
// 
// 
// // -Original Message-
// // From: roslyn jose [mailto:[EMAIL PROTECTED]]
// // Sent: Monday, 23 September 2002 1:07 PM
// // To: [EMAIL PROTECTED]
// // Subject: RE: [PHP-DB]opening and reading from file
// // 
// // 
// // 
// // hello again,
// // i tried what u told me but im still getting the same error 
// // at the fopen(.). any other bright ideas. please help. 
// thanx alot
// // 
// // // $filename=C:\\Documents and Settings\\roslyn\\My 
// // Documents\\note.txt
// // $fp = fopen (C:\\Documents and Settings\\roslyn\\My 
// // Documents\\note.txt, r);
// // $contents = fread ($fp, filesize ($filename));
// // echo $contents;
// // fclose ($fp); 
// // ?
// // 
// // regards,
// // roslyn
// // Beau Lebens wrote:just use
// // 
// // $filename = C:\\Documents and Settings\\roslyn\\My 
// // Documents\\note.txt; //
// // note double-slashes
// // $contents = join('', file($filename));
// // echo $contents;
// // ?
// // 
// // should work. your parse error is probably because of the 
// \ in your
// // filename, you need to escape them with another \.
// // 
// // HTH
// // 
// // Beau
// // 
// // // -Original Message-
// // // From: roslyn jose [mailto:[EMAIL PROTECTED]]
// // // Sent: Monday, 23 September 2002 12:54 PM
// // // To: [EMAIL PROTECTED]
// // // Subject: RE: [PHP-DB]opening and reading from file
// // // 
// // // 
// // // HI,IVE BEEN TRYING TO PRINT THIS CODE, BUT KEEP GETTING AN 
// // // ERROR: // $filename=C:\Documents and Settings\roslyn\My 
// // Documents\note.txt
// // // $fp = fopen (C:\Documents and Settings\roslyn\My 
// // // Documents\note.txt, r);
// // // $contents = fread ($fp, filesize ($filename));
// // // echo $contents;
// // // fclose ($fp); 
// // // ?
// // // THE ERROR I GOT WAS THIS:Parse error: parse error in 
// // // /var/www/html/learn/frames.php COULD SOMEONE PLS HELP ME 
// // // OUT EHRE, I JUST WANT TO PRINT THIS FILE, THATS ALL. 
// // // THANKSREGARDS ROSLYN
// // // 
// // // 
// // // 
// // // John Holmes wrote:Try $_POST['field_1'] instead of $field_1
// // // 
// // // ---John Holmes...
// // // 
// // //  -Original Message-
// // //  From: Warren Massengill [mailto:[EMAIL PROTECTED]]
// // //  Sent: Thursday, September 19, 2002 8:19 PM
// // //  To: [EMAIL PROTECTED]
// // //  Subject: [PHP-DB] Form response
// // //  
// // //  Hi,
// // //  
// // //  RedHat 7.2 RPM with PostgreSQL 7.1.x and PHP 4.0.6
// // //  
// // //  Page 111 of PHP and PostgreSQL, this form displays in 
// // // Mozilla. The
// // //  submit
// // //  button is expected to run a script called reaction.php 
// // but it opens
// // // the
// // //  script and displays the code. The response is the same 
// // // with or without
// // //  variable input.
// // //  
// // //  I changed the script file to executable: no effect.
// // //  
// // //  I can run 'reaction.php' from the shell and it works.
// // //  What is the problem here?
// // //  -
// // //  form
// // //  
// // -
// // //  
// // //  
// // //  A Simple Form
// // //  
// // // 
// // // 
// // //  
// // //  [input] 
// // // 
// // // 
// // //  [input] 
// // //  
// // //  
// // //  
// // //  
// // //  -
// // //  Reaction.php
// // //  
// // --
// // //  action.php
// // //  
// // //   if ($field_1)
// // //  {
// // //  echo field_1: $field_1;
// // //  }
// // //  else
// // //  {
// // //  echo nothing has been passed to this script;
// // //  }
// // //  ?
// // //  --
// // //  run as stand alone php file

RE: [PHP-DB] input 's id and name -- question...

2002-09-17 Thread Beau Lebens

nope - an id is used for other things (like javascript, style sheets, DHTML
etc). They shouldn't affect your variable names.

HTH

Beau


// -Original Message-
// From: Michael Zornek [mailto:[EMAIL PROTECTED]]
// Sent: Wednesday, 18 September 2002 6:41 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] input 's id and name -- question...
// 
// 
// does the id attribute of an input tag override the name 
// attribute when
// trying to pull these vales on a subsequent php page? Does it make any
// difference?
// 
// I ask cause I'm now PHP-ifing a form I designed in 
// Dreamweaver and it added
// ids attributes all over the place. Wonder if I should edit 
// them, delete
// them, etc... ???
// 
// Thanks!
// 
// ~ Mike
// -- 
// Mike Zornek | Project Leader
// Apple Student Developers
// The Insanely Great Site with the Insanely Long URL
// http://www.applestudentdevelopers.org
// 
// Personal Site: 
// http://www.mikezornek.com
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] Apache 2.X and PHP

2002-09-08 Thread Beau Lebens

i'm running php 4.2.2 and apache2 on my win2k laptop and it appears to be
running fine (stable etc) but obviously only as a dev platform, so not under
any sort of load or anything like that. also not running particularly
complex operations, so don't know about how it will handle that :)

but it works :)

Beau

// -Original Message-
// From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
// Sent: Sunday, 8 September 2002 12:56 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Apache 2.X and PHP
// 
// 
// Is it possible to run Apache 2.X with PHP?
// 
//  
// 
// Julio Cuz, Jr.
// 
// [EMAIL PROTECTED]
// 
// Information Services
// 
// Riverside Community College
// 
// mailto:[EMAIL PROTECTED]  
// 
//  
// 
// 

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




RE: [PHP-DB] External file integryti check

2002-09-03 Thread Beau Lebens

can't you just make the name of the file include a unique identifier of some
sort, or store each user's files in a different directory or something, to
make sure that they can't overwrite each other's (or their own) files?

Or would that not work in your app?

HTH

Beau

// -Original Message-
// From: Miguel Carvalho [mailto:[EMAIL PROTECTED]]
// Sent: Tuesday, 3 September 2002 5:35 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] External file integryti check
// 
// 
// Hi, id'like to know the opinion about to ensure external 
// file integrity.
// 
// Scenario: A web application that uses binary files( images, PDF's ).
// On the database ( postgresql 7.2.2 ) i store the filename of 
// the files.
// 
// The files ( images only ) are taken from an internal machine 
// when needed(
// via ftp ) or automatically at idle periods.If the image 
// comes throuth ftp( requested by a user ),
//  the image is downloaded to a temporary directory, a record 
// is inserted
//  into the database and the file get's moved to the final 
// directory if it
//  passed some tests.If no image is requested by a user, a 
// script will download( rcp ) at night
// the files and then put those in the final directory.When a 
// user request's a PDF, i create the PDF in realtime, using info.
// stored in the DB plus the image( store on filesystem ).
// My concern here is the folowing:
//   let's imagine that an image file is overwriten with a new image( by
//   mistake ). This is possible because users use some kind of 
// ID to name
//   the file. If this appens, the info stored in DB is out of sync in
//   relation to the file stored in filesystem.
//   To correct this issues i have three possibilities:
// 
// 1 - Store the PDF's in the filesystem, and store the 
// file date, time
// andCRC32 of the entire file in the database. This 
// solution has a
// consequence... i will need lots of space in the server( 
// each file is
// aprox. 2MB ).  At night a script will validate the 
// sync between the info stored in
//   DB and the info on filesystem.
// 2 - Create the PDF when requested. When the PDF generated for the
// first time, i will store: image creation date, time, 
// crc32 and some
// more dates, times and CRC32's of other information into 
// the DB.  At night a script will validate the sync 
// between the info stored in
//   DB and the info on filesystem.
// 3 - Run a script that is change file permissions( file 
// is created with
// user owner of webserver) for those new records inserted 
// to root.  A script will be run, because i cant change 
// ownership of a file on
//   the fly with PHP( PHP security ).
// Those are my solution's, if any one has any comments or suggestion's
// please  share it with us.Thank's
// Miguel Carvalho
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] Upload csv file into mysql

2002-09-03 Thread Beau Lebens

try phpMyAdmin - nice and easy, although i'm pretty sure there is a direct
command line.


// -Original Message-
// From: Dr. Indera [mailto:[EMAIL PROTECTED]]
// Sent: Wednesday, 4 September 2002 12:21 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Upload csv file into mysql
// 
// 
// Hello,
// 
// Is there a way to upload data in a csv file into a mysql table?
// 
// Thanks
// Indera
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] What's wrong with this code?

2002-09-01 Thread Beau Lebens

I'd use var inclusions like this;

VALUES (' . $_POST['Name'] . ', 

that might help you


// -Original Message-
// From: Shoulder to Shoulder Farm [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 2 September 2002 11:42 AM
// To: PHP Database List
// Subject: [PHP-DB] What's wrong with this code?
// 
// 
// Hi all, I'm running PHP4. What's wrong with this code:
// 
// ?
// 
// $db = mysql_connect(localhost, Taj, passwordhere);
// 
// mysql_select_db(s2s,$db);
// 
// mysql_query(INSERT INTO prod VALUES ( 'Name', 'ShortDesc', 
// 'LongDesc', 
// 'PriceOZ', 'PriceLB', 'URLOZ', 'URLLB', 'IMG') VALUES 
// ('$_POST[Name]', 
// '$_POST[ShortDesc]', '$_POST[LongDesc], '$POST[PriceOZ', 
// '$_POST[PriceLB]', '$_POST[URLOZ]', '$_POST[URLLB], '$_POST[IMG]');)
// 
// ?
// 
// This will wrap, but, it should work.
// 
// TIA, Taj
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] MySQL/PHP

2002-08-30 Thread Beau Lebens

try a little thought...

http://www.google.com/search?sourceid=navclientq=php+mysql+tutorial



// -Original Message-
// From: Bryan McLemore [mailto:[EMAIL PROTECTED]]
// Sent: Friday, 30 August 2002 2:52 PM
// To: PHP LIST
// Subject: [PHP-DB] MySQL/PHP
// 
// 
// Where can I find a good manual/tutorial on how to access 
// mySQL w/PHP.  Keep in mind that I am new to both PHP and 
// mySQL, and my database theory is sketchy at best.
// 
// Thanks.
// 

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




RE: [PHP-DB] Log Application Help...

2002-08-13 Thread Beau Lebens

Scott, can you just do it by sorting your query, then limiting the results
to 10?

ie.

SELECT * FROM tables WHERE somthing='1' ORDER BY date DESC LIMIT 10

should sort highest - lowest date (ie most recent, backwards) and give you
the top 10 results. then if you have the option of flipping thru blocks of
10 results you can just change the last bit to

LIMIT x,10

WHERE x is a starting point, then 10 obviously getting the next 10 entires.

HTH

Beau

// -Original Message-
// From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED]]
// Sent: Wednesday, 14 August 2002 12:07 AM
// To: '[EMAIL PROTECTED]'
// Subject: [PHP-DB] Log Application Help...
// 
// 
//  I have a Log Application that is fully functional, but I need to
// change a behavior and can't quite figure out how.  This app 
// has three pages,
// one for entering new entries, one to display all entries for 
// the last 5
// days, and the final page allows updating of existing 
// entries.  The problem I
// am having is that the log display page displays the data 
// ordered by date and
// displays the oldest data first.  I want the data ordered 
// this way, but I
// would like it to default to the last page such that you see 
// the most recent
// entry first.  The log displays 10 entries per page, and I 
// just want it to
// default to displaying the last page rather than the first.  
// Below is what I
// think are the pertinent sections of code.  Please let me 
// know what you
// think, and if you need more information or code.  Thanks in 
// advance for the
// assistance.
// 
// ?php require_once('prod.lib.php'); ?
// ?php
// $currentPage = $HTTP_SERVER_VARS[PHP_SELF];
// $maxRows_entry = 10;
// $pageNum_entry = 0;
// if (isset($HTTP_GET_VARS['pageNum_entry'])) {
//   $pageNum_entry = $HTTP_GET_VARS['pageNum_entry'];
// }
// $startRow_entry = $pageNum_entry * $maxRows_entry;
// 
// mysql_select_db($database, $Prod);
// $query_entry = SELECT * FROM oncall WHERE TO_DAYS(NOW()) - 
// TO_DAYS(ptime)
// =5 ORDER BY 'ptime' ASC;
// $query_limit_entry = sprintf(%s LIMIT %d, %d, $query_entry,
// $startRow_entry, $maxRows_entry);
// $entry = mysql_query($query_limit_entry, $Prod) or 
// die(mysql_error());
// $row_entry = mysql_fetch_assoc($entry);
// 
// if (isset($HTTP_GET_VARS['totalRows_entry'])) {
//   $totalRows_entry = $HTTP_GET_VARS['totalRows_entry'];
// } else {
//   $all_entry = mysql_query($query_entry);
//   $totalRows_entry = mysql_num_rows($all_entry);
// }
// $totalPages_entry = ceil($totalRows_entry/$maxRows_entry)-1;
// 
// $queryString_entry = ;
// if (!empty($HTTP_SERVER_VARS['QUERY_STRING'])) {
//   $params = explode(, $HTTP_SERVER_VARS['QUERY_STRING']);
//   $newParams = array();
//   foreach ($params as $param) {
// if (stristr($param, pageNum_entry) == false  
// stristr($param, totalRows_entry) == false) {
//   array_push($newParams, $param);
// }
//   }
//   if (count($newParams) != 0) {
// $queryString_entry =  . implode(, $newParams);
//   }
// }
// $queryString_entry = sprintf(totalRows_entry=%d%s, 
// $totalRows_entry,
// $queryString_entry);
// ?
// 
// ...  A bunch of HTML formatting snipped out...
// 
//   ?php } while ($row_entry = mysql_fetch_assoc($entry)); ?
// /tableRecords ?php echo ($startRow_entry + 1) ? to ?php echo
// min($startRow_entry + $maxRows_entry, $totalRows_entry) ? 
// of ?php echo
// $totalRows_entry ? 
// table border=0 width=50% align=center
//   tr 
// td width=23% align=center ?php if ($pageNum_entry 
//  0) { // Show
// if not first page ?
//   a href=?php printf(%s?pageNum_entry=%d%s, $currentPage, 0,
// $queryString_entry); ?First/a 
//   ?php } // Show if not first page ? /td
// td width=31% align=center ?php if ($pageNum_entry 
//  0) { // Show
// if not first page ?
//   a href=?php printf(%s?pageNum_entry=%d%s, 
// $currentPage, max(0,
// $pageNum_entry - 1), $queryString_entry); ?Previous/a 
//   ?php } // Show if not first page ? /td
// td width=23% align=center ?php if ($pageNum_entry 
// $totalPages_entry) { // Show if not last page ?
//   a href=?php printf(%s?pageNum_entry=%d%s, $currentPage,
// min($totalPages_entry, $pageNum_entry + 1), $queryString_entry);
// ?Next/a 
//   ?php } // Show if not last page ? /td
// td width=23% align=center ?php if ($pageNum_entry 
// $totalPages_entry) { // Show if not last page ?
//   a href=?php printf(%s?pageNum_entry=%d%s, $currentPage,
// $totalPages_entry, $queryString_entry); ?Last/a 
//   ?php } // Show if not last page ? /td
//   /tr
// /table
// 
// ...Cut of the rest of the HTML junk...
// 
// Scott Nipp
// Phone:  (214) 858-1289
// E-mail:  [EMAIL PROTECTED]
// Web:  http:\\ldsa.sbcld.sbc.com
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] php mysql external server

2002-08-01 Thread Beau Lebens

Meethoo
as it says in the PHP documentation, you can access a MySQL server whether
it's on the same machine as the PHP install or not.

ie. mysql_connect('localhost', $user, $pass)
OR mysql_connect('111.111.111.111', $user, $pass)

Beau

// -Original Message-
// From: Meethoo Salim [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 1 August 2002 3:24 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] php mysql external server
// 
// 
// hello there ,
// i have my Mysql server installed on a different machine- how 
// ca li access
// it?
// can someone help me out please
// regards
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] Resetting MySQL Auto_Index - How?

2002-07-24 Thread Beau Lebens

monty,
i found that if you do the command

DELETE FROM table

(with no WHERE clause) it deletes everything, and resets

Beau

// -Original Message-
// From: Monty [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 25 July 2002 1:34 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Resetting MySQL Auto_Index - How?
// 
// 
// Is there a way to re-set the internal counter that 
// automatically increments
// auto_increment fields? While testing an app, I added a lot 
// of test records
// that I've deleted, so, I'd like to reset the counter back to 
// the beginning
// now.
// 
// Thanks.
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] Global variables, $_GET problem

2002-07-23 Thread Beau Lebens

Ruth,

your reference to $_GET('var') is close, but as you have seen - no cigar :)
using the () after GET makes it refer to a function, but it is actually an
array which is automatically created, so you need to use

$_GET['var'] (note the square brackets

as for point 2 (register_globals) did you restart the apache service after
changing it? because registering globals should make $var available again
(but won't help with problem 1 :)

HTH

Beau

// -Original Message-
// From: Ruth Zhai [mailto:[EMAIL PROTECTED]]
// Sent: Wednesday, 24 July 2002 11:39 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Global variables, $_GET problem
// 
// 
// Hello php friends,
// We just upgraded our PHP to version 4.2.1.  I realized that 
// $var is no
// longer available from www.url.com/myphp.php?var=3 .  As 
// instructed in the
// document, we have tried two things:
// 1. I tried to use $_GET('var'), however, I got Fatal error: Call to
// undefined function: array() in /home/httpd/...  message.  I 
// have no clue
// what this means, and what I have done wrong.
// 2. Set register_globals = on in the configuration file.  
// This did not make
// any difference.
// 
// I don's know what to do now.  Your help is highly appreciated.
// 
// Ruth
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] php and javascript?

2002-07-22 Thread Beau Lebens

Bo,
you have really answered your own question (question 1) all you need to do
is replace http://detination with http://localhost/index.php?id=1 (as per
your examples) and it should send them to the page which triggers the
deletion of the page (if they confirm the box)

as far as q2 goes, you could send them to a page where they delete
something, and then that page actually just displays a message (on the page,
rather than a pop-up) which asks if they are sure, they click yes or no and
it does the same thing as the javascript popup. there is no way to create a
popup with PHP, so if you were considering popping a window using javascript
and then writing into it with php, you may as well just do it with the
javascript confirm() (much cooler) or with pure php (much more robust and
reliable).

HTH

Beau

// -Original Message-
// From: bo [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 22 July 2002 3:45 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] php and javascript?
// 
// 
// Hi,
// 
// Here is what I wanted to achieve, I want to get a 
// confirmation box pop up
// when user click on the delete link of the webpage(displays 
// the contents got
// from mysql database). I know we can do it in javascript 
// easily, but my
// question is:
// 1st,
// a common javascript confirmation will be like this:
// SCRIPT language=JavaScript
// !--
// function go_there()
// {
// var where_to= confirm(Do you really want to go to this page??);
// if (where_to== true)
// {
// window.location=http://detination;;
// }
// else
// {
// window.location=http://original;;
// }
// }
// //--
// /SCRIPT
// A HREF=javascript:go_there()New Page/A
// 
// my question is how to integrate the javascript with php, the 
// sample delete
// link will be something like: http://localhost/index.php?id=1 
// ,and the id
// number(in this case:1) is from database: (a
// href=delete.php?.$row[id].)
// 
// 2nd is there a better way to write pure php code to get a 
// confirm window pop
// up once i clicked on delete link?
// 
// Thanks and Good day.
// 
// Bo
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] or statement in url

2002-07-18 Thread Beau Lebens

or alternatively just do something similar to what you did, using either the
in-built array handling, or your own string manipulation

ie.

http://url.com/page.php?var1=foo
http://url.com/page.php?var1=bar

could be either;

http://url.com/page.php?var[]=foovar[]=bar
($_GET[var] will be an array with foo and bar as elements 0 and 1)

OR

http://url.com/page.php?var=foo,bar
then
$var = explode(,, $_GET[var]);
now, as above, $var is an array with the 2 terms

HTH

Beau

// -Original Message-
// From: Martin Clifford [mailto:[EMAIL PROTECTED]]
// Sent: Friday, 19 July 2002 4:36 AM
// To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
// Subject: Re: [PHP-DB] or statement in url
// 
// 
// Pass different variables and use them both in your query.
// 
// http://www.xyz.com/foo.php?FooID=1 
// http://www.xyz.com/foo.php?Foo2ID=2 
// 
// $query = SELECT * FROM table WHERE id=$FooID OR id=$Foo2ID;
// 
// HTH
// 
// Martin Clifford
// Homepage: http://www.completesource.net
// Developer's Forums: http://www.completesource.net/forums/
// 
// 
//  Matthew K. Gold [EMAIL PROTECTED] 07/18/02 04:20PM 
// can I use an OR operator in a variable that is passed through a url?
// 
// ex.  how can I combine the following two lines so that I end 
// up with records
// that have an id of either 1 or 2?
// 
// http://www.xyz.com/foo.php?FooID=1 
// 
// http://www.xyz.com/foo.php?FooID=2 
// 
// (I tried the following, but it didn't work:
// http://www.xyz.com/foo.php?FooID=1||FooID=2  )
// 
// thanks in advance for your help.
// 
// Matt
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php 
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] change data before its sent to db?

2002-07-16 Thread Beau Lebens

Chip, a couple ideas

1. why not display the select list something like this
select name=month
option value=00Please Select/option
option value=01January/option
option value=02February/option
...
/select

That way the user sees the names of the months, but your database gets sent
nice, easy-to-deal-with numbers?

2. What didn't work with your monthname=number assignment routine? you
should be able to make a function to do it, something like;

function month_name_to_number($name) {
switch ($name) {
case Jan :
return 1;
break;
case Feb :
return 2;
...
default :
return false;
}
}

Using this, if the functions returns false, then they haven't selected a
valid name, otherwise it will return a number from 1-12, indicating the
month.

PS - none of that code is tested, but it should work if you finish it off :)

HTH

Beau

// -Original Message-
// From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
// Sent: Wednesday, 17 July 2002 5:20 AM
// To: PHP_DB
// Subject: [PHP-DB] change data before its sent to db?
// 
// 
// I have a form with a select box of the 12 months + one for 
// none. It (and
// more) are sent to a mysql
// database. On another web page a list is displayed and can be 
// sorted by
// date, but of course
// the month names are not alphabetical. I tried to assign each month a
// number, 01,02,03, etc in a
// if-elseif statement, then send it to the database but that 
// wouldn't work.
// 
// if ($month == 'jan') { $month = '01';}
// elseif ($month == 'feb') {$month = '02'};
// 
// etc, so I can then sort numerically, and it will display in 
// the correct
// order on the web page.
// I have tried various versions of the above but it will not work.
// I know I could use numbers instead of names for the months - 
// but for this
// application that
// would not be appropriate.
// 
// The sort code ---
// 
// if ($orderby == 'month_num'):
// $sql = select * from releases order by 'month';
// elseif ($orderby == 'month_num2'):
// $sql = select * from releases order by 
// 'month' desc;
// 
// The html select 
// 
// td valign=bottomMonth:br /
// select name=month
// option value=000None
// option value=JanJan
// option value=FebFeb
// etc
// /select
// 
// --
// Chip Wiegand
// Computer Services
// Simrad, Inc
// www.simradusa.com
// [EMAIL PROTECTED]
// 
// There is no reason anyone would want a computer in their home.
//  --Ken Olson, president, chairman and founder of Digital 
// Equipment
// Corporation, 1977
//  (They why do I have 9? Somebody help me!)
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] resource ID #3

2002-07-11 Thread Beau Lebens

Jonathan,
most (all?) of the database query-related functions in PHP return a
Resource ID which contains the data resulting from your query. To access
that information, you need to pass the Resource ID thru a function like
(assuming u r using MySQL) mysql_fetch_array() or mysql_fetch_row()

Have a look at those 2 (or their equivalents for different DBs) in the
manual and go from there :)

HTH

Beau

// -Original Message-
// From: Jonathan [mailto:[EMAIL PROTECTED]]
// Sent: Friday, 12 July 2002 9:18 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] resource ID #3
// 
// 
// I am a newbie to php (as i have announced several times on 
// this bulletin
// board =) so I thank you all for your help.
// 
// Mi problemo:
// 
// I have a database of events going on at local colleges.  The 
// names of the
// tables are the abbreviated names of the colleges.  I grab 
// those with a 'SHOW
// TABLES' command to the mysql que.  Then, I have a second 
// database which
// matches each abbreviation with the proper name.  When I try 
// to run any query
// on the second database, the only output I recieve is 
// resource id #3  Any
// suggestions?
// 
// Jonathan
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] A Simple Question

2002-07-10 Thread Beau Lebens

Ahhh - good correction Adam, I forgot about that method :)
 
So I suppose if you already have an array and wanted to pass it in a
link/URL then you could do something like
 
foreach($array as $value) {
$qstring .= 'array[]=' . $value . '';
}
 
echo 'a href=link.php?' . $qstring . 'link/a';
 
then on link.php you'd have the array $array[] (with globals) or
$_GET['array'][]
 
cool
 
Beau

-Original Message-
From: Adam Royle [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 10 July 2002 9:05 PM
To: Beau Lebens; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] A Simple Question



Just a correction you can use arrays with querystrings 


page.php?var1[]=firstvar1[]=secondvar1[]=third 


$var1 

Array 

( 

[0] = first 

[1] = second 

[2] = third 

) 



OR 


page.php?var1[]=firstvar2[2]=secondvar2[]=third 


$var 1 

Array 

( 

[0] = first 

) 


$var2 

Array 

( 

[2] = second 

[3] = third 

) 


You can also have multidimensional arrays, but not associative arrays. 


But you do have the 255 character limitation (can be a bummer). 


Adam 



Also, as far as limitations go, the following are considerations; 


1. You can't pass an array using the querystring 

2. Multiline variables (ie. textarea contents) are bad 

3. There is a limit of 255 or something characters to a URI (someone?) 

4. Be careful with the $_GET[] array that Tony mentions, it is only 

available on more recent versions of PHP, before that it was $HTTP_GET_VARS 

and a lot of people had been using just plain $var1 or whatever, assuming 

that register_globals would always be ON in the php.ini file (which also 

changed in recent versions). 


HTH 


Beau 




RE: [PHP-DB] A Simple Question

2002-07-09 Thread Beau Lebens

Also, as far as limitations go, the following are considerations;

1. You can't pass an array using the querystring
2. Multiline variables (ie. textarea contents) are bad
3. There is a limit of 255 or something characters to a URI (someone?)
4. Be careful with the $_GET[] array that Tony mentions, it is only
available on more recent versions of PHP, before that it was $HTTP_GET_VARS
and a lot of people had been using just plain $var1 or whatever, assuming
that register_globals would always be ON in the php.ini file (which also
changed in recent versions).

HTH

Beau

// -Original Message-
// From: Tony [mailto:[EMAIL PROTECTED]]
// Sent: Wednesday, 10 July 2002 7:42 AM
// To: Manuel; [EMAIL PROTECTED]
// Subject: Re: [PHP-DB] A Simple Question
// 
// 
// Suppose you are using PHP.
// A link like this:
// 
// http://yourdomain.com/yourpage.php?var1=value1var2=value2va
// r3=value3
// 
// will do the trick.
// And in the page that receives this link (yourpage.php that 
// is), use $_GET[]
// to get the value:
// 
// $var1 = $_GET[var1];
// $var2 = $_GET[var2];
// $var3 = $_GET[var3];
// 
// Tony S. Wu
// 
// 
// Manuel at [EMAIL PROTECTED] wrote:
// 
//  
//  I recently discovered that you can pass variables through 
// hyperlinks. (I
//  didn't know this could be done) This will be very helpful 
// for the project I'm
//  working on but I cannot find any information on this subject.
//  
//  Does anybody know where I can find information on the 
// syntax and limitations
//  of this feature? 
//  
//  
//  
//  -
//  Do You Yahoo!?
//  New! SBC Yahoo! Dial - 1st Month Free  unlimited access
// 
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] Urent please

2002-07-08 Thread Beau Lebens

how about when u open the new window (using something like window.open(...))
you make it open a URL something like foobar.php?var1=foo and then on that
page (foobar.php) you can grab the value of $var1 as foo

HTH

Beau

// -Original Message-
// From: its me [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 8 July 2002 1:46 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Urent please
// 
// 
// maybe this is more a javescripy problem...but its related to 
// my php code:
// how can i open a new window with javacript and pass to it 
// php variables??
// thanks guys alot.
// 
// 
// Rehab M.Shouman
// 
// 
// 
// 
// 
// -
// Express yourself with a super cool email address from BigMailBox.com.
// Hundreds of choices. It's free!
// http://www.bigmailbox.com
// -
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] Form select field problem

2002-07-08 Thread Beau Lebens

Keiran,
A couple possibilities for you;

1. Try referring to the field (in JavaScript) as something like; (might have
to play around with this)

document.existing[groupchoice[]].selectedIndex

2. Make it so that each selection on the select tag is mirrored into
another hidden input field (onSelect=) and then you actually check the
hidden field for what values are present and what aren't, throwing an error
based on it, rather than on the actual select

HTH

Beau

// -Original Message-
// From: Keiran Wynyard [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 8 July 2002 5:22 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Form select field problem
// 
// 
// Hi
// 
// I may be posting this to the wrong place, and if so I 
// apologise.  If someone knows of a
// better place to post my query please tell me, and I will. :)
// 
// This problem is about 50% PHP and 50% Javascript, really to 
// do with how the two interface
// with each other.
// 
// Anyhoo, down to the problem.
// 
// I have a Select form item with 'multiple' set. It sends an 
// array of values to be dissected
// and applied to database tables, hence it's name value is 
// 'groupchoice[]'. This all works
// well and good when some value(s) are selected, but obviously 
// gives an error if the form is
// sent with no value selected. What I need to do is come up 
// with an elegant way of stopping
// the form if no entries have been selected (or indeed if all 
// entries have been deselected).
// I have successfully used a Javascript function to do this, 
// but it only works if the field
// is named 'groupchoice'. The part of the function that is 
// causing the problem is listed
// below:
// 
// if (!document.existing.groupchoice.selectedIndex != ) //this works
// 
// if (!document.existing.groupchoice[].selectedIndex != ) 
// //this gives a syntax error
// 
// Obviously if I call the field 'groupchoice' the information 
// sent is no longer an array,
// and therefore I cannot have multiple selections, which is 
// imperative. I have thought of
// other ways of doing the job, such as having an alert pop-up 
// if there is an error and then
// return them to the form, as opposed to before the form is 
// sent, but didn't feel that this
// was very elegant.
// 
// Have any of you PHP gurus out there experienced this kind of 
// problem and found a solution?
// 
// I would be greatly appreciative if someone would share their 
// expertise.
// 
// TIA
// Keiran
// [EMAIL PROTECTED]
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] Session data not being deleted on browser close.

2002-07-08 Thread Beau Lebens

have you closed all browser windows?

eg. if you open your browser, then spawn a new window (ctrl-n or similar)
then do something with one of them which creates session vars, then close
that window, then open a new one again, the session has probably remained
active because the first window was still open

can you provide a code sample of how you are using the session variables?
have you modified any of the expiry times etc?

Beau

// -Original Message-
// From: Youngie [mailto:[EMAIL PROTECTED]]
// Sent: Tuesday, 9 July 2002 12:42 PM
// To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
// Subject: [PHP-DB] Session data not being deleted on browser close.
// 
// 
// Why would my session data not be deleted after my browser is closed?
// 
// I can set some session variables, close my browser, reopen 
// them and the old
// values are still present,
// I can verify this by seeing that the file still containts my 
// session data
// and values.
// 
// Thanks
// 
// John.
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] Excel to MySQL??

2002-06-30 Thread Beau Lebens

make sure there are no # chars in there, unless you have commented lines
out (as below)

# commented line

in phpMyAdmin that is a comment, and the way it reads, if there's a # on a
line, it comments from there onwards (from memory)

HTH

Beau

// -Original Message-
// From: Chase [mailto:[EMAIL PROTECTED]]
// Sent: Sunday, 30 June 2002 5:57 AM
// To: [EMAIL PROTECTED]
// Subject: Re: [PHP-DB] Excel to MySQL??
// 
// 
// My webhost is running phpMyAdmin v2.2.2 and it is giving me 
// errors when 
// I try to load the file.  Are there any certain characters 
// that cannot be 
// in the file?  (ie. $)
// 
// Chase
// 
// Peter Lovatt wrote:
// 
//  Hi
//  
//  from Excel export to csv
//  
//  use phpMyAdmin to load it into mysql (recent versions of 
// phpMyAdmin has an
//  Excel import function)
//  
//  HTH
//  
//  Peter
//  
//  ---
//  Excellence in internet and open source software
//  ---
//  Sunmaia
//  www.sunmaia.net
//  [EMAIL PROTECTED]
//  tel. 0121-242-1473
//  ---
//  
//  
// -Original Message-
// From: Chase [mailto:[EMAIL PROTECTED]]
// Sent: 29 June 2002 22:22
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Excel to MySQL??
// 
// 
// Does anyone know of a way that I can export an Excel 
// spreadsheet to a
// file that I can import to MySQL?  I found a program that 
// will do this
// for Access, but I would rather leave Access out of this if 
// possible.
// Thanks!!
// 
// Chase
// 
// 
// --
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 
// 
//  
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] E-mail address verification

2002-06-23 Thread Beau Lebens

also, you might like to do some client-side validation before sending it to
the server, in which case you can use somehting like
http://www.dentedreality.com.au/jsvalidation/

HTH

Beau

// -Original Message-
// From: [EMAIL PROTECTED]
// [mailto:[EMAIL PROTECTED]]
// Sent: Friday, 21 June 2002 12:00 AM
// To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
// Subject: RE: [PHP-DB] E-mail address verification
// 
// 
// 
// 
// 
// I do it like this:
// 
// 
// if 
// (eregi(^[a-z0-9]+([\.%!][_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*$,
// $email))
// {
//   list($user, $host) = explode(@, $email);
//   if ( !checkdnsrr($host, MX) )
//   return TRUE;
// }
// else
// {
//   return FALSE;
// }
//   }
// 
// As you can see, the email can look right, but domain isn't 
// valid. So you
// can check DNS record for MX domain.
// Next step is to connect to mail server and verify user, but 
// usualy that
// takes time and it's better to send some kind of auth code to 
// that mail and
// if user conforms it, you can use it...
// 
// This worked very well. For any of you out there that are 
// looking for a
// simple verification with host dns lookup, here it is!!!
// 
// For a more comprehensive class check here, thanks to Manuel Lemos
// 
// http://www.phpclasses.org/emailvalidation
// 
// 

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




RE: [PHP-DB] CSV/TXT file imported via PHP into MySQL

2002-06-10 Thread Beau Lebens

Keiran,
in your second page, you refer to $textfile as the thing that you want to
load into the database; this file doesn't exist on the server, so it is
inserting nothing I would imagine.

You need to use something like $_FILES['tmp_name'] to refer to the actual
file, once it has been successfully uploaded to your server
(http://www.php.net/manual/en/features.file-upload.php#features.file-upload.
post-method)

HTH

Beau

// -Original Message-
// From: Keiran Wynyard [mailto:[EMAIL PROTECTED]]
// Sent: Tuesday, 11 June 2002 12:38 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] CSV/TXT file imported via PHP into MySQL
// 
// 
// I have a form on a PHP page with which I wish to load a tab 
// delimited text file into a
// UNIX based MySQL database
// 
// By using PHPMyAdmin I have tested whether I can upload the 
// file, using MyAdmin to help me
// construct the Query and to date in MyAdmin it works fine. 
// Taking the query and splitting
// it across two pages (one for receiving the file, and to 
// action the query) seems to stop it
// from working.
// 
// I have detailed the pertinent aspects below.
// My question is really to do with whether there is a file 
// permissions setting or
// requirement that I have to be aware of, or if there is 
// merely something else I can do.
// 
// Form code:
//  echo form method=\post\ action=\$PHP_SELF?command=create\
// enctype=\multipart/form-data\;
//   echo \ntable width=\300\trtdinput type=\file\ 
// name=\textfile\/td;
//   echo \n\ntd width=\50\input type=\submit\ 
// name=\submit\ value=\Load
// File\/td/tr/table/form;
// 
// Query section:
//  switch ($command)
//  {
//  case 'create':
//  echo br$textfile; \\merely existing to run checks
//  $query = LOAD DATA LOCAL INFILE ' . $textfile 
// . ' INTO TABLE
// pebble_email_addresses FIELDS TERMINATED BY '\t' LINES 
// TERMINATED BY '\r\n' (firstname,
// surname, email) ;
//  echo br$query; \\merely existing to run checks
//  $sql_query_result = @mysql_query($query, $sql_userdb);
//   if ($sql_query_result and @mysql_affected_rows()  0)
//  {
//  //Worked OK
//   echo brit worked;
//   }
// else
//{
//echo brit didn't;
//  break;
// 
// I have yet to get the damn query to import anything at all! HELP
// 
// Thanks in Advance!
// 
// Keiran
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] values across functions

2002-06-05 Thread Beau Lebens

have you declared the variables as global int eh function?

eg

function foo($bar) {
global $this, $that, $theOther;

[...]
}

that way $this, $that and $theOther variables are available everywhere

HTH

Beau

// -Original Message-
// From: James Kupernik [mailto:[EMAIL PROTECTED]]
// Sent: Wednesday, 5 June 2002 9:35 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] values across functions
// 
// 
// I have a file, it's a shopping cart. Currently is contains 
// all the fuctions
// required in the cart, including the shipping and billing 
// form. It won't take
// the values from the shipping form and use them in the functions that
// calculate the tax and S  H. Why would this be? I've gotten 
// other variables
// to transfer, just not these.
// 
// Thanks
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] dropping one word from column entries

2002-05-29 Thread Beau Lebens

A cleaner option might be to do this before you get it to PHP at all, via
your SQL query.

Check out the string functions available, there are a number of
substring-style things available, string position etc.

HTH

Beau

// -Original Message-
// From: Ed Gorski [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 30 May 2002 12:09 AM
// To: Jen Swofford; php-db@lists. php. net
// Subject: Re: [PHP-DB] dropping one word from column entries
// 
// 
// use:
// 
// $name=Mouse Housing Products;
// $name=str_replace(Products,,$name);
// 
// also the RTFM() function works too
// 
// ed
// 
// At 11:06 AM 5/29/2002 -0500, Jen Swofford wrote:
// I'm having a problem with this and suppose I'm looking for 
// a handout.  :|
// 
// I am displaying names of product categories.  The names of 
// the categories
// are:
// 
// Bird Cages
// Cat Toys
// Chinchilla Housing Products
// Dog Leashes
// Ferret Housing Products
// Mouse Housing Products
// 
// What I want to do when displaying the names is to drop 
// Products whenever
// it appears.  What I want do display on the page instead is:
// 
// Bird Cages
// Cat Toys
// Chinchilla Housing
// Dog Leashes
// Ferret Housing
// Mouse Housing
// 
// And no, changing the names of the categories in the 
// database is not an
// option.  :)  I'm completely missing the boat on this one... 
// any help?
// 
// Jen Swofford
// [EMAIL PROTECTED]
// 
// 
// 
// 
// --
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] mysql exclusion in php

2002-05-29 Thread Beau Lebens

chris, you'll need to do a little PHP manipulation, perhaps (pseudo)

if -word. (regular expression?)
for each -word
SQL .=  NOT LIKE '%word% AND'
endforeach
endif
for each other word
SQL .=  LIKE '%word%' AND
endforeach

strip trailing AND

clean up SQL as required

query db

-
ok, obviously that's very rough, but i think something like that will work
:)

HTH

Beau




// -Original Message-
// From: Chris Payne [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 30 May 2002 12:22 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] mysql exclusion in php
// 
// 
// Hi there everyone,
// 
// How can I do a search which excludes certain words if they 
// put a - in the search string?  I can do a search easily, but 
// if they put a - infront of a word in the string, how can I 
// then get MySQL to search all entries EXCEPT where the word 
// with a - next to it appears?
// 
// Thanks for everything.
// 
// Chris
// 

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




RE: [PHP-DB] Truncated Data

2002-05-29 Thread Beau Lebens

htmlspecialchars()

Beau

// -Original Message-
// From: Larentium [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 30 May 2002 10:40 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Truncated Data
// 
// 
// Hello,
// 
// I desperately need help...  I've based my entire project on 
// the use of input text boxes that can be read or edited.  Its 
// a web form that gets its data from mysql tables.  For some 
// reason when I write the code this way and use single quotes 
// ('), everything after a single quote in the string gets truncated:
// 
//   echo input $ca name=university[$y] value='$university[$y]';
// 
// But when I use double quotes () like this:
// 
//   echo input $ca name=university[$y] value=\$university[$y]\;
// 
// Everything after a  gets truncated in the text string.  
// When I first input the data it goes into the mysql database 
// fine.  The problem only lies in when I import the value into 
// the html form.  I even tried writing the code like this:
// 
//   echo input $ca name=university[$y] value=$university[$y];
// 
// And here is what the source code shows:
//   input class=Inputa name=university[1] value=John's Wayne
// 
// But the input box shows only:  John's
// 
// Oh, and I don't get the problem when I use textarea 
// instead of input tags, but they just won't do for the design.
// Any help or advise would be greatly appreciated.
// 
// 
// Larentium
// [EMAIL PROTECTED]
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] HELP USING THE MAIL FUNCTION WITH HTML

2002-05-26 Thread Beau Lebens

you have to change the Content-Type header or something (text/html) but the
easiest way is to use a pre-packed class (unless you really want to do it
yourself). Check out hotscripts or just do a google for php mail class or
similar :)

HTH

Beau

// -Original Message-
// From: CrossWalkCentral [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 27 May 2002 11:40 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] HELP USING THE MAIL FUNCTION WITH HTML
// 
// 
// How can I use the Mail function to send html data.
// 
// I have like a welcome letter I am working on and when the 
// user signs up for
// such services I want this to be sent to them.
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] DROP tables with prefix match

2002-05-15 Thread Beau Lebens

if it's only a one-off thing, you could use php to get all table names
(mysql_list_tables) and then go thru and create an array of the names that
match your criteria, then go thru that array and DROP each one progressivly.

HTH

Beau

// -Original Message-
// From: John Hughes [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 16 May 2002 7:41 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] DROP tables with prefix match
// 
// 
// I need to rebuild a PHP-mySQL site that has an extensive table
// structure. Is there a way to DROP all tables that start with a
// certain prefix?
// 
// __
// Do You Yahoo!?
// LAUNCH - Your Yahoo! Music Experience
// http://launch.yahoo.com
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] Link for next db record

2002-05-13 Thread Beau Lebens

that will only set the value for $rv_space won't it?
have you echo'd out the values of the variables you are working with to make
sure that everything is being passed around properly?


// -Original Message-
// From: Jennifer Downey [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 13 May 2002 3:14 PM
// To: [EMAIL PROTECTED]
// Subject: Re: [PHP-DB] Link for next db record
// 
// 
// This line sets $row[rv_space]
// echoTRTDSearch Record by Space Number 
// /TDTDnbsp;INPUT size=4
// name=rv_space/TD/TR;
// 
// 
// 
// Beau Lebens [EMAIL PROTECTED] wrote in message
// news:[EMAIL PROTECTED].
// edu.au...
//  How are you setting the value for $row[rv_space] ?
// 
//  // -Original Message-
//  // From: Jennifer Downey [mailto:[EMAIL PROTECTED]]
//  // Sent: Monday, 13 May 2002 2:01 PM
//  // To: [EMAIL PROTECTED]
//  // Subject: Re: [PHP-DB] Link for next db record
//  //
//  //
//  // Hi Beau,
//  //
//  // I have a form that selects an rv electric record here is a
//  // snip and if you
//  // need more tell me.
//  // This just returns a blank page.
//  //
//  // $current_date = date(M);
//  // $pkwh =.064;
//  // $get_electric = SELECT * FROM electric WHERE rv_space =
//  // $row[rv_space];
//  // $result = mysql_query($get_electric) or die(mysql_error());
//  // $row = mysql_fetch_array($result);
//  // $tot_used = $row[end] - $row[begin];
//  // $ppkwh = .064;
//  // $sub_total = $tot_used * $ppkwh;
//  // $puf = '11';
//  // $total = $sub_total + $puf;
//  // echo h1centerSalmon Shores RV Park/center /h1;
//  // echo h2emElectric Bill for Space $rv_space/em/h2;
//  // echo Month $current_date;
//  // echo body bgcolor=#00C0C0;
//  // echo table width= 100%trtd width='10%'Space /tdtd
//  // Begin/tdtd
//  // End/tdtdTotal KWH Used/tdtdSubtotal/tdtdPublic Use
//  // Fee/tdtdTotal/td;
//  // echo trcentertd width='10%'$rv_space/em/tdtd
//  // width='10%'$row[begin]/tdtd width='10%'$row[end]/tdtd
//  // width='15%'$tot_used/tdtd width='10%'$sub_total/tdtd
//  // width='12%'$puf.00/tdtd$total/td/center/table;
//  // echo pa href='index.php'Return to Main Menu/a orBR;
//  // echo a
//  // 
// href='search_elec_space_record.php?record=$row[rv_space]-1'Previous
//  // Record/a/p;
//  // echo a
//  // href='search_elec_space_record.php?record=$row[rv_space]+1'Next
//  // Record/a/p;
//  // echo a href='search_elec_space.php'Search Another 
// Record/a/p;
//  //
//  // I can get the first record say I choose space 35 if I click
//  // the link for
//  // $row[rv_space]+1 then it returns a blank page what can I do
//  // to fix this?
//  //
//  // Thanks again
//  // Jennifer
//  //
//  //
//  // Beau Lebens [EMAIL PROTECTED] wrote in message
//  // news:[EMAIL PROTECTED].
//  // edu.au...
//  //  jen,
//  //  assuming you are currently looking at a page which is
//  // something like
//  //  php.php?record=3, then you should be able to just do
//  // 
//  //  a href='php.php?record=?php echo ($record-1)
//  // ?'Previous record/aa
//  //  href='php.php?php echo ($record+1) ?'Next record/a
//  // 
//  //  and then on the php.php page, you would obviously being
//  // grabbing something
//  //  from the database using a unique identifier or similar.
//  // 
//  //  one gotcha to be careful of - if there is a chance that
//  // your id field
//  // will
//  //  have a gap in it (ie. not be perfectly consecutive) then
//  // you should make
//  //  your query something like
//  // 
//  //  SELECT * FROM table LIMIT $record, 1
//  // 
//  //  rather than
//  // 
//  //  SELECT * FROM table WHERE id='$record'
//  // 
//  //  Since that takes them in whatever order, but only SELECTs
//  // from $record and
//  //  gets 1 record.
//  // 
//  //  HTH
//  // 
//  //  Beau
//  // 
//  // 
//  //  // -Original Message-
//  //  // From: Jennifer Downey [mailto:[EMAIL PROTECTED]]
//  //  // Sent: Monday, 13 May 2002 1:14 PM
//  //  // To: [EMAIL PROTECTED]
//  //  // Subject: [PHP-DB] Link for next db record
//  //  //
//  //  //
//  //  // Hi all,
//  //  //
//  //  // Wondering if you could help or point me to a tut  where I
//  //  // can use a link to
//  //  // get the next record in the db?
//  //  //
//  //  // Like a href='php.php'Previous record/aa
//  //  // href='php.php'Next record/a
//  //  //
//  //  // How do I go about doing this.
//  //  //
//  //  // Thanks
//  //  // Jennifer
//  //  //
//  //  // --
//  //  // The sleeper has awaken
//  //  //
//  //  //
//  //  // ---
//  //  // Outgoing mail is certified Virus Free.
//  //  // Checked by AVG anti-virus system (http://www.grisoft.com).
//  //  // Version: 6.0.351 / Virus Database: 197 - Release 
// Date: 4/19/2002
//  //  //
//  //  //
//  //  //
//  //  // --
//  //  // PHP Database Mailing List (http://www.php.net/)
//  //  // To unsubscribe, visit: http://www.php.net/unsub.php
//  //  //
//  //
//  //
//  // ---
//  // Outgoing mail is certified Virus Free.
//  // Checked by AVG anti-virus system (http://www.grisoft.com

RE: [PHP-DB] IIS - hangs up after one hour

2002-05-13 Thread Beau Lebens

Memory Leak?
check task manager periodically over that time to see how much memory IIS is
hogging (under Processes - you might have to add the column Mem Usage)

Other than that... my only suggestion would be to upgrade to Apache :)

(and yes, I intentionally use the phrasing - upgrade :)

Beau

// -Original Message-
// From: Hermann Otteneder [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 13 May 2002 11:17 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] IIS - hangs up after one hour
// 
// 
// hi,
// i've iis 5 on a win2000 server with php4 version 4.2.0. this 
// works for
// roughly one hour. after this time iis hangs up - i don't know why!? i
// additionally use a mssql database on a second server - this 
// works also
// properly for one hour! knows onyone this problem or even a solution?
// 
// the permissions are properly set (for IWAN_CompName) . I use php as
// ISAPI-version with the php_mssql.dll extension
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] SELECTING a sentence from a text field?

2002-05-13 Thread Beau Lebens

Larry, take a look in the MySQL manual (or other SQL reference, but MySQL
has it there)

String Functions
http://www.mysql.com/doc/S/t/String_functions.html

Particularly, look at (no named anchors that I can see :)
LOCATE(substr,str,pos)

ie, you could use perhaps
LOCATE( , yourField, 95)

?

HTH

Beau

// -Original Message-
// From: ::: Larry French ::: [mailto:[EMAIL PROTECTED]]
// Sent: Tuesday, 14 May 2002 8:29 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] SELECTING a sentence from a text field?
// 
// 
// Hello all. I have a MySQL field called 'description' that contains a
// paragraph of text. I want to pull out the first 30 words (or 
// there about)
// from 'description'.
// 
// This is what I came up with:
// 
// SELECT
// ID,
// name,
// LEFT(description,95),
// IF(enrolling = 1,'Currently enrolling','')
// FROM trials
// ORDER BY name ASC
// LIMIT $offset, $limit
// 
// Obviously this grabs the first 95 characters from 
// 'description', but when I
// display 'description' the word at the end of the string 
// (after the 95th
// charter) is often cut right in the middle.
// 
// I know that I could select the whole field then use a regex 
// to chop the
// string at the first '.' but I would rather have a SQL 
// statement that only
// grabs the text I need.
// 
// So how do I write a SQL statement that will grab the first 
// 30 words without
// chopping the last word?
// 
// Thanks for your time.
// larry.
// 
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] Link for next db record

2002-05-12 Thread Beau Lebens

jen,
assuming you are currently looking at a page which is something like
php.php?record=3, then you should be able to just do

a href='php.php?record=?php echo ($record-1) ?'Previous record/aa
href='php.php?php echo ($record+1) ?'Next record/a

and then on the php.php page, you would obviously being grabbing something
from the database using a unique identifier or similar.

one gotcha to be careful of - if there is a chance that your id field will
have a gap in it (ie. not be perfectly consecutive) then you should make
your query something like

SELECT * FROM table LIMIT $record, 1

rather than 

SELECT * FROM table WHERE id='$record'

Since that takes them in whatever order, but only SELECTs from $record and
gets 1 record.

HTH

Beau


// -Original Message-
// From: Jennifer Downey [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 13 May 2002 1:14 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Link for next db record
// 
// 
// Hi all,
// 
// Wondering if you could help or point me to a tut  where I 
// can use a link to
// get the next record in the db?
// 
// Like a href='php.php'Previous record/aa 
// href='php.php'Next record/a
// 
// How do I go about doing this.
// 
// Thanks
// Jennifer
// 
// --
// The sleeper has awaken
// 
// 
// ---
// Outgoing mail is certified Virus Free.
// Checked by AVG anti-virus system (http://www.grisoft.com).
// Version: 6.0.351 / Virus Database: 197 - Release Date: 4/19/2002
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] REG_BADRPT

2002-04-18 Thread Beau Lebens

basically it means that you have an invalid regular expression pattern in a
regex function.

i think it's something to do with the . * ? + symbols - but just take a good
look at your pattern and somewhere in there it is invalid :)

HTH

Beau

// -Original Message-
// From: Camelia Enderby [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 18 April 2002 4:41 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] REG_BADRPT
// 
// 
// Does anybody know what this warning error means: REG_BADRPT?
// 
// Cami
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] appending new entry to old entries

2002-04-18 Thread Beau Lebens

there might even be some cool SQL you can use tho, which would avoid having
to get the data out and then put it back in again.

I *think* (don't quote me on this) I remeber seeing something like

UPDATE myTable SET myField = CONCAT(myField + 'new string of stuff here')
WHERE myID='1'


HTH

beau

// -Original Message-
// From: Ron Allen [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 18 April 2002 7:34 PM
// To: [EMAIL PROTECTED]
// Subject: Re: [PHP-DB] appending new entry to old entries
// 
// 
// Thanks
// 
// Jason Wong [EMAIL PROTECTED] wrote in message
// news:[EMAIL PROTECTED]...
//  On Thursday 18 April 2002 16:51, Ron Allen wrote:
//   I would like to make it so that my helpdesk section can 
// append entries
// in
//   their Master Station Log. Update replaces the 
// entryany clues??
// 
//  You would have to get the original value, append the new 
// stuff then do
// UPDATE.
// 
//  --
//  Jason Wong - Gremlins Associates - www.gremlins.com.hk
//  Open Source Software Systems Integrators
//  * Web Design  Hosting * Internet  Intranet Applications 
// Development *
// 
// 
//  /*
//  There is very little future in being right when your boss is wrong.
//  */
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] Limitations on sending text to a database via text area forms

2002-04-17 Thread Beau Lebens

could you perhaps save the contents directly into a file, then read the file
into the database?

I know for a fact (http://www.dentedreality.com.au/webpad/) that you can use
a textarea to pump more info than that into a file, but haven't tried doing
it straight into a database.

HTH

Beau

// -Original Message-
// From: John Hughes [mailto:[EMAIL PROTECTED]]
// Sent: Wednesday, 17 April 2002 3:03 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Limitations on sending text to a database via text
// area forms
// 
// 
// I am attempting to build a Web site that will allow users to 
// create simple
// text documents that will be stored in a database. I had been 
// assuming I
// could use a textarea form and have PHP pass it to a mySQL database.
// However, when I attempted to send  a 393 word (2,216 
// characters) text block,
// the browser (I.E. 6) refused to move.  I got no error or 
// other indication of
// trouble.  When I cut the text down under 275 words (1,531 
// characters), the
// form was allowed to be submitted, stored and retrievable
// 
// Is this the limit on passing textarea form fields?
// 
// And more to point of this mailing list, what alternatives 
// might I use to
// circumvent this limit?
// 
// I need to keep the creation of these documents as simple as possible.
// Anything more than copying and pasting is going to cause 
// trouble more me.
// 
// John Hughes
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] Upload Multiple Images

2002-04-11 Thread Beau Lebens

brandon,
you can only ever upload 1 file per file input box, but you can have more
than one of these input fields per form. you might have something like

input type=file name=file1
input type=file name=file2
input type=file name=file3

that way when you are processing (assuming PHP4+) you can use something like

$HTTP_POST_FILES[file2][name]

blah blah

hope that helps.

you will have to check, but i think the MAX_FILESIZE and post_max_filesize
or (whatever they are) variables apply to the *whole* form, so if your
MAX_FILESIZE var is set to 2meg, and you have 3 files uploading, then their
total must not exceed 3meg (i think)

HTH

Beau

// -Original Message-
// From: Brandon Paul [mailto:[EMAIL PROTECTED]]
// Sent: Friday, 12 April 2002 6:06 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Upload Multiple Images
// 
// 
// Hi all...kinda new to PHP and MySQL...anyhow, I have created 
// the following
// table:
// 
// CREATE TABLE images (
//   id smallint(6) NOT NULL auto_increment,
//   image_title varchar(75) default NULL,
//   image_src varchar(150) default NULL,
//   PRIMARY KEY (id)
// ) TYPE=MyISAM;
// 
// I have also created a form that allows me to upload one 
// image at a time, but
// I would like to be able to upload SEVERAL images at once.  
// Directory for
// images is:
// 
// ./_images/(filenames)
// 
// There are also some subdirectories.  What can I do to make 
// it so that I can
// upload all of the images in a directory (or at least more 
// than one) without
// having to type each one in and submit it?
// 
// Your help would be very much appreciated!
// 
// Thanks,
// 
// Brandon Paul
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] saving details problem (big)

2002-04-04 Thread Beau Lebens

Dave,
would it be possible (not ideal, but might work) to do something like this;

 - user fills out form
 - user clicks submit
 - submit fires off 2 events, one submits to AFD server, the other opens a
new window, behind the current, submits certain values (the 3 new ones) and
saves them into the database. this window then automatically closes iteself
once finished
 - whatever happens at AFD then comes back to your next page where you pull
out the last values again and continue working with them

is that feasible for you?

HTH

Beau

// -Original Message-
// From: Dave Carrera [mailto:[EMAIL PROTECTED]]
// Sent: Friday, 5 April 2002 3:11 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] saving details problem (big)
// 
// 
// Hi all
// 
// I am making use of AFD postcode lookup application.
// 
//  
// 
// What it dose is ask for your postcode and returns your address.
// 
// You may have seen this around the web..
// 
//  
// 
// Well my problem is that I have added 3 extra fields 
// 
//  
// 
// Name, email, phone number
// 
//  
// 
// And I need to save this info.
// 
//  
// 
// I have tried sessions and cookies but have just noticed
// 
// That the form action is a cgi file on the afd server. Thus this is
// stopping me
// 
// Saving info.
// 
//  
// 
// Any ideas on how I can save the info.
// 
//  
// 
// I am in a back to the wall situation so any pointer and guidance is
// 
// Most appreciated.
// 
//  
// 
// P.S Had it work all fine and dandy when I added the extra info after
// postcode lookup but customer insisted he wants it this way round.
// Customers...
// 
// (cant live with them, cant live without them...)
// 
//  
// 
// Dave Carrera
// 
// Php Developer
// 
// http://davecarrera.freelancers.net
// 
// http://www.davecarrera.com
// 
//  
// 
//  
// 
// 

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




RE: [PHP-DB] Selecting random record from a database?

2002-04-02 Thread Beau Lebens

SELECT * FROM quotes ORDER BY RAND() LIMIT 1

something like that, take a quick look in the MySQL (or other) docs for the
RAND() function.

HTH

Beau

// -Original Message-
// From: Dan Swensen [mailto:[EMAIL PROTECTED]]
// Sent: Wednesday, 3 April 2002 1:45 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Selecting random record from a database?
// 
// 
// Hi all,
// 
// Does anyone know a quick and easy way to select a random 
// record from a
// database? I'm looking to put together a simple random quote 
// generator, a la
// linux's fortune.
// 
// Any help would be much appreciated.
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] Renaming files after a name in a db field possible?

2002-03-13 Thread Beau Lebens

andy, this should be pretty basic - just try something along the lines of

1. SELECT country/codes from DB [1]
2. loop thru those results [2]
a. check if a file called country code-map.gif exists[3], if it
does,
rename[4] it to matching country name-map.gif
b. if not, output (so you know what has and hasn't worked)
3. done

useful functions
[1] mysql_query(SELECT * FROM countries ORDER BY country_code);

[2] while ($thisCountry = mysql_fetch_array($result)) {

[3] if (file_exists($thisCountry[country_code] . -map.gif)) {

[4] rename($thisCountry[country_code] . -map.gif,
$thisCountry[country] . -map.gif);


HTH

Beau



// -Original Message-
// From: Andy [mailto:[EMAIL PROTECTED]]
// Sent: Wednesday, 13 March 2002 8:47 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Renaming files after a name in a db field possible?
// 
// 
// Hi there,
// 
// I am wondering if this is possible in php:
// 
// I have a whole bunch of files named after countrycodes. E.g. 
// CA-map.gif
// 
// Now I would like to rename those files after the country. 
// This is listed in
// a dbtable containing the countrycode and countryname. E.g. 
// CA - Canada
// 
// How could I generate a php script which scannes the dir for matching
// Countrycode patterns and renames the filename ?
// E.g.: Make out of CA-map.gif - canada-map.gif?
// 
// Thanx for any hint,
// 
// andy
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] Random Selecting from mySQL

2002-03-13 Thread Beau Lebens

could you perhaps do the select on the first page, then store the results in
a session (array) and just load different indexed portions of the resultset
each page?

only problem there is that you wouldn't get any refreshed results while
browsing those pages - but i don't know if this matters for you or not.

HTH

Beau

// -Original Message-
// From: Georgie Casey [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 14 March 2002 3:00 AM
// To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
// Subject: [PHP-DB] Random Selecting from mySQL
// 
// 
// I know how to use the ORDER BY rand() command on the end 
// of queries to
// randomize selection, but that's no good when you want to 
// only display 10
// results per page. The next page the user chooses, randomizes 
// again and could
// show duplicate fields and not at all show other fields.
// 
// Does anyone know a way round this?
// 
// --
// Regards,
// Georgie Casey
// [EMAIL PROTECTED]
// 
// ***
// http://www.filmfind.tv
// Ireland's Online Film Production Directory
// ***
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] GREATEST, LEAST

2002-03-11 Thread Beau Lebens

Is it perhaps actually MAX and MIN?

SELECT MAX(profit) FROM schemes WHERE revenueexpenses

(not tested, confirmed etc :P)

HTH

Beau

// -Original Message-
// From: Jeff Oien [mailto:[EMAIL PROTECTED]]
// Sent: Tuesday, 12 March 2002 10:20 AM
// To: PHP-DB
// Subject: [PHP-DB] GREATEST, LEAST
// 
// 
// Could anyone give me an example of how to use GREATEST
// and LEAST in a MySQL query. I want to look through the 
// last 15 records in a certain field and find the highest and/or 
// lowest number. Thanks.
// Jeff Oien
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] why won't session_start() work?

2002-02-27 Thread Beau Lebens

Ryan,
you need to make all of those calls *before* ANY output has been sent by
your script, otherwise you can't send a header any more. so the TOP of a
script might look like

?php
session_start();
$signor = $monsieur + $madame;
session_register(signor);

// the rest of your code goes here
?
html
?php
// more PHP
?


if you get what I mean. you can actually do a lot of coding before you start
the session if you want, provided you haven't done any echo() print() or
anything that sends information as output.

HTH

beau



// -Original Message-
// From: Ryan Snow [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 28 February 2002 9:06 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] why won't session_start() work?
// 
// 
// 
// when I do:
//   session_start();
//   session_register('signor');
//   session_register('username');
// 
// 
// I get:
// 
// Warning: Cannot send session cookie - headers already sent 
// by (output 
// started at /var/www/html/index.php:3) in
// /var/www/html/index.php on line 14
// 
// Warning: Cannot send session cache limiter - headers already 
// sent (output 
// started at /var/www/html/index.php:3) in
// /var/www/html/index.php on line 14
// 
// Anybody know why?
// 
// Thanks.
// 
// Ry
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] accessing system cmds w/ PHP

2002-02-27 Thread Beau Lebens

JJ,
I seem to recall most people saying that the shorthand works best

$output = `chmod -R 777 *';

HTH

beau

// -Original Message-
// From: Jeremiah Jester [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 28 February 2002 9:37 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] accessing system cmds w/ PHP
// 
// 
// Can anyone tell me how to access linux system commands using 
// php. Tried the
// system() cmd but no luck. Does it require a wrapper to work?Thanks,
// JJ
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] Still bangin my head

2002-02-25 Thread Beau Lebens

you would need to do a select and find out how much is in the account
first, then do a check on the equation to see if the result is going to come
out negative - if it is, then either don't allow it, or give them an option
to clear the account or whatever, otherwise just go ahead and do the
withdrawl.

alternatively on the withdrawl screen, you could tell them how much is in
the account and only allow them to enter a value up to that amount
(javascript) which would kind of pre-empt their stupidity :)

HTH

beau

// -Original Message-
// From: Jennifer Downey [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 25 February 2002 5:00 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Still bangin my head
// 
// 
// Hi all,
// 
// I'm still banging my head on this.
// 
// Let's say I have $1000 to withdraw from my account. I 
// withdraw that $1000
// which leaves me $0 dollars in the account.
// With the code below if I enter another $1000 dollars in the 
// form and hit
// enter it loans me the thousand and puts my account at -$1000 dollars.
// What do I need to do to stop it from loaning me the thousand 
// and keep me
// from having a negative balance?
// 
// 
// TABLE BORDER=0 WIDTH=25% CELLPADDING=0 CELLSPACING=0
// TR
//  TDfont size=2Withdraw/font/TD
//  TD INPUT TYPE=text VALUE= NAME=user_withdraw/TD
// /TR
// TR
//  TD/TD
//  TDINPUT TYPE=submit VALUE=Make My Withdrawal 
// NAME=withdraw/TD
// /TR
// /TABLE
// /FORM
// 
// // used to update if a user makes a withdrawal
// $query = (UPDATE wt_users set bank_points = bank_points - 
// $user_withdraw,
// points = points + $user_withdraw WHERE uid={$session[uid]});
// $result=mysql_query($query);
// 
// // select bank points for the user.
// $sql_result = mysql_query(SELECT bank_points FROM wt_users WHERE
// uid={$session[uid]});
// $row = mysql_fetch_array($sql_result);
// // if bank points are at 0 then print no points and quit.
// if ($sql_result = 0) {
//  echo you don't have that many points;
//  exit;
// } else {
//echo Your withdraw has been made!;
// 
// Thanks again in advance
// 
// Jennifer Downey
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] Delete selected files

2002-02-25 Thread Beau Lebens

your checkboxes should pass a value (probably just the filename) and you
could perhaps name them all filenames[] or something, using the array
trick in PHP, so that on the page you submit to, $filenames will be an array
containing everything that was checked.

you can then loop thru the array and unlink() each filename in there.

HTH

beau

// -Original Message-
// From: Nautilis [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 25 February 2002 10:43 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Delete selected files
// 
// 
// Hi everybody,
// 
// I show a list of files that I upload to the user's folder 
// using the next
// code:
// 
// $path= ../clients/$user;
// $dir = opendir ($root);
// while ($archivo = readdir ($dir))
//{
// $size = filesize($path/$filename);
// $size = ($size/1024);
// $size = intval($size * 100 ) / 100;
// if ($filename!= .  $filename!=..)
// {
// echo trtda
// href='$path/$filename'$filename/a/tdtd$size Kb/td/tr;
// }
// }
// 
// I want to add a checkbox in every file i get in the user's folder. My
// question is:
// 
// Is there any way to use some kind of function to delete 
// selected files? I am
// not sure if i can use javascript to evaluate which is 
// checked and how. And
// after that evaluation, how to call a unlink ($filename) to 
// delete the files.
// 
// Any help would be greatly appreciated.
// 
// Nau
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] Passing contents of array on as variables...

2002-02-25 Thread Beau Lebens

rather than all the hidden fields and stuff you guys are trying to do - why
not just build the array variable you want, then save it into a session, on
the next page, access the session variable and wallah - there's your array,
still in tact and just as you left it (ie. containing all the info you want,
not the word Array)

HTH

beua

// -Original Message-
// From: jas [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 25 February 2002 5:50 PM
// To: [EMAIL PROTECTED]
// Subject: Re: [PHP-DB] Passing contents of array on as variables...
// 
// 
// Bjorn,
// I just wanted to thank you for giving me alot of insight 
// into what I was
// trying to accomplish however, due to time restraints I have 
// decided to do it
// a different way by pulling the entries into a select box 
// that a customer can
// use to delete the different items.  Once again, thanks a ton
// Jas
// 
// Jas [EMAIL PROTECTED] wrote in message
// [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
//  Ok, I think I understand what you are talking about.  So 
// now I know what I
//  need to accomplish, and would you happen to know of a good 
// place to learn
//  about something like this?  For some reason this function 
// keeps seeming to
//  elude me and if you know of a good tutorial on how to 
// accomplish this I
//  would appreciate it.  Thanks again,
//  Jas
//  [EMAIL PROTECTED] wrote in message
//  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
//   One problem I see is that you are sending all of the 
// values for all of
//  your
//   fields (except the id field) from the first page to the 
// second page, not
//  just
//   the ones that are checked, so even if it was working 
// properly, you would
//  get
//   a list of all items in the table, not just the checked 
// items.  You need
// to
//   send the array of id's (since this is the name for the 
// checkbox) from
// the
//   first page to the second one (again in the checkbox form 
// element, you
// did
//  not
//   put a value on it).
//  
//   What your first page is currently doing is pulling all of the
// information
//  out
//   of the database.  Then as soon as you pull each item out, you are
// putting
//  it
//   into an hidden form element array, ie.  $car_type[], 
// $car_model[], etc.
//   regardless of whether the checkbox is checked or not to 
// pass to the next
//   page.  You do not know if the checkbox is checked or not 
// until the next
//  page
//   when it looks at the values in the id array.  On the 
// second page, you
// need
//  to
//   look at the id array and then (through a database call) 
// pull the row
// from
//  the
//   table for each id in the array.
//  
//   HTH
//  
//   MB
//  
//   jas [EMAIL PROTECTED] said:
//  
//$i=0;
//while
//   
// ($car_type[$i],$car_model[$i],$car_year[$i],$car_price[$i],$c
// ar_vin[$i])
//  {
//$i ++;
//}
//Is what I added and this is what is being output to 
// the screen at this
//point...
//=0; while () { ++; }
//now i am still too new to php to understand why it is 
// not putting the
//contents of the array into my hidden fields like it 
// does on my first
//  page (i
//can see them when I view source).
//[EMAIL PROTECTED] wrote in message
//[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
// When you call your $car_type in the second page, you 
// need to set a
//variable
// starting at 0 and call it as $car_type[0] and loop 
// through all of
// the
//values
// in the array.
//
// ie.
//
// $i=0;
// while ($car_type[$i]) {
//
// I have added more code below that should help.
//
// MB
//
//
// jas [EMAIL PROTECTED] said:
//
//  Yeah, tried that and it still isnt passing the 
// contents of the
// array
//  as
//a
//  varible to the confirmation page for deletion.  I 
// am at a loss on
//  this
//one.
//  [EMAIL PROTECTED] wrote in message
//  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
//   You didn't add the value part of the hidden element, ie.
//  
//   INPUT TYPE=\hidden\ NAME=\car_type\
//  value=\$myrow[car_type]\
//  
//   You were naming the field as an array with no value.
//  
//   if you want to pass this as an array of values, 
// you would need
// to
//  use:
//  
//   INPUT TYPE=\hidden\ NAME=\car_type[]\
//  value=\$myrow[car_type]\
//  
//   Give that a try and see if it works.
//  
//   HTH
//  
//   MB
//  
//  
//   jas [EMAIL PROTECTED] said:
//  
//As of right now if you run the php script and 
// view source on
// the
//page
//  you
//can see that it does place the content of db table into
// array...
//  ex.
//BCurrent Inventory/B/fonthr 
// color=33/td/tr
//INPUT TYPE=hidden NAME=car_type[Ford]
//INPUT TYPE=hidden NAME=car_model[Ranger]
//INPUT TYPE=hidden NAME=car_year[1999]
//INPUT 

[PHP-DB] SELECT where something exists but something else does not

2002-02-20 Thread Beau Lebens

Hey guys,
I am a little stuck here, i know how to botch a solution together using a
bunch of queries and PHP manipulation, but i am sure there is a more elegant
way to do this one;

i have some tables (i won't put their full defs, just bits that are relevant
(they are huge))

TABLE students
FIELDS
studentID
fname
lname
title
studentNo

TABLE theses
FIELDS
thesisID
studentID
title

TABLE thesis_reports
FIELDS
reportID
thesisID
year


now, what we are dealing with here is records of theses and the reports that
students are required to submit relating to them (yearly). i need to be able
to pull up a record of students who have a record of a thesis (something in
table theses) but do NOT have an entry in thesis_reports for this year
yet.

an attempt at some SQL that sort of pretends to do the right thing :)

SELECT DISTINCT(students.studentID), students.title, students.fname,
students.lname, students.studentNo FROM students, theses, thesis_reports
WHERE theses.studentID=students.studentID AND
thesis_reports.thesisID=theses.thesisID AND thesis_reports.year != '2002'

does that make sense?
what it actually returns is just any student with any record in the DB under
thesis_reports that doesn't eqal '2002', even if they happen to also have
one that *is* for 2002 (ie. my test student has a report for 1999, 2001 and
2002, but still gets selected by that


-- 
Beau Lebens, Technical Officer
Science and Mathematics Education Centre
Curtin University of Technology,
GPO Box U1987 Perth, Western Australia 6845
CRICOS provider code 00301J

t: +61 8 9266-7297 (has voice-mail)
f: +61 8 9266-2503 (ATT: Beau Lebens)
e: [EMAIL PROTECTED]
w: http://learnt.smec.curtin.edu.au/

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




RE: [PHP-DB] Join

2002-02-20 Thread Beau Lebens

what you are referring to actually has nothing to do with PHP Jen - that's
why the manual wasn't much help :)

JOIN is an SQL command, so check out the manual of your RDBMS (ie.
http://www.mysql.com/doc/J/O/JOIN.html for MySQL)

good luck :)

Beau

// -Original Message-
// From: Jennifer Downey [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 21 February 2002 10:47 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Join
// 
// 
// Could someone point me in the right direction for joining 
// tables? I have
// searched the php manual for it but only found info on joining arrays.
// 
// If someone could point me to a code snip or a tutorial I would much
// appreciate it.
// 
// Thanks in advance
// 
// Jen Downey
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] formating problem

2002-02-19 Thread Beau Lebens

htat's because the delete button is in the wrong place in your code.

if you put an HTML element between the table and /table tags, but don't
enclose it in at least tr and td tags (pretty loose about closing them,
but of course you should always close your tags!) then the browser will
display that element above the table - since it doesn't really know where
you want it placed.

long story short, replace the last little section of your code with

echo tr\ntd colspan=\2\ align=\center\input type=\submit\
name=\delete\
value=\delete\/td\n/tr\n\n/form/table;
?

and PS. i don't know if you are doing it by mistake or intentionally, but
you may have noticed that form elements cause a certain amount of space to
be taken up because the browser decides to render them as a br or
something for some reason. if you put the form and /form elements
BETWEEN a tr and a td or a table and a tr or something (i.e. not
properly located in a td/td pair) then this formatting is not displayed
for some reason - go figure.

enjoy

beau


// -Original Message-
// From: jas [mailto:[EMAIL PROTECTED]]
// Sent: Tuesday, 19 February 2002 7:13 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] formating problem
// 
// 
// I feel kinda dumb for posting this but here it is... I am 
// trying to query a
// table then format the results so it looks like the rest of 
// the site and the
// darn delete button to remove db entries keeps showing up at 
// the top.  Here
// is the code... Thanks in advance.
// Jas
// ?php
// require '../scripts/db.php';
// $result = mysql_query(SELECT * FROM cur_inv,$dbh) or die(Could not
// execute query, please try again later);
// echo table border=\0\ class=\table-body\ width=\100%\form
// name=\rem_inv\ method=\post\ action=\done2.php3\
// trtd align=\center\ colspan=\2\font size=\4\BCurrent
// Inventory/B/fonthr color=\33\/td/tr;
// $count = -1;
// while ($myrow = mysql_fetch_row($result)) {
// $count ++;
// echo trtd width=\30%\BType Of Car: /B/tdtd;
// printf(mysql_result($result,$count,car_type));
// echo /tdtdinput type=\checkbox\ name=\car_type\
// value=\checkbox\remove/td
// /tr\n;
// echo trtd width=\30%\BModel Of Car: /B/tdtd;
// printf(mysql_result($result,$count,car_model));
// echo /td/tr\n;
// echo trtd width=\30%\BYear Of Car: /B/tdtd;
// printf(mysql_result($result,$count,car_year));
// echo /td/tr\n;
// echo trtd width=\30%\BPrice Of Car: /B/tdtd$;
// printf(mysql_result($result,$count,car_price));
// echo /td/tr\n;
// echo trtd width=\30%\BVIN Of Car: /B/tdtd;
// printf(mysql_result($result,$count,car_vin));
// echo /td/trtrtd colspan=\3\hr 
// color=\33\/td/tr\n;
// }
// echo input type=\submit\ name=\delete\
// value=\delete\/form/table;
// ?
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] sql query

2002-02-18 Thread Beau Lebens

try replacing

WHERE display=$custcatergory);

with

WHERE display='$custcatergory');

and also tru echoing the value of that SQL statement (assign it to a var
first) to make sure you are getting the right thing.

HTH

/b

// -Original Message-
// From: CrossWalkCentral [mailto:[EMAIL PROTECTED]]
// Sent: Tuesday, 19 February 2002 9:31 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] sql query
// 
// 
// I am having a minor problem doing a simple sql query. 
// 
// Error performing service query : You have an error in your 
// SQL syntax near '' at line 1
// 
// Here is a snip of the code: Please let me know what you think.
// 
// if ($submit):
// 
// $status=0;
// 
// // REQUEST INFO FOR SERVICES
// $results = mysql_query(
// SELECT * FROM supportsyscat WHERE display=$custcatergory);
// if (!$results) {   
// echo(PError performing service query :  .
// mysql_error() . /P);
// exit();
// }
// 
// // Display the text
// while ( $rows = mysql_fetch_array($results) ) {
// $dservice=$rows[display];
// $eservice=$rows[address];
// }
// 
// 
// $sql = UPDATE supportsys SET  .
//pdes='$custpdes',  .
//sdes='$adminsdes',  .
//status='$status'  .
//WHERE ticket=$ticketnum;
// 
// if (mysql_query($sql)) {
// Echo(centerPh4Ticket #$ticketnum has been 
// updated./h4/P/center);
// Echo(Thank you $custfname $custlname);
// Echo(pProblem: $custpdes/P);
// 
// 
// if ($statusclose ==true) {
// $status=Closed;
// } else {
// $status =Open;
// }
// 
// 

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




RE: [PHP-DB] Session confusion :-(

2002-02-17 Thread Beau Lebens

are you always refreshing the session on each page dave?

i am pretty sure you need to call session_start() on every page that you
will be accessing the session-based variables.

HTH

beau

// -Original Message-
// From: Dave Carrera [mailto:[EMAIL PROTECTED]]
// Sent: Saturday, 16 February 2002 10:56 PM
// To: php List
// Subject: [PHP-DB] Session confusion :-(
// 
// 
// Hi All
// 
// I am send variable values via set links i.e.:
// 
// http://domian_name.com/page.php?category=1
// 
// http://domian_name.com/page.php?category=2
// 
// http://domian_name.com/page.php?category=3
// 
// Etc etc
// 
// The value is sent to a session. THIS WORKS BUT.
// 
// If I click on the first link session variable category is set to 1.
// 
// But if I then click on the send , third, forth or whatever link
// Session variable is still set to 1.
// 
// I have tried
// 
// If(ISSET($category)){
// Unset($category);
// Session_register(category) // hoping it would accept the new 
// sent value.
// }
// 
// No Go
// 
// Can anyone throw some light on this please.
// 
// As Always I am grateful for any pointers or exampled help
// 
// :-)
// 
// Dave Carrera
// Php / MySql Development
// Web Design
// Site Marketing
// http://www.davecarrera.com
//  
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] RE: Logging visits using a database

2002-02-14 Thread Beau Lebens

i think i saw an article on phpbuilder.com regarding how to set up a good
thing for the path taken - something along the lines of storing IP vs time
vs page hit, then a good method for selecting from the db that shows the
path of the visitor

HTH

beau

// -Original Message-
// From: Peter Lovatt [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 14 February 2002 4:39 PM
// To: Gurhan Ozen; Peter Lovatt; [EMAIL PROTECTED]
// Subject: [PHP-DB] RE: Logging visits using a database
// 
// 
// Thanks.
// 
// Analog only does basic 'what files have people viewed?' type 
// reports, which
// offers some of the insight I am looking for, but not the 
// path through the
// site etc. Also the output confuses non techies. Any other thouhts?
// 
// TIA
// Peter
// 
// ---
// Excellence in internet and open source software
// ---
// Sunmaia
// www.sunmaia.net
// [EMAIL PROTECTED]
// tel. 0121-242-1473
// ---
// 
//  -Original Message-
//  From: Gurhan Ozen [mailto:[EMAIL PROTECTED]]
//  Sent: 14 February 2002 03:09
//  To: Peter Lovatt; [EMAIL PROTECTED]
//  Subject: RE: Logging visits using a database
// 
// 
//  Hi
//  I have never used it but sounds like analog would fit your 
// needs pretty
//  well. Check them out at:
//  http://analog.sourceforge.net/
// 
//  Hope this helps..
// 
//  Gurhan
// 
// 
//  -Original Message-
//  From: Peter Lovatt [mailto:[EMAIL PROTECTED]]
//  Sent: Wednesday, February 13, 2002 6:29 PM
//  To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
//  Subject: Logging visits using a database
// 
// 
//  Hi
// 
//  Excuse the cross post
// 
//  I am thinking about building a logging tool to do visit analysis
//  using SQL,
//  rather than doing log file analysis.
// 
//  The aim is to analyse requests for dynamic pages called 
// via php as well as
//  static pages. Static pages will use an include for 
// logging. Php calls may
//  have two or three extra parameters which relate to 
// products that are
//  displayed (this is for ecommerce) which I also want to 
// log. I am looking
//  particularly at HTTP_REFERER, paths through the site, and 
// most viewed
//  products.
// 
//  Questions
// 
//  1. Am I reinventing the wheel? and would it be better to 
// buy a package
//  (Spending money brings me out in a nasty rash, and leaves 
// me feeling a
//  little unsteady on my feet, but is sometimes the best option), or
//  use a free
//  one. The intended audience is non technical managerial type bods
//  so nothing
//  too difficult to understand :)
// 
//  2. If I do use an existing package, are there any that are good
//  with dynamic
//  sites and the parameters passed to scripts, rather than just
//  logging static
//  pages?
// 
//  3. Writing a database driven stats package on a medium 
// traffic site (3-500
//  visits a day, Average 8-12 pages per visit=6000 inserts a 
// day, peaking at
//  2-3 per second ) will mean lots of inserts, and a few 
// reads when the
//  analysis is run. Running MySql on a 1.5GHz 512MB machine, 
// is it better to
//  leave the table unindexed and put up with slow analysis, or will
//  the machine
//  cope with indexes? The data could be aggregated 
// periodically, but if
//  possible left intact for up to a year to follow trends.
// 
//  4. Is a (MySql?) database driven system a good answer, or just
//  the wrong way
//  to go??
// 
//  Any thoughts and experience much appreciated before I 
// commit to hours of
//  work and gallons of coffee
// 
//  Thanx
// 
//  Peter
// 
// 
//  ---
//  Excellence in internet and open source software
//  ---
//  Sunmaia
//  www.sunmaia.net
//  [EMAIL PROTECTED]
//  tel. 0121-242-1473
//  ---
// 
// 
//  
// -
//  Before posting, please check:
// http://www.mysql.com/manual.php   (the manual)
// http://lists.mysql.com/   (the list archive)
// 
//  To request this thread, e-mail [EMAIL PROTECTED]
//  To unsubscribe, e-mail
//  [EMAIL PROTECTED]
//  Trouble unsubscribing? Try: 
http://lists.mysql.com/php/unsubscribe.php


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

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




RE: [PHP-DB] Email Validation

2002-02-11 Thread Beau Lebens

have a look at the online annotated php manual under the regular expression
functions, there are *stacks* of examples of using regexps to validate email
patterns

beau

// -Original Message-
// From: CrossWalkCentral [mailto:[EMAIL PROTECTED]]
// Sent: Tuesday, 12 February 2002 12:20 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Email Validation
// 
// 
// I am working on a form that I have in php and am looking for 
// some advise on form validation or specifically email address 
// validation so i can insure that some one has put in a 
// properly formatted email address
// 

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




RE: [PHP-DB] protecting

2002-02-11 Thread Beau Lebens

you might find the library at http://www.dentedreality.com.au/jsvalidation/
useful, but you should also perform similar checks server-side using PHP
since if you are that worried about malicious use of your site, people can
easily circumvent javascript validation

// -Original Message-
// From: Mihail Bota [mailto:[EMAIL PROTECTED]]
// Sent: Tuesday, 12 February 2002 12:19 PM
// To: CrossWalkCentral
// Cc: [EMAIL PROTECTED]
// Subject: Re: [PHP-DB] protecting
// 
// 
// put some javascript validation form. if the value of the form cntains
// .jpg, etc. don't allow the user to go further.
// 
// On Mon, 11 Feb 2002, CrossWalkCentral wrote:
// 
//  How can I help protect people form modifying a form that 
// submits data to php file that stores the data in a database
//  
//  for example I have a text box that ask for a first name 
// and I am getting a lot of garbage back like if they modified 
// my form and submitted a image instead.
//  
//  I know that their is some sort of parse out their that I 
// can put in the php file that will help validate this
//  
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] javascipt window

2002-02-10 Thread Beau Lebens

Mike, you have a conflict with your different quote-styles, have a look at
the source code when you output that and you will see what i mean, you need
to do something like this;

echo td ALIGN=\CENTER\a
href=\javascript:launchwin('$row[5].htm','newwindow','height=480,width=640'
);\.$format./a/td/tr;

HTH

Beau

// -Original Message-
// From: Mike [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 11 February 2002 11:39 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] javascipt window
// 
// 
// I am wondering why the following will not launch a window 
// using javascript.
// I have tried escaping the Html  at various points with no success:
// 
// echo td ALIGN='CENTER'a
// href='javascript:launchwin('$row[5].htm','newwindow','height=
// 480,width=640')
// '.$format./a/td/tr;
// 
// the href works fine when I am linking to a normal page.
// Thanks for any help.
// --
// Mike
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, visit: http://www.php.net/unsub.php
// 

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




RE: [PHP-DB] More Date operations.

2002-01-31 Thread Beau Lebens

you have changed the command from when you do it in mysql to when you do it
in php - you are leaving out the ' quote marks around the date you are
passing :)

//   $sql=SELECT TO_DAYS(2001-01-01) AS bar;
should be
//   $sql=SELECT TO_DAYS('2001-01-01') AS bar;

HTH

beau


// -Original Message-
// From: Garry Optland [mailto:[EMAIL PROTECTED]]
// Sent: Friday, 1 February 2002 2:12 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] More Date operations.
// 
// 
// Hi,
// 
// I am trying to access the MySQL function TO_DAYS() from PHP.
// 
// From MySQL I can type in: SELECT TO_DAYS('2000-1-1') AS bar;
// 
// and I get:
// 
// ++
// | bar|
// ++
// | 730485 |
// ++
// 1 row in set (0.00 sec)
// 
// From PHP, I have tried:
// 
//   $sql=SELECT TO_DAYS(2001-01-01) AS bar;
//   $result=mysql_query($sql) or die(Could not access database);
//   $days=mysql_fetch_array($result);
//   echo days: .$days[bar].br;
// 
// But I don't get the result coming through.
// 
// I have tried mysql_field_name and the name comes across as bar.
// 
// mysql_num_rows shows that there is one row in the result. 
// 
// Am I missing something really really obvious? 
// 
// Regards,
// Garry.
// 
// 
// 
// -- 
// PHP Database 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 Database 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-DB] drop down list

2002-01-30 Thread Beau Lebens

apologies for answering such an already-over-answered question, but i feel
that no-one has given a particularly *good* answer, so i'll add mine to the
list. I use this function (as well as a couple others which do similar
things for all form elements;

// Creates an HTML select box of values.
// $options can be one or two dimensional, if one then indexes 0+ are used
as values
// $misc contains any key/value pairs you want added to the tag as
attributes, such
// as class, style or multiple attributes.
function display_select($name, $options, $value = 0, $misc = unset) {
$select = select;
if (strlen($name))
$select .=  name=\ . $name . \;
if (is_array($misc))
while (list($id, $val) = each($misc))
$select .=   . $id . =\ . $val . \;
$select .= ;
if (is_array($options)) {
while (list($id, $val) = each($options)) {
$select .= \noption;
$select .=  value=\ . $id . \;
if (strcmp($id, $value))
$select .= ;
else
$select .=  selected;
$select .= htmlspecialchars($val) . /option;
}
}
$select .= \n/select;
return $select;
}




// -Original Message-
// From: B.J.Rumsey [mailto:[EMAIL PROTECTED]]
// Sent: Wednesday, 30 January 2002 2:30 PM
// To: php-db
// Subject: [PHP-DB] drop down list
// 
// 
// I have two fields artist_id, artist.  How do I put the 
// contents of artist into a dropdown list.
// 
// 
// -- 
// PHP Database 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 Database 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-DB] HTTP authentication

2002-01-20 Thread Beau Lebens

not that this has anything to do with databases... ([php-db])

assuming;
1. you are using apache
2. you have command-line access to your server
3. your webhost has htaccess enabled and configured to use .htaccess as
the security file

you should be able to drop a file called (usally) .htaccess into the
directory you want to secure. you then go to the command line and do
something like

$ htpasswd -c /home/you/htbin/.htpasswd username

which creates (-c) the password file (/home/you/htbin/.htpasswd) and adds a
user called username to it. when you hit enter it will ask for a password
(twice).

now the .htaccess file which is in your to-be-secured directory needs to
look something like this;

 snip
AuthUserFile /path/to/htpasswd/file
AuthName Name to Appear in Box
AuthType Basic

Limit GET POST
require valid-user
/Limit
 snip

that example looks in /path/to/htpasswd/file and confirms that the
user/pass combintation is a valid-user (any valid combo from the file) and
if so, allows them access.

you can get more information on all of this in the apache docuemntation at
apache.org, search for htaccess and you might also be interested in the
groups ability of the system, so search for htgroup (i think)

hth

beau


// -Original Message-
// From: news.php.net [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 21 January 2002 3:36 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] HTTP authentication
// 
// 
// Heya,
// 
// I'm trying to find out how http header authentication works. 
// For some reason
// my webserver won't do it on a directory basis. But the 
// problem is that the
// documentation that came along with the PHP package doesn't 
// help me much.
// 
// Can you guys give me a working example on how to use and 
// implement it?
// 
// I would really appreciate it,
// 
// Kevin
// 
// 
// 
// -- 
// PHP Database 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 Database 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-DB] HTTP authentication

2002-01-20 Thread Beau Lebens

in that case, check the php manual under the section titled

Features - HTTP Authentication With PHP

there is a nice example, which you should be able to modify to do things (i
have it working with pulling details from an XML file and then using them as
the required user/pass for authentication)

http://www.dentedreality.com.au/webpad/

if you download and install, then you need to use admin/admin as the
user/pass for the first time you modify the system settings. (it has zero
docuemntation so far :)

have fun

beau

// -Original Message-
// From: news.php.net [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 21 January 2002 10:17 AM
// To: [EMAIL PROTECTED]
// Subject: Re: [PHP-DB] HTTP authentication
// 
// 
// Dear Beau,
// 
// Thanks for your answer, and indeed.. it doesn't have too 
// much to do with
// databases, although if an example of authentication using a 
// database would
// be great.
// 
// And I was a bit vague on which webserver (indeed Apache). 
// And I do have
// command line access. However in my initial message I said 
// that directory
// authentication (with .htaccess) doesn't work. And I've tried 
// more than once
// to get it to work.
// 
// So if you could still help me, or anyone else I would 
// greatly appreciate it!
// 
// Yours,
// 
// Kevin
// Beau Lebens [EMAIL PROTECTED] wrote in message
// news:[EMAIL PROTECTED].
// edu.au...
//  not that this has anything to do with databases... ([php-db])
// 
//  assuming;
//  1. you are using apache
//  2. you have command-line access to your server
//  3. your webhost has htaccess enabled and configured to use 
// .htaccess as
//  the security file
// 
//  you should be able to drop a file called (usally) 
// .htaccess into the
//  directory you want to secure. you then go to the command 
// line and do
//  something like
// 
//  $ htpasswd -c /home/you/htbin/.htpasswd username
// 
//  which creates (-c) the password file 
// (/home/you/htbin/.htpasswd) and adds
// a
//  user called username to it. when you hit enter it will ask for a
// password
//  (twice).
// 
//  now the .htaccess file which is in your to-be-secured 
// directory needs to
//  look something like this;
// 
//   snip
//  AuthUserFile /path/to/htpasswd/file
//  AuthName Name to Appear in Box
//  AuthType Basic
// 
//  Limit GET POST
//  require valid-user
//  /Limit
//   snip
// 
//  that example looks in /path/to/htpasswd/file and 
// confirms that the
//  user/pass combintation is a valid-user (any valid combo 
// from the file)
// and
//  if so, allows them access.
// 
//  you can get more information on all of this in the apache 
// docuemntation at
//  apache.org, search for htaccess and you might also be 
// interested in the
//  groups ability of the system, so search for htgroup (i think)
// 
//  hth
// 
//  beau
// 
// 
//  // -Original Message-
//  // From: news.php.net [mailto:[EMAIL PROTECTED]]
//  // Sent: Monday, 21 January 2002 3:36 AM
//  // To: [EMAIL PROTECTED]
//  // Subject: [PHP-DB] HTTP authentication
//  //
//  //
//  // Heya,
//  //
//  // I'm trying to find out how http header authentication works.
//  // For some reason
//  // my webserver won't do it on a directory basis. But the
//  // problem is that the
//  // documentation that came along with the PHP package doesn't
//  // help me much.
//  //
//  // Can you guys give me a working example on how to use and
//  // implement it?
//  //
//  // I would really appreciate it,
//  //
//  // Kevin
//  //
//  //
//  //
//  // --
//  // PHP Database 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 Database 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 Database 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-DB] Easy way to calculate difference between two dates

2002-01-20 Thread Beau Lebens

soo what happens with php if you do something like convert them both to 

Y-m-d H:i:s

and then subtract one from the other, i have a feeling (haven't tried) that
php will handle the rest for you...

// -Original Message-
// From: SpamSucks86 [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 21 January 2002 10:19 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Easy way to calculate difference between two dates
// 
// 
// Is there an easy way to calculate the difference between the current
// date and a date prior to January 1, 1970 (unix epoch). Just 
// getting the
// timestamp and then subtracting the other date from it won't 
// work because
// it will be a negative number. Any insight? I think this can 
// be done very
// easily in ASP (built in function? But I don't know ASP, it's 
// just what I
// heard). Thanks for your help =)
// 

-- 
PHP Database 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-DB] Reading and Writing ?

2002-01-17 Thread Beau Lebens

easy peasy dave :) (pseudo-code - cause i'm lazy and hopefully you aren't
:P)

?php[esque]

create file pointer to file 1 (read-only r?)

read file 1 into string

close file pointer to file 1

create file pointer to file 2 (creating if necessary (w))

write string from file 1 to this pointer

close pointer to file 2

?


// -Original Message-
// From: Dave Carrera [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 17 January 2002 4:21 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Reading and Writing ?
// 
// 
// Hi All
// 
// How can I read the contents of 1 file then Write those contents to a
// newfile?
// 
// This is baffling me.
// 
// I Know about fopen,fread,fwrite but cant seem to get the 
// logical steps clear
// in my head.
// 
// As always any help or pointers given are most appreciated.
// 
// Yours
// 
// Dave C
// 
// 
// 
// -- 
// PHP Database 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 Database 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-DB] Connecting from PHP to MySQL on another Server

2002-01-17 Thread Beau Lebens

// 1. What is the difference between working with PHP and MySQL 
// on a local
// server and working with PHP and MySQL when MySQL is on a 
// remote server?

none - just specify different hostname in connection call (perhaps IP more
reliable)


// 2. What is the protocol used to connect to MySQL on a local 
// server and
// what is the protocol used to connect to a remote MySQL server?

TCP/IP?


// 3. Is there a difference in performance between connecting 
// from PHP to
// MySQL on a remote server or PHP to MSSQL Server?

don't know about this one - guess would be that MySQL is faster, since it's
more lightweight and PHP seems to have been developed in tandem with it
(LAMPS, PHP Triad etc)

HTH

-b


// 
// thanks
// 
// berber
// 
// -- 
// PHP Database 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 Database 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-DB] Updating multiple rows from a single form submission

2002-01-17 Thread Beau Lebens

Hi John - I have come up against this one a number of times, and have found
that the following works pretty nicely - although there may be better ways
out there


 - get your records from the db
 - loop thru them, using some sort of ID field to print each row in your
table with names something like;
fieldname| . $ID
 - each field obviously can be edited to whatever, then the whole thing is
submitted

now, when submitted (either back to itself or to another script or whatever)
 - loop thru $HTTP_POST/GET_VARS
 - when you find, say title| . $ID, which might actually appear as
$HTTP_POST_VARS[title|4] then you can process and update that
entire record, i have copy-pasted a snippet of code below, hope that helps


?php
[snip other code]

else if ($save) {
foreach ($HTTP_POST_VARS as $name=$value) {
if (substr($name, 0, 12) == description|) {
$descriptionID = substr($name, 12);
$SQL = UPDATE fee_descriptions SET title='$value'
WHERE descriptionID='$descriptionID';
if ($updated = db_query($SQL))
$msg = urlencode(Fee Descriptions
successfully updated.);
else
$msg = urlencode(There was an error
updating the Fee Descriptions, please try again.);
}
}
}
?


hope some of those ramblings help

beau


// -Original Message-
// From: John Hawkins [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 17 January 2002 4:41 PM
// To: php-db list
// Subject: [PHP-DB] Updating multiple rows from a single form 
// submission
// 
// 
// Hi again!
// 
// I have a MySQL table named ratings. It has 5 fields in
// it like this:
// ID, name, deposit, days, hands
// 
// The table has 10 rows in it with assorted data in each
// field.
// 
// Here is what I would like to to:
// 
// 1. Display all 10 rows of data on the page in a table
// with the fields deposit, days and hands in form input
// boxes so the numbers inside can be edited.
// 2. After all the numbers are updated and the user hits
// submit, I would like to have the database updated with
// all the data entered for all rows.
// 
// Doing this type of thing for a single record at a time
// is a no brainer. But, when it comes to doing it for
// multiple entries at a single time, I am a bit stumped.
// 
// Here are my questions:
// - What do I name the form fields?
// - Upon processing, how do I ensure it writes the
// proper data to the proper record?
// 
// Thanks for your help!
// 
// John
// 
// __
// Do You Yahoo!?
// Send FREE video emails in Yahoo! Mail!
// http://promo.yahoo.com/videomail/
// 
// -- 
// PHP Database 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 Database 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-DB] Web Poll Using sql

2002-01-17 Thread Beau Lebens

Jacob,

I think you can do something like

UPDATE tablename SET fieldD=fieldD+1 WHERE pollTitle='title';

or similar?

check the manual on updates and mathematical functions probably

-b

// -Original Message-
// From: Jacob Wyke [mailto:[EMAIL PROTECTED]]
// Sent: Friday, 18 January 2002 11:20 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Web Poll Using sql
// 
// 
// Hi,
// 
// I know this must sound like a really easy question, but im 
// trying to create
// a simple web poll, where you choose your answer from a radio 
// button and then
// click submit.
// 
// On submitting I would like to update a sql table depending 
// on what box the
// user clicked.
// 
// How can I make it so it increments a table row by one??
// 
// So say I click option D, I want Row D in my table Poll to be 
// incremented by
// one.
// 
// Hope you can help me.
// 
// Thanks in advance for any help I receive.
// 
// 
// _
// Do You Yahoo!?
// Get your free @yahoo.com address at http://mail.yahoo.com
// 
// 
// -- 
// PHP Database 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 Database 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-DB] Combining INSERT...SELECT and INSERT INTO

2002-01-16 Thread Beau Lebens

if you are using mysql then no i don't think you can do that, since it
doesn't support nested queries - postgres or some other db may well support
it tho

but like miles said - give it a go :) (maybe on a test database/table just
in case)

hth

-b

// -Original Message-
// From: Markus Lervik [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 14 January 2002 6:54 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Combining INSERT...SELECT and INSERT INTO
// 
// 
// Hello!
// 
// It's me again, with the magazine database : )
// 
// Is there any way to combine INSERT...SELECT and INSERT INTO so
// one could insert a new row with a few values inserted by 
// hand and others
// from another table? something like
// 
// INSERT INTO mag_table (mag_id,issn,year,info,volume,numbers,remarks) 
// VALUES  ( (SELECT id FROM mag_names WHERE mag_names.name=Asdf),
// 1234-5678,2001,foobar,1-4,1-52,foobar);
// 
// I'm trying to construct myself a nice clever INSERT statement to my
// web-frontend. Haven't got it to work, though. Is this even possible?
// The other option would be to use three(?) mysql_query calls 
// from my PHP-code,
// but I'd like to keep it as simple as possible.
// 
// Cheers,
// Markus
// 
// -- 
// Markus Lervik
// Linux-administrator with a kungfoo grip
// Vaasa City Library - Regional Library
// [EMAIL PROTECTED]
// +358-6-325 3589 / +358-40-832 6709
// 
// -- 
// PHP Database 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 Database 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-DB] What is REG_BADRPT, and why do I get it?

2002-01-16 Thread Beau Lebens

on a guess - echo the value of $search_name in between each call to see what
happens to it as it goes through - you may find that something is going
haywire in there somewhere (or that it's blank)

-b

// -Original Message-
// From: Markus Lervik [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 14 January 2002 9:42 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] What is REG_BADRPT, and why do I get it?
// 
// 
// 
// Hello!
// 
// I have quite a weird problem. When I use ereg or ereg_replace
// I get a REG_BADRPT warning, like so : 
// 
// Warning: REG_BADRPT in /var/www/html/mag/search.php on line 35
// Warning: REG_BADRPT in /var/www/html/mag/search.php on line 36
// 
// The offending lines are
// 
// if(ereg(*,$search_name)) { ereg_replace(*,%,$search_name); }
// if(ereg(?,$search_name)) { ereg_replace(?,_,$search_name); }
// 
// but just two lines above them I have
// 
// if(ereg(*,$search_id)) { ereg_replace(*,%,$search_id); }
// if(ereg(?,$search_id)) { ereg_replace(?,_,$search_id); }
// 
// and two similar lines of code below them, yet PHP doesn't complain 
// about them. Anyone have any ideas as to what's causing the warning?
// 
// 
// Cheers,
// Markus
// 
// -- 
// Markus Lervik
// Linux-administrator with a kungfoo grip
// Vaasa City Library - Regional Library
// [EMAIL PROTECTED]
// +358-6-325 3589 / +358-40-832 6709
// 
// -- 
// PHP Database 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 Database 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-DB] Problem with mail function

2002-01-16 Thread Beau Lebens

also - rather than change the ini file, you can just put

?php
set_time_limit(43200);
?

which gives the script 12 hours to run (or however you think you need)

i have a simple script for mailing out bulk mail done in php - it has
successfully worked on 700 emails so far - so it works :)

-b

// -Original Message-
// From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
// Sent: Tuesday, 15 January 2002 1:52 AM
// To: Faye Keesic
// Cc: [EMAIL PROTECTED]
// Subject: Re: [PHP-DB] Problem with mail function
// 
// 
// Is it the ole 30-second timeout thang?  Changeable in php.ini?
// 
// On Mon, 14 Jan 2002, Faye Keesic wrote:
// 
//  Hi there...
// 
//  I have a problem mailing out approx. 180 emails (no 
// attachments) using the
//  mail() php function.  I loop through the email table once, 
// sending the email
//  to everyone in the list.
// 
//  The problem is that my page seems to time out when I send 
// the emails, and it
//  refreshes itself.  So if I don't manually stop the browser 
// after say, 10
//  seconds, the recipients in the email table get the email 
// more than one time.
// 
//  Maybe I shouldn't be trying to send that many emails at a 
// time. I am on
//  apache using mysql and php...
//  --
//  Faye Keesic
//  Computer Programmer Analyst/Web Page Design
// 
// 
//  --
//  PHP Database 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 Database 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 Database 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-DB] Optimizing mail()

2002-01-16 Thread Beau Lebens

hey olinux - 
i did something like this with a mailing list thing i have for a website
(insertfashionhere.com - about to be relaunched) and all i did was ordered
the emails to be sent by their server - as you have said.

mine were in a database, so in my select i did something liek

SELECT email, name, SUBSTRING_INDEX(email, '@', 1) as domain FROM mailing
ORDER BY domain

or something, which would return something like

+-+---++
| email   | name  | domain |
+-+---++
| [EMAIL PROTECTED]  | beau  | @curtin.edu.au |
| [EMAIL PROTECTED]   | jim   | @curtin.edu.au |
| [EMAIL PROTECTED]  | john  | @curtin.edu.au |
| [EMAIL PROTECTED]  | kiko  | @yahoo.com |
+-+---++

and it seemed to mail faster than if it was in random order.

hope that helps

-b


// -Original Message-
// From: olinux [mailto:[EMAIL PROTECTED]]
// Sent: Tuesday, 15 January 2002 10:57 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Optimizing mail()
// 
// 
// Just came across this post and wondered if anyone has
// done this - if so can you share some code?
// 
// The idea is to order emails by the mailservers
// 
// Would you just order the emails by domain name? [that
// would group all aol.com, msn.com, yahoo.com emails]
// 
// http://www.faqts.com/knowledge_base/view.phtml/aid/300/fid/21
// 
// Thanks,
// olinux
// 
// __
// Do You Yahoo!?
// Send FREE video emails in Yahoo! Mail!
// http://promo.yahoo.com/videomail/
// 
// -- 
// PHP Database 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 Database 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-DB] Searching a variable

2002-01-16 Thread Beau Lebens

i don't doubt that there are probably better ways of going about this chris,
but you can do something like;

?php
$words = explode( , $searchText);

$query = SELECT * FROM table WHERE ;
foreach ($words as $word) {
$query .= field LIKE '%word%' AND ;
}
$query .= field!='' ORDER BY something;

$results = mysql_query($query);
?

as for ranking the results - i have heard people mentioning the fulltext
index in mysql, and there's some cool calculations floating around in the
archives somewhere, but they escape me at the moment and i haven't got
around to implementing a decent search engine yet :)

// -Original Message-
// From: Chris Payne [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 17 January 2002 10:34 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Searching a variable
// 
// 
// Hi there everyone,
// 
// Thanks for all the help recently everyone, it's very 
// appreciated.  I just have one last question if that's ok :-)
// 
// I have a string taken from a form, now this string could 
// contain 1 word or it would contain 10, what I need to know 
// is how do I search a DB for each word in the string?  I have 
// a simple search engine which works great for works next to 
// each other in the DB but I need it to search each entry for 
// ALL words entered, whether they are next to each other in 
// the DB or 3 words apart, how can I do this?
// 
// Thanks for all your help.
// 
// Regards
// 
// Chris Payne
// www.planetoxygene.com
// 

-- 
PHP Database 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-DB] Can't use field names in print

2002-01-13 Thread Beau Lebens

you need to use the *_fetch_array() functions

i.e. if you are using MySQL

$SQL = something; // build SQL query
$result = mysql_query($SQL); // execute query, save all results in $result
$firstResult = mysql_fetch_array($result); // create an array containing
each returned record

// subsequent calls to mysql_fetch_array($result) will get each record

HTH

Beau
PS please excuse email butchering my single-line comments :)


// -Original Message-
// From: planomax [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 14 January 2002 10:13 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Can't use field names in print
// 
// 
// To output each row, this works:
// 
// print($row[0] - $row[1] - $row[2]br);
// 
// But using the table's field names, I don't see anything:
// 
//   $ID=$row[ID];
//   $test1=$row[test1];
//   $test2=$row[test2];
//   print ($ID - $test1 - $test2br);
// 
// I'm used to using Cold Fusion and want to learn PHP.  Any 
// help would be
// appreciated.  Thanks.
// Pete
// 
// 
// 
// -- 
// PHP Database 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 Database 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-DB] Can't use field names in print

2002-01-13 Thread Beau Lebens

you should be able to just change the mysql_fetch_row to a mysql_fetch_array
and then use the names rather than the numbers in your print (modified
below, not tested :)

// ?
// $user = root;
// $pw = ;
// $db = pete;
// 
// $mysql_access = mysql_connect(localhost, $user, $pw);
// mysql_select_db($db, $mysql_access);
// 
// $result = mysql_query(select test2,test1,id from test, 
// $mysql_access);
//   while($row = mysql_fetch_array($result))
//   {
//   print($row[field1] .  -  . $row[field2] .  -  . $row[field3]
. br);
//   }
// ?

/beau

-- 
PHP Database 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-DB] Sanitizing user input for interaction with DB.

2002-01-13 Thread Beau Lebens

Hi Benny,
I know this is a bit of a run-around again, but try the annotated manual on
php.net, it has some good examples of using things here and there.

Specifically useful functions are

htmlspecialentities()
htmlspecialchars()
addslashes()
stripslashes()
nl2br()

also, as far as using regexps goes, you would probably normally want to do
something like (pseudo-esqu :P)

if (!eregi(expression, string)) {
fail;
}

hope something in there helps :)

/beau

// -Original Message-
// From: C. Bensend [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 14 January 2002 10:49 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Sanitizing user input for interaction with DB.
// 
// 
// 
// Hey folks,
// 
//  Let me preface this with the fact that I know
// information like this exists online, but it's a bear
// trying to find good examples.  I checked the list archives,
// and got minimal information.  Also, I'm posting to this list
// rather than the -users because this does target a database
// environment.
// 
//  I am working on a very basic project to put a bunch
// of computer-related information into a searchable PostgreSQL
// database.  I'm using PHP 4.0.6 to connect to PostgreSQL
// 7.1.2, via Apache 1.3.20.
// 
//  I'm a sysadmin, so one of my first concerns is for
// my site to be as secure as I can make it, without crippling
// my ability to do anything.  Hence, I have taken reasonable
// steps to minimize the chances of problems, like connecting
// to the database with an unprivileged user (SELECT privs
// on only the necessesary tables).  The user can't DROP, or
// INSERT, or anything.
// 
//  I'm now looking for real, working examples for scrubbing
// input submitted via a form.  I've gone over code snippets, read
// security-related articles, and haven't been able to find any
// real (read - targetted at beginning developers) examples for
// this.  I want to take the safer approach, and only allow a set
// of characters, rather than trying to weed out the evil.
// 
//  I would greatly appreciate it if you folks could
// pass me some URL's for this, or some small blurbs of code...
// I've read dozens of 'use regex' hints, but I need to understand
// a bit more about how to _use_ them, not how to _form_ them.
// 
// Sorry to be so long winded...  I appreciate any tips/tricks/URLs
// you can give me.  :)  Thanks!
// 
// Benny
// 
// 
// ~~
// A 'good' landing is one from which you can walk away. A 'great'
// landing is one after which they can use the plane again.
// --Rules of the Air, #8
// 
// 
// 
// -- 
// PHP Database 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 Database 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-DB] I think i saw this somewhere....

2002-01-06 Thread Beau Lebens

*being a smart-ass from your email signature*

sure... you can download the script from ..

just kidding :)

the best way to do this as far as I know would be to have a PHP script which
had write-access to your apache conf files, which then just added in the
required lines and restarted apache. there is no real need for a mysql
database, since the same script could read the existing conf file to find
out if a subdomain is available etc etc etc.

i know this isn't what you are after, but it might be useful if you get lost
and have to write your own :)

useful functions

file()
fopen()
fwrite() (? something like that)
system() (or ')

hope something there helps :)

/beau



// -Original Message-
// From: Dave Carrera [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 7 January 2002 2:54 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] I think i saw this somewhere
// 
// 
// Hi All
// 
// I think i saw a php script somewhere on my web travels, that 
// allows you to
// include
// sub domain reg to your web site.
// 
// it allowed you to offer
// 
// http://yourname.choiceofdomainname.com
// 
// so the visitor can have thier name in front of a domain name 
// reged to our
// webspace.
// 
// If i remeber right, it had a mysql db in the background.
// 
// Is this kind of thing available or did i dream it.
// 
// As always any pointers of advice is welcome
// 
// Dave C
// 
// The two rules for success are:
// 1. Never tell them everything you know.
// 
// 
// 
// -- 
// PHP Database 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 Database 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-DB] Run php page automatically

2001-12-20 Thread Beau Lebens

it's better to do something like

0,10,20,30,40,50*   *   *   *   /usr/bin/php -q
/home/you/yourscript.php  /dev/null

since crontab actually stores the result of it's operations in a file
(/home/you/Mailbox?) so you will bloat your server if you don't clear the
output.

alternatively, use yourscript.php   /home/you/logfile and send the output
to a text-based logfile for later analysis, then just make sure you aren't
using b and stuff in the log :)

HTH

/beau

// -Original Message-
// From: Marco Eyzaguirre [mailto:[EMAIL PROTECTED]]
// Sent: Friday, 21 December 2001 3:28 AM
// To: [EMAIL PROTECTED]
// Subject: RE: [PHP-DB] Run php page automatically
// Importance: High
// 
// 
// do this (crontab file)
// 
// 35 23 * * * root lynx http://www.host.com/dir/file.php 
// -accept_all_cookies
// 
// it's work!
// marco
// 
// -Mensaje original-
// De: Harpreet [mailto:[EMAIL PROTECTED]]
// Enviado el: Jueves, 20 de Diciembre de 2001 02:21 p.m.
// Para: [EMAIL PROTECTED]; [EMAIL PROTECTED]
// Asunto: [PHP-DB] Run php page automatically
// 
// 
// I would like to create a php page that would automatically 
// run every 10
// minutes or so to delete records from a table. This table has 
// an expiration
// field and records r tested by comparing current date with 
// the expiration
// date and record is deleted if expired.
// 
// Is this possible.
// 
// Help is greatly appreciated.
// 
// I am using php for my application. I am working on a LInux 
// server and using
// mysql as my database.
// 
// regards,
// Harpreet Kaur
// Software Developer
// Crispin Corporations Inc.
// 
// 
// 
// 
// -- 
// PHP Database 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 Database 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 Database 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-DB] date format question

2001-11-27 Thread Beau Lebens

try H as your hour format (date(H)+5)

although out of interest, at 9:51am, using either g or H gives me 2:51
pm

HTH

/beau

// -Original Message-
// From: Matt Nigh [mailto:[EMAIL PROTECTED]]
// Sent: Wednesday, 28 November 2001 9:48 AM
// To: php-db
// Subject: [PHP-DB] date format question
// 
// 
// hi,
// i'm wondering if anyone could help me in formatting a date 
// so it is 5 hours ahead of the server time.
// here's the code i'm using but it doesn't seem to work:
// 
// $date = date(F dS, Y g:i:s A, 
// mktime(date(g)+5,date(i),date(s),date(m),date(d),da
// te(Y)) );
// 
// i've already looked in the manual and around the net for 
// stuff, but wasn't able to find anything for what i needed.
// if anyone could help out, i'd appreciate it.
// 
// thanks,
// 
// 
// Matt
// 

-- 
PHP Database 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-DB] Flushing PHP output

2001-11-22 Thread Beau Lebens

if you just echo() the results/messages as you come across them, the page
should incrementally load.

in my experience (IE5?) if there is data being added to the page, then the
browser will display what it can, and keep adding to it until the stream
breaks or it finishes. one thing to note is that you wouldn't be able to do
any tables because they don't display until the code all the way to the end
of the table is available.

HTH

/beau

// -Original Message-
// From: Neil Lathwood [mailto:[EMAIL PROTECTED]]
// Sent: Friday, 23 November 2001 1:59 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Flushing PHP output
// 
// 
// Hi Folks,
// 
// What I am trying to accomplish is:
// 
// I want to have a web page access a number of DB's, this will 
// start with one
// but on a monthly basis increment by one. So within 12 months 
// their will be
// 12 DB's. The web page will access each one in turn starting 
// with the newest
// DB and search through this for certain text. After a query 
// has ended it
// moves on to the next and so on.
// 
// I want the PHP page to output html in the lines of:
// 
// Scanning DB mm/
// 
// No results / Results depending on what it finds.
// 
// flush output so user can see if it has found what he is looking for
// 
// Scanning DB mm/
// 
// Etc.
// 
// I hope this explains what I am trying to do. Any pointers 
// would be great.
// 
// Thanks in advance
// 
// Neil
// 
// 
// -- 
// PHP Database 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 Database 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-DB] Database help needed

2001-11-21 Thread Beau Lebens

should be able to do something like

SELECT whatever FROM whereever WHERE value='50' AND value='45'

is that what you are looking for?

// -Original Message-
// From: Chris Payne [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 22 November 2001 3:11 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Database help needed
// 
// 
// Hi there everyone,
// 
// This may sound like an odd question and something that I 
// should know, but ...
// 
// I need to display results by amount - for example, for all 
// properties which are either or between 450,000 and 500,000 
// (For example) - how using PHP and MySQL do I get it to 
// display 450,000, 50,000 and all inbetween ???  I can easily 
// get it to display one or the other, but it is a search which 
// is based on cost of property.  How will I format the MySQL 
// query to get it to do this?
// 
// Please help a little english guy lost in the USA :-)
// 
// Thank you everyone, it's very appreciated.
// 
// Regards
// 
// Chris
// 
// www.planetoxygene.com
// 

-- 
PHP Database 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-DB] getting database tables

2001-11-12 Thread Beau Lebens

or even

mysql_list_tables()

:)

/beau

// -Original Message-
// From: Rick Emery [mailto:[EMAIL PROTECTED]]
// Sent: Tuesday, 13 November 2001 1:47 AM
// To: 'mike luce'; [EMAIL PROTECTED]
// Subject: RE: [PHP-DB] getting database tables
// 
// 
// In PHP:
// $query = SHOW TABLES;
// $result = mysql_query($query) or DIE(Error: .mysql_error());
// while( $row = mysql_fetch_array($result) )
// {
//  do some stuff with $row
// }
// 
// 
// -Original Message-
// From: mike luce [mailto:[EMAIL PROTECTED]]
// Sent: Monday, November 12, 2001 3:10 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] getting database tables
// 
// 
// Can someone give me some help on obtaining a list of tables 
// in a database?
// Ive had no luck so far because i keep encountering an error 
// which just times
// 
// out the page.
// 
// Any help would be welcome.
// thanks.
// 
// _
// Get your FREE download of MSN Explorer at 
http://explorer.msn.com/intl.asp


-- 
PHP Database 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 Database 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 Database 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-DB] Date Calculation

2001-11-12 Thread Beau Lebens
in PHP, coming out in yyy-mm-dd

date("Y-m-d", mktime(0,0,0, date("m"), date("d")+14, date("Y"));

untested, so please test it - this will ignore hours, minutes, seconds (the
leading 3 0's) and make a timestamp using mktime for this month, this day +
14, this year, then return it formatted as yyy-mm-dd

HTH

Beau



// -Original Message-
// From: Ben S. [mailto:[EMAIL PROTECTED]]
// Sent: Tuesday, 13 November 2001 1:49 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Date Calculation
// 
// 
// How do you get the date that is 14 days from today's date?
// I can get that date with mysql monitor but PHP. I am using 
// PHP4 and MySQL. I
// have tried many things but nothing works.
// Does anyone give me a help?
// 
// Thank you.
// Ben
// 
// 
// 
// -- 
// PHP Database 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 Database 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-DB] Application variables

2001-10-28 Thread Beau Lebens

php doesn't have application variables as such, however there are a couple
options for implementing them...

1. have a single file with your application variables and manually include
that in all files of the project
2. use the session_*() functions to keep the vars alive on pages
3. as you said, store to db and update once in a while

(or a combination of these... i.e. 3 + 2, load from db, carry around in
session and then save to db again)

HTH

beau

// -Original Message-
// From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
// Sent: Sunday, 28 October 2001 3:15 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Application variables 
// 
// 
// Pls tell me how to implement application variables in PHP 
// like they are supported
// in ASP else i might have to have the value stored in the 
// database and update
// every now and then which is simply an overhead.
// 
// -- 
// PHP Database 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 Database 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-DB] HELP! (mysql)

2001-10-25 Thread Beau Lebens

if you have phpMyAdmin then just use that (if you don't then you *really*
should :)

otherwise, yeah just use mysql_query()

or use the command line

of course the second 2 options assume you can construct the SQL command to
do it, using phpMyAdmin you won't really need to know.

/beau

// -Original Message-
// From: Duncan Abbott [mailto:[EMAIL PROTECTED]]
// Sent: Friday, 26 October 2001 9:17 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] HELP! (mysql)
// 
// 
// hello,
// 
// can one of you clever people guys 30 seconds to help a lady...?
// 
// can someone just tell me the best way to create a new table 
// in a mysql
// database?
// should i use the mysql_query() function?
// 
// thank you boys,
// 
// xxx
// 
// 
// 
// -- 
// PHP Database 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 Database 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-DB] Help, need the scripts of processing the to-be-confirmed email.

2001-10-25 Thread Beau Lebens

// Question 1:
// How to process the confirmation email by clicking the url 
// given in the email
// and by replying the email.

when you send them an email, include some sort of confirmation code

ie http://server/confirm.php?confirmCode=xxx

when they click, it passes this code, and you look it up in the database or
something and match it against an account, which then becomes verified.

you should also have the option of them hitting the same page without that
var defined, and let them enter it themselves, so that if the URL is broken
in their email client they can still enter the code you give to them and get
in ;)

// Question 2:
// I know if using mail(), the From field of the mail sent 
// out is always the
// web host server's mail sendout server,
// not from my own email box. How to send out the email which looks like
// sending out from my own email box.

RTFM
failing that, add a header
?php
$header = From:  . $your_email;
mail($to, $subject, $message, $header);
?

// Question 3:
// How to let MYSQL automatically delete the unactivated signups?

maybe a cron job to hit a script? (use either lynx to page or execute the
cgi verison of php)
on that script look for a date_created field or something, and if now
minus date_created greater than tolerance then delete that entry
then you can set tolerance to be an hour, 2 days, whatever

enjoy
and probably consider thinking about things a bit more before just shooting
off a question to us to solve your problems 

/b

-- 
PHP Database 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-DB] Re: Newbie in Need of Assistance

2001-10-24 Thread Beau Lebens

carols - true, but to avoid confusion and problem sif your names get more
complex (i.e. i think $$some_name will go crazy, you should always do it
like this

$var_name = game1;
${$var_name}

cheers guys


// -Original Message-
// From: Carlos Augusto Abarca [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 25 October 2001 3:19 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Re: Newbie in Need of Assistance
// 
// 
// It´s very easy and to tell you the truth I descovered it by accident:
// 
// Lets say you have a variable with the dynamic variable name 
// (ej. $var_name =
// game1;)
// 
// if you want to create this variable ($game1) then you can write:
// $$var_name
// And that´s it.
// 
// try it.
// 
// Jmack [EMAIL PROTECTED] escribió en el mensaje
// [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
//  Greetings.  I have been playing around with PHP this week, 
// programming a
//  football pool.  I have hit a small snag that I would like 
// some assistance
//  with, if anyone knows the answer -- it's probably very 
// simple, but my
// Intro
//  to PHP book does not tell me how to do it.
// 
//  I have an HTML form in a PHP page, with several controls 
// on it.  I am
//  dynamically generating the names for these controls.  Here is the
// example --
//  for each game, the user selects the winner in a SELECT 
// control.  It's
// set
//  up to not care how many games there are for each week, 
// just dynamically
//  build the form/controls and name them pick1, pick2, etc.
// 
//  In my function that handles the form and uploads the 
// user's picks to the
//  database (MySQL), I need to also dynamically generate the 
// variable names
//  that refer to these controls.  I have them all declared as global
// variables,
//  since I know there will never be more than 15 games in a 
// given week.  But,
// I
//  want to iterate through a loop for each game and update 
// the database.  As
// I
//  loop through for each game, and try to dynamically 
// generate the vaiable
//  names for $pick1, $pick2, etc.  I end up trying to update the DB by
// sending
//  in the string $pick1 instead of the value from the form 
// control for
// pick1.
// 
//  I have attached the PHP file in question.  The code is not 
// very clean,
//  especially the part where I am having problems, but 
// hopefully, someone
// will
//  have some time to help me with this problem.  Please 
// respond to this
//  newsgroup or directly to me at [EMAIL PROTECTED]  Thank you.
// 
//  Joe Mack
// 
// 
// 
// 
// 
// 
// 
// -- 
// PHP Database 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 Database 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-DB] https

2001-10-22 Thread Beau Lebens

you mean to use for some sort of header redirect or something?

couldn't you do

1. click link change to secure mode
2. pass the url you just came from with the link (or get it from
HTTP_REFERRER or whatever it is)
3. header(Location:  . str_replace(http://;, https://;, $last_url));

or am i missing the point of what you want to do?

HTH

/beau

// -Original Message-
// From: George Lioumis [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 22 October 2001 2:52 PM
// To: PHP Mailing List
// Subject: Re: [PHP-DB] https
// 
// 
// I think that you MUST retype the whole URL.
// 
// George.
// 
// - Original Message - 
// From: J-E-N [EMAIL PROTECTED]
// To: [EMAIL PROTECTED]
// Sent: Saturday, October 20, 2001 2:22 PM
// Subject: [PHP-DB] https
// 
// 
// hello,
// 
// how can i switch from http to https without typing the whole url?
// 
// thanks
// 
// 
// 
// -- 
// PHP Database 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 Database 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   >