Any php coders out there?
24-11-2009, 13:51
|
#16
|
|
- Israel's Son -
Join Date: Feb 2008
Location: Newcastle
Services: SkyHD, Freesat & Virgin Media TV/BB
Posts: 1,318
|
Re: Any php coders out there?
Quote:
Originally Posted by Strzelecki
Yes that can be done using the built in FTP functions PHP has. However you would be much better using the HTTP Post method but this may restricted as to the size of files you can upload. Depending on what level of access to the server you have this may be adjustable.
There are also free Java file uplad applets out there that can display the local and remote folder tree and upload over FTP or HTTP POST. These can be embedded into a HTML page.
|
I think I have tried the HTTP Post method before and had a problem with the 2mb file size limit and without any knowledge of how to modify the php.ini I couldn't go any further.
Is there any free Java file upload applets you would recommend?
Thanks for the help btw it's much appreciated
|
|
|
24-11-2009, 17:18
|
#17
|
|
bah
Join Date: Jun 2003
Location: Nr Carnforth
Age: 36
Services: M6 Keele
Posts: 5,455
|
Re: Any php coders out there?
Quote:
Originally Posted by Mr Angry
Sex on a stick.
I'll have a blast at these later today.
|
Might be a bit late to the party but I use this to create very quick editable bits on websites.
http://www.turningturnip.co.uk/free-...php-generator/
If anything just generating the code to create the Mysql table with it is a time saver in itself.
|
|
|
25-11-2009, 17:02
|
#18
|
|
bah
Join Date: Jun 2003
Location: Nr Carnforth
Age: 36
Services: M6 Keele
Posts: 5,455
|
Re: Any php coders out there?
Speaking of php coding (and specifically using it with Mysql).
I have a query that selects all courses that are in 'London'.
However we have more than one location in London so this field has been changed to 'London EC2M 7' or 'London EC3A' etc.
What do I need to change this to to make it pick all variations that start London?
AND (`location`='London')
Ta
HM
|
|
|
25-11-2009, 17:09
|
#19
|
|
Cable Forum Team
Join Date: Mar 2004
Age: 25
Posts: 16,129
|
Re: Any php coders out there?
Quote:
Originally Posted by handyman
Speaking of php coding (and specifically using it with Mysql).
I have a query that selects all courses that are in 'London'.
However we have more than one location in London so this field has been changed to 'London EC2M 7' or 'London EC3A' etc.
What do I need to change this to to make it pick all variations that start London?
AND (`location`='London')
Ta
HM
|
Should be
WHERE Location LIKE 'London%'
|
|
|
25-11-2009, 17:20
|
#20
|
|
bah
Join Date: Jun 2003
Location: Nr Carnforth
Age: 36
Services: M6 Keele
Posts: 5,455
|
Re: Any php coders out there?
Quote:
Originally Posted by Damien
Should be
WHERE Location LIKE 'London%'
|
Many thanks, all changed and works like a charm.
|
|
|
25-11-2009, 18:21
|
#21
|
|
Cable Forum Team
Join Date: Mar 2004
Age: 25
Posts: 16,129
|
Re: Any php coders out there?
No Problem. Be careful with those kind of queries as, well at least with MS SQL Server, they impact upon performance.
|
|
|
02-12-2009, 20:28
|
#22
|
|
- Israel's Son -
Join Date: Feb 2008
Location: Newcastle
Services: SkyHD, Freesat & Virgin Media TV/BB
Posts: 1,318
|
Re: Any php coders out there?
You know I have been trying for days to make an ftp upload page using php with no luck (i'm in way over my head) so I was wondering if anyone had any idea how I could do this.
I've managed to make a simple image upload page which is a start I suppose
|
|
|
02-12-2009, 21:54
|
#23
|
|
Angry is as angry does..
Join Date: Jan 2006
Location: Belfast
Posts: 3,874
|
Re: Any php coders out there?
I think I have a php upload script which will handle practically anything you throw at it - interested?
__________________
"Exercising the right to exorcise the right".
|
|
|
02-12-2009, 22:22
|
#24
|
|
- Israel's Son -
Join Date: Feb 2008
Location: Newcastle
Services: SkyHD, Freesat & Virgin Media TV/BB
Posts: 1,318
|
Re: Any php coders out there?
Yeah please really interested
|
|
|
03-12-2009, 11:15
|
#25
|
|
bah
Join Date: Jun 2003
Location: Nr Carnforth
Age: 36
Services: M6 Keele
Posts: 5,455
|
Re: Any php coders out there?
Quote:
Originally Posted by Mr Angry
I think I have a php upload script which will handle practically anything you throw at it - interested?
|
Very interested as well in that as well. I'll PM you.
I'm stuck with something that you nice helpful people at Cf may be able to assist with.
I have a database of training courses.
I have a date variable
$date = mysql_result($result,$i,"date");
I have length in days:
$length = mysql_result($result,$i,"length");
I can format date so its in the right order:
$date = date("d/m/y",strtotime($date));
What I cannot seem to work out is to get the end date of the course.
I have tried lots of ways but non seem to work it right.
|
|
|
03-12-2009, 12:07
|
#26
|
|
Gone
Join Date: Jun 2003
Age: 30
Posts: 14,760
|
Re: Any php coders out there?
Quote:
Originally Posted by handyman
Very interested as well in that as well. I'll PM you.
I'm stuck with something that you nice helpful people at Cf may be able to assist with.
I have a database of training courses.
I have a date variable
$date = mysql_result($result,$i,"date");
I have length in days:
$length = mysql_result($result,$i,"length");
I can format date so its in the right order:
$date = date("d/m/y",strtotime($date));
What I cannot seem to work out is to get the end date of the course.
I have tried lots of ways but non seem to work it right. 
|
Like this:
PHP Code:
$date = mysql_result($result,$i,"date");
$length = mysql_result($result,$i,"length");
$enddate = date("d/m/y", strtotime($date . " + $length days"));
|
|
|
03-12-2009, 12:20
|
#27
|
|
bah
Join Date: Jun 2003
Location: Nr Carnforth
Age: 36
Services: M6 Keele
Posts: 5,455
|
Re: Any php coders out there?
Success although I think I might have spotted my problem as I had tried that one but it did not work. I realized I needed to run it before I changed the date format.
Here's an extension of that for you since it now works but is still wrong.
Courses are x days long so the start date of 7/12/09 and a 3 day course with the above gives a finish date of 10/12/09. However a 3 day course starting on 7/12/09 finishes on 9/12/09.
I could simply remove 1 day from length and that would be fine except for a 1 day course lol.
I think I may be able to work round this but may be back here in ten with another question :-)
OMG it works !!
PHP Code:
if ($length <= 1) {
$enddate = date("d/m/y",strtotime($date));
}
else {
$correctlength = $length - 1;
$enddate = date("d/m/y", strtotime($date . " + $correctlength days"));
}
Last edited by handyman; 03-12-2009 at 12:40.
|
|
|
08-12-2009, 12:51
|
#29
|
|
bah
Join Date: Jun 2003
Location: Nr Carnforth
Age: 36
Services: M6 Keele
Posts: 5,455
|
Re: Any php coders out there?
I'm developing a website at the moment which is an online broker site. Front end templates all looking good and I have done a trial of part of the back end.
For the trial I have 4 tables and have ended up with 35 php files/pages to manage them.
With each table there is a add/added/update/updated/delete/deleted and index (extra pages are a multi page form to add the actual transaction).
Is this the right way to be approaching this? I will have many many more tables in the end and it seems like I'm just going to end up with an exponential amount of files to manage.
|
|
|
08-12-2009, 13:04
|
#30
|
|
Cable Forum Team
Join Date: Mar 2004
Age: 25
Posts: 16,129
|
Re: Any php coders out there?
Quote:
Originally Posted by handyman
I'm developing a website at the moment which is an online broker site. Front end templates all looking good and I have done a trial of part of the back end.
For the trial I have 4 tables and have ended up with 35 php files/pages to manage them.
With each table there is a add/added/update/updated/delete/deleted and index (extra pages are a multi page form to add the actual transaction).
Is this the right way to be approaching this? I will have many many more tables in the end and it seems like I'm just going to end up with an exponential amount of files to manage.
|
This really does depend on what the responsibilities of those files are. Could you give us an idea? It's a good idea to have multiple classes, in this case files I guess, but you need to make sure each file has a clear purpose and responsibility. One file to handle customers, another to handle products and so on.
If your performing the same type of operations, say customers, then only have one file for which handles adding, deleting, and so on.
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +1. The time now is 17:39.
|