Re: [PHP] Name of variable to string

2008-02-08 Thread Adrian Bruce
tedd wrote: Hi gang: From a variable with the name of $this_variable -- how do I get a string 'this_variable' ? Cheers, tedd At some point or the other you will have to define $this_variable as $this_variable, so at that point you will have access to the string 'this_variable'. Even if

Re: [PHP] generate xls file on fly

2008-02-08 Thread Adrian Bruce
Hiep Nguyen wrote: hi friends, i have a php page with the following logic: html head titleDownload/title /head table trtdTitle/tdtdAuthor/td/tr ? $sql = select title,author from book where title != null and author != null; ? ? $rs = mysql_query($sql) or die(mysql_error()); ? ?

[PHP] displaying documents stored under web root

2006-03-10 Thread Adrian Bruce
Hi After some advice (surprise!) I currently store restricted documents beneath the web root so they are not accessible via the URL, when a valid user wishes to view a document i copy it to a temporary folder above the root and load it in a new page. the only way i can then manage to delete

[PHP] require_once hell

2006-03-29 Thread Adrian Bruce
Hi this may be a stupid moment but i cant find an help on google so.i am including two classes in my code using the require_once(path to file) method. this works fine for the first class but when including the second it simply outputs the contents on to the page. I feel I must be

[PHP] Date addition problem

2006-03-29 Thread Adrian Bruce
Hi I am having an unusual problem when trying to calculate dates in advance from a start date. the code below shows a loop where by on each run an increasing number of weeks is added to the start date, this works as expected up untill the 8th time where for some reason it produces 01-11-05

Re: [PHP] Date addition problem

2006-03-29 Thread Adrian Bruce
month have 31 days. You don't check the amount of day there... :) on Wednesday 29 March 2006 14:51, Adrian Bruce wrote: Hi I am having an unusual problem when trying to calculate dates in advance from a start date. the code below shows a loop where by on each run an increasing number of weeks

Re: [PHP] Date addition problem

2006-03-29 Thread Adrian Bruce
: $startdate -- -- --$nextdate/h1; } ? [/snip] Adrian Bruce wrote: That should not effect it, if i am adding $i * 7 days each time then i should get the date that comes 7 days later irrespective of how many days are in the month, shouldn't I ? 8 * 7 = 56, 56 days after the 07-09-05 is 02-11-2005

[PHP] PHP LDAP - Single Sign On

2006-06-27 Thread Adrian Bruce
Hi all Sorry if this has been asked before but i am currently drawing a blank STW etc.. is there any way of retrieving the user name of a user (through the browser) that has logged on to a network (windows OS). I have used php with LDAP before and made the user log into the website, however

Re: [PHP] PHP LDAP - Single Sign On

2006-06-28 Thread Adrian Bruce
thanks for the response, i can see how this works (i think) for basic authentication with user input,but what i really need is to actually retrieve the logged on user name after a user has logged into windows. i.e. the user name that the http client passes to the apache mod has been captured

Re: [PHP] selected index

2005-10-25 Thread Adrian Bruce
dont know of a function but this should work $size = count($array); for($i=0;$i$size;$i++){ if($selected_person == $array[$i]){ echoindex: $i; } } Adrian Ross wrote: Hi, I have an array $people= array (ross, bob, chris) I have a variable $selected_person = chris I want to

Re: [PHP] create HTML page on the fly

2005-10-25 Thread Adrian Bruce
I think you can use a different handle when using fwrite() which will make php create a file if one is not already there: something like if ($fp = fopen($file,x+)){ echoopened; } fwrite($fp,$content); fclose($fp); Ade Angelo Zanetti wrote: Hi guys. I've created a small

Re: [PHP] Detailed Report

2005-10-27 Thread Adrian Bruce
load each row of the resultset into an array $row using mysql_fetch_array(), each field in the result set row will be held in the corresponding array element. while ($row = mysql_fetch_array($resultset, MYSQL_NUM)){ echo$row[0] | $row[1] | $row[2]; } Hope this helps, Ade Danny wrote:

Re: [PHP] Detailed Report

2005-10-27 Thread Adrian Bruce
the details of the records Your solution shows: Customers | John | A36 | New York Customers | Jason | B45 | Los Angeles (...) And I need CustomersBR John | A36 | New York Jason | B45 | Los Angeles (...) (...) On 10/27/05, *Adrian Bruce* [EMAIL PROTECTED] mailto:[EMAIL

Re: [PHP] post and variables

2005-11-10 Thread Adrian Bruce
if (($_POST['$table_name']) == 1){ //do something } what you have is essentialll looking for a posted value called '$table_name== 1'! Ross wrote: Thanks fpr all the feedback on the password but I have another one... How do I use $_POST with variables. Cant find an example of this

[PHP] Dynamic DB query - form display

2005-11-18 Thread Adrian Bruce
Hi I am trying Dynamically creating a Query based on form input for an intranet, i have a text input that allows a user to input part of a where clause such as - not like '04%' - . this bit works fine but i would like to display the clause back in the form field when the page reloads.

Re: [PHP] Dynamic DB query - form display

2005-11-18 Thread Adrian Bruce
=' . htmlentities($clause, ENT_QUOTES) . '; php.net/htmlentities Cheers, David Grant Adrian Bruce wrote: Hi I am trying Dynamically creating a Query based on form input for an intranet, i have a text input that allows a user to input part of a where clause such as - not like '04

[PHP] Automatic log out

2005-12-01 Thread Adrian Bruce
Hi I currently use an automatic logout out system that sets a time out in two ways. (If the ip address on computer is recognized then set timeout to 10 mins, if not then set to 2 mins.) 1) The time out setting is used to create a meta refresh tag that will re-direct the user to the

Re: [PHP] One big file or many includes?

2005-12-16 Thread Adrian Bruce
Definitely sounds as if you should be employing the object-orientated methodology, If the project is as big as you say it is then really you should be looking to use some UML planning tool so that you can keep all you code organised. It is ok on smaller projects to bash out some rough plans

[PHP] upload path

2005-12-16 Thread Adrian Bruce
hi all a quick one i hope! i am trying to allow users to save a set of data as a csv file when clicking on a link on our intranet. i can do all the formatting and output to file but i would like the user to be able to specify where the file is saved in the same way as they would choose a

Re: [PHP] upload path

2005-12-16 Thread Adrian Bruce
i see what you mean but i dont think that will work for me, ideally just want them to choose a location after which i will create the file in this location. the only option i can think of the moment is to default to the users home directory. Ive just realised that the subject of my email is

Re: [PHP] upload path

2005-12-16 Thread Adrian Bruce
aaah, scrap that, i think i have solved my own problem, thanks for your time anyway, Jay Blanchard wrote: [snip] i see what you mean but i dont think that will work for me, ideally just want them to choose a location after which i will create the file in this location. the only option i

[PHP] gdf fonts

2005-12-21 Thread Adrian Bruce
Hi Does anyone know where i can get some decent gdf fonts for using in the imageloadfont() function, i have found some on the net but they are all a bit naf so far. I'm really just looking for something like Arial or verdana. Im creating pie charts on the fly but at the moment they look

[PHP] Maps and plotting data

2006-01-10 Thread Adrian Bruce
Has anyone used any of the php mapping classes that are available? (Image_GIS etc) I would like to create dynamic maps and plot data i.e. postcodes on them like you do in applications like map-point. I am not quite sure if there is any php scripts/programs that already do this or if i have

Re: [PHP] Is there a way to display data from database for Select Options in a form?

2006-01-10 Thread Adrian Bruce
Something along these lines will work fine ?php $query = mysql_query(select dates from table ) or die (mysql_error()); echoselect name='test'; while ($row = mysql_fetch_array($query, MYSQL_NUM)){ echooption value='$row[0]'$row[1]/option; } echo/select; ? Regards Ade Sue wrote:

Re: [PHP] Is there a way to display data from database for Select Options in a form?

2006-01-10 Thread Adrian Bruce
solution Jochem Maas wrote: teaching noobs to output html while (oun intended) looping thru a result set is counter-productive. discuss. Adrian Bruce wrote: Something along these lines will work fine ?php $query = mysql_query(select dates from table ) or die (mysql_error()); echoselect name

Re: [PHP] PHP and LDAP...

2006-01-17 Thread Adrian Bruce
David I found this resource usefull when authenticating users against LDAP, its easy to set up and use. http://adldap.sourceforge.net/ Ade David BERCOT wrote: Hi, I'm new on this list and with PHP. But I am a old web developer (with ASP). I'm looking for verifying a username/password in