[PHP] gzip

2004-09-07 Thread Matthew Oatham
Hi, I have a file on my server that I want to compress in a php page i.e take file.txt and add it to the archive file.zip. How the hell do I do it using gzip cant understand the manual, or is there another way to create a zip file or other compressed file. cheers matt

[PHP] create a zip file

2004-09-07 Thread Matthew Oatham
Hi, I have been trying to find a way of creating a zip file. I have a file on my server that I want to compress I have had a look at gzip but cant work out what to do. Can someone point me to a function or an example of how to do this. thanks matt

[PHP] string manipulation

2004-08-12 Thread Matthew Oatham
Hi I am trying to track down a method for transferring a database id such as 5 into a nice formatted order id such as ORD0005 - where the format for the order id is ORD + 5 digits made up of the database id Thanks Matt

[PHP] odd results with database string comparisons

2004-08-12 Thread Matthew Oatham
I have a database table with the column described as address_line_2 varchar(255) NOT NULL default '', when I do a select I want to see if there is anything in that column if there is text I will display it in a html table if there is nothing (the table default) I will write nbsp; However the

[PHP] How do I return the error

2004-07-28 Thread Matthew Oatham
Hi I have this function below - if it reurns false I want to also return the error so I can print it in my calling function. Can I do this? Cheers Matt function fileUpload($file) { if ($file['type'] == image/gif || $file['type'] == image/pjpeg){ if (@copy ($file['tmp_name'], images/ .

Re: [PHP] How do I return the error

2004-07-28 Thread Matthew Oatham
what about returning the error the copy function would have thrown ? Thanks - Original Message - From: John Nichel [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, July 28, 2004 3:00 PM Subject: Re: [PHP] How do I return the error Matthew Oatham wrote: Hi I have

[PHP] html text area and mysql text fields

2004-07-27 Thread Matthew Oatham
Hi, If I have a html textarea for inputting text into a database text field how can I keep the formatting of the entered text? i.e. on the html textarea if the user enters carriage returns i.e. a new paragraph I want that to go into the database then when I retrieve it and display it on a

[PHP] displaying database results with forward and back buttons

2004-07-11 Thread Matthew Oatham
Hi, I have a query that returns lots of rows so I want to display the results in blocks of 25 or so on my web page and have forward and back buttons to navigate the results. Can someone point me in the right directions please I have tried to look around for something using google but cant

[PHP] MySQL backup

2004-05-13 Thread Matthew Oatham
Hi, I am using MySQL database accessed via myphp admin - there is an export option which allows me to export the structure and data to an sql file but this is a manual procedure is there anyway to automate this via myphp admin i.e. using a cron job? Thanks

Re: [PHP] MySQL backup

2004-05-13 Thread Matthew Oatham
Mmmm my provider doesn't give me access to this area ! - Original Message - From: John W. Holmes [EMAIL PROTECTED] To: Matthew Oatham [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, May 13, 2004 6:40 PM Subject: Re: [PHP] MySQL backup From: Matthew Oatham [EMAIL PROTECTED] I

[PHP] html form elements as php arrays

2004-05-06 Thread Matthew Oatham
Hi, I am retrieving data from a database and displaying results on a html so the user can edit them, I am sending the html form back to the server as an array, i.e on my html for I might have 10 name fields so in the html code all name fields are named name[] then I can iterate through the

[PHP] Code Review PLEASE !!!

2004-04-05 Thread Matthew Oatham
Hi, I am a newbie PHP programmer, I have some code that works but I want some tips on how I an Improve my code, i.e. should I be doing my updates / deletes on same php page as the display page, am I using transactions correctly, am I capturing SQL errors correctly am I handling form data as

Re: [PHP] Code Review PLEASE !!!

2004-04-05 Thread Matthew Oatham
. Jones [EMAIL PROTECTED] To: Matthew Oatham [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, April 05, 2004 11:56 PM Subject: Re: [PHP] Code Review PLEASE !!! Wells first of all, you are going to want better form input validation. For Example: foreach ($_POST['fleet_id'] as $key = $value

[PHP] transactions

2004-03-29 Thread Matthew Oatham
Hi, Is there an elegant way to recover from DB errors in MySQL using PHP, i.e. transactions and rolling back - basically I have an insert statement then an update statement. if the insert succeeds the update is run but if the update fails I want to undo the insert! Any suggestions, I guess I

[PHP] time function

2004-03-25 Thread Matthew Oatham
Hi, I have a TIME field type in mysql database I want to do a select and add all the times together to return a total time, can I do this using the select statement? cheers matt

[PHP] string concatination

2004-03-23 Thread Matthew Oatham
Hi, What is the correct way, using php to join to strings, vars or other wise. i.e. how do I join $string1 = hello; $string2 = world; do i do $string1 . $string2; and what about .. $string2 = $string1 . world; Is that correct?

[PHP] Any Ideas?

2004-03-22 Thread Matthew Oatham
Hi, Sorry to ask this question, I am fairly new to PHP and wanted to ask for some help with the following. I have a MySQL table which uses a auto_increment int as the primary key - when I do an insert I want to create another id based on the primary key and insert this into the same table

Re: [PHP] Any Ideas?

2004-03-22 Thread Matthew Oatham
for your ideas so far - very useful! How do you get to know about all these useful functions? Cheers Matt - Original Message - From: John W. Holmes [EMAIL PROTECTED] To: Robert Cummings [EMAIL PROTECTED] Cc: Matthew Oatham [EMAIL PROTECTED]; PHP-General [EMAIL PROTECTED] Sent: Tuesday, March

Re: [PHP] Any Ideas?

2004-03-22 Thread Matthew Oatham
-%03d, $key); return $crId; } - Original Message - From: John W. Holmes [EMAIL PROTECTED] To: Robert Cummings [EMAIL PROTECTED] Cc: Matthew Oatham [EMAIL PROTECTED]; PHP-General [EMAIL PROTECTED] Sent: Tuesday, March 23, 2004 12:25 AM Subject: Re: [PHP] Any Ideas? Robert Cummings

Re: Re[2]: [PHP] setting request variables

2004-03-04 Thread matthew oatham
- From: Tom Rogers [EMAIL PROTECTED] To: matthew oatham [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, March 04, 2004 2:02 AM Subject: Re[2]: [PHP] setting request variables Hi, Thursday, March 4, 2004, 11:08:06 AM, you wrote: mo but what if I wanted the variable $error to be a message

[PHP] php session ID attached to URL

2004-03-04 Thread matthew oatham
Hi, I have a quick question about PHP session. In my website I have included the command session_start(); at the top of every page. Firstly is this correct? Secondly when I visit the website the first link I click on has the php session ID appended to the url however this php session ID is not

Re: Re[4]: [PHP] setting request variables

2004-03-04 Thread matthew oatham
Sorry, I understand now! Thanks for your help and your patience ! It works! Matt - Original Message - From: Tom Rogers [EMAIL PROTECTED] To: matthew oatham [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, March 04, 2004 11:27 AM Subject: Re[4]: [PHP] setting request variables

[PHP] protecting directories and files inside them based on session variables

2004-03-04 Thread Matthew Oatham
Hi, I have created a small website members area - this is protected using php session variables so to access it a variable user_id must exist in the session. However I have a directory on my webserver that holds documents that I want to make accessible only to users who have logged in however

[PHP] protecting directories and files inside them based on session variables

2004-03-04 Thread matthew oatham
Hi, I have created a small website members area - this is protected using php session variables so to access it a variable user_id must exist in the session. However I have a directory on my webserver that holds documents that I want to make accessible only to users who have logged in however

[PHP] setting request variables

2004-03-03 Thread matthew oatham
Hi, I have created a small login system for my website. However if a user logs in incorrectly I want to display a error message currently I use the code echo You could not be logged in! Either the username and password do not match or you have not validated your membership! br /

[PHP] setting request variables

2004-03-03 Thread matthew oatham
Hi, I have created a small login system for my website. However if a user logs in incorrectly I want to display a error message currently I use the code echo You could not be logged in! Either the username and password do not match or you have not validated your membership! br /

[PHP] server side redirects

2004-03-03 Thread matthew oatham
Hi, I have a page that checks to see if a session exists and if so does a server side redirect - i tired using header(Location: membersArea.php); but I got an error about headers already sent, guess this is because I have already output html before this php command. So I tried include

[PHP] Re: server side redirects

2004-03-03 Thread matthew oatham
- From: Ben Ramsey [EMAIL PROTECTED] Newsgroups: php.general To: Matthew Oatham [EMAIL PROTECTED] Sent: Thursday, March 04, 2004 12:49 AM Subject: Re: server side redirects guess this is because I have already output html before this php command Exactly right. Why don't you use the header

Re: [PHP] setting request variables

2004-03-03 Thread matthew oatham
but what if I wanted the variable $error to be a message. I want to set a variable called $error to something like invalided password then display this on the login page. Cheers Matt - Original Message - From: Tom Rogers [EMAIL PROTECTED] To: matthew oatham [EMAIL PROTECTED] Cc: [EMAIL

[PHP] MySQL update

2004-02-24 Thread Matthew Oatham
Hi, I have an update statement that tries to update a number of values - these values have unique value constraint so when I do the update it will either succeed or fail. If it fails how can I determine where the update failed. i.e. pinpoint the value that was not unique? At the moment I am

[PHP] date functions

2004-02-24 Thread Matthew Oatham
Hi, You might already be fed up with my posts but I'm a complete PHP newbie and find these groups are the best way to learn! Anyway I have the database date in the format: -mm-dd hh:mm:ss e.g. 2004-02-24 07:57:59 but when in some situations I only want to show the user the date in the

[PHP] form array

2004-02-11 Thread Matthew Oatham
Hi, I have a form on page1 that i want to submit to another php page - page2 the form has the fields input type=hidden name=image[one] value=one input type=hidden name=image[two] value=two input type=hidden name=image[three] value=three Basically I want to have these form field values as an

[PHP] PHP FILE SIZE LIMIT

2004-02-11 Thread Matthew Oatham
hi is there a limit to the filesize of a php ? I know tomcat had limits on the file size of jsps. My problem is I have a 13kb php file when I add some more lines of code to it the html output becomes currupt - it could well be bad html but I cant find it so thought I would ask this question?

[PHP] Forms

2003-11-19 Thread Matthew Oatham
Hi, This is probably more of a javascript question but thought someone here might have an answer. I have a form in a pop up windoe I want this form data to be submited to the window that opened the popup - how can I do this? I have tried setting the target attribute on the form tag to

[PHP] New to PHP form attributes

2003-10-07 Thread Matthew Oatham
Hi, I am new to PHP and am more used to JSP. My question is - if I submit a form to a php3 page using action==? PHP_SELF ? for some processing all is well I can see that form data. After the processing the page is redisplayed - but the data originally sent persits (in the request) this can be