|
8 Mar 2003, 22:46
|
#1
|
Registered User
Join Date: Jan 2003
Posts: 4,290
|
php question (1)
ok, i started learning this strange language.
i tryed to define a class, but i need two constructors, one that takes an argument and one that doesnt.
is that possible? this:
Code:
function Movie($bla){
...
}
function Movie() {
...
}
doesnt work
(i could work around somehow, if it isnt possible, i just want to know)
__________________
im not tolerant, i just dont care.
|
|
|
8 Mar 2003, 23:13
|
#2
|
Registered User
Join Date: Jan 2003
Posts: 4,290
|
how do i forward a request? in java i could do something like this:
response.sendRedirect("whereever.jsp");
or
getServletContext().getRequestDispatcher("/whereever.jsp").forward(request, response);
hgow do i do that in php? i know about that include-thingy, but that doesnt give me a new, clean page
__________________
im not tolerant, i just dont care.
|
|
|
8 Mar 2003, 23:24
|
#3
|
Henry Kelly
Join Date: Apr 2000
Posts: 7,374
|
Re: php question (1)
Quote:
Originally posted by wu_trax
ok, i started learning this strange language.
i tryed to define a class, but i need two constructors, one that takes an argument and one that doesnt.
is that possible? this:
Code:
function Movie($bla){
...
}
function Movie() {
...
}
doesnt work
(i could work around somehow, if it isnt possible, i just want to know)
|
http://www.phppatterns.com/index.php...leview/28/1/2/
Edit:
Looks like (as I don't do PHP) that the language didn't until recently include the ability to overload functions, including class constructors, and that the effect was acheivable in 'some other manner' as described in that page.
__________________
You're now playing ketchup
Last edited by pablissimo; 8 Mar 2003 at 23:31.
|
|
|
8 Mar 2003, 23:49
|
#4
|
Registered User
Join Date: Jan 2003
Posts: 4,290
|
thanks, and thanks for that page
(i dont get along with that language at all )
__________________
im not tolerant, i just dont care.
|
|
|
8 Mar 2003, 23:59
|
#5
|
Ball
Join Date: Oct 2001
Posts: 4,410
|
Quote:
Originally posted by wu_trax
how do i forward a request? in java i could do something like this:
response.sendRedirect("whereever.jsp");
or
getServletContext().getRequestDispatcher("/whereever.jsp").forward(request, response);
hgow do i do that in php? i know about that include-thingy, but that doesnt give me a new, clean page
|
http://www.php.net/manual/en/function.header.php
Not trying to start an argument with anyone, but are you really this desperate for a job?
|
|
|
9 Mar 2003, 00:28
|
#6
|
Registered User
Join Date: Jan 2003
Posts: 4,290
|
Quote:
Originally posted by queball
Not trying to start an argument with anyone, but are you really this desperate for a job?
|
i need to work for half a year in some company as part of my study and every company i found around here does something with php. i think i could do quite a lot with java, but with php ... nothing
without finding a job now i could waste yet another semester on discussing the foreign affairs policy of the usa, which is not all that usefull :/
i guess i should just try to do things a little slower and not try to understand everything at once. i get along with some things though, reading and writing data into a mysql-database is not that complicated
thanks anyway
__________________
im not tolerant, i just dont care.
|
|
|
9 Mar 2003, 15:59
|
#7
|
Guest
|
Quote:
how do i forward a request? in java i could do something like this:
response.sendRedirect("whereever.jsp");
or
getServletContext().getRequestDispatcher("/whereever.jsp").forward(request, response);
hgow do i do that in php? i know about that include-thingy, but that doesnt give me a new, clean page
|
You have to send "Location" Header... for example:
PHP Code:
header ("Location: http://www.example.com");
|
|
|
9 Mar 2003, 18:12
|
#8
|
/dev/zero Retired Mod
Join Date: May 2000
Posts: 415
|
You will find with most things that PHP is more of a text manipulation language than a web language, especially when compared to servlets or asp.net.
Dont get me wrong, its very nice (and very free) but its not as polished as its competitors.
__________________
#linux : Home of Genius
<idimmu> ok i was chained to a desk with this oriental dude
|
|
|
9 Mar 2003, 18:23
|
#9
|
Registered User
Join Date: Jan 2003
Posts: 4,290
|
i just finished my first application (something to access my movie-database) \o/
its very nice you can write a program without having any real idea of what you are doing
__________________
im not tolerant, i just dont care.
|
|
|
9 Mar 2003, 18:45
|
#10
|
Guest
|
You can't compare PHP with servlets cause PHP is a script language and not a server application. PHP is all right for normal dynamic web pages, but for bigger serverbased applications I'd prefer a language like Java.
|
|
|
9 Mar 2003, 19:01
|
#11
|
Registered User
Join Date: Jan 2003
Posts: 4,290
|
Quote:
Originally posted by Ares
You can't compare PHP with servlets cause PHP is a script language and not a server application. PHP is all right for normal dynamic web pages, but for bigger serverbased applications I'd prefer a language like Java.
|
ididnt want to compare them, its just that ive got some experience with java / jsps and close to none with php
__________________
im not tolerant, i just dont care.
|
|
|
9 Mar 2003, 20:04
|
#12
|
Guest
|
And I got experience with PHP but not (yet) with Java / jsp
|
|
|
10 Mar 2003, 16:05
|
#13
|
Forever Delayed
Join Date: Sep 2000
Location: www.netgamers.org
Posts: 1,475
|
Quote:
Originally posted by Ares
You can't compare PHP with servlets cause PHP is a script language and not a server application.
|
Exactly PHP was never intended to compete with Java et al. Although these days PHP is really looking good. I favour it over ASP for example.
M.
__________________
Firefly Oper and General l4m3r - "I Do Stuff"
O2 Rip-off campaign
<vampy> plus i hate people ... i despise humanity as a whole
pablissimo "I'm still geting over the fact you just posted a pic of your own vomit"
|
|
|
10 Mar 2003, 16:35
|
#14
|
Registered User
Join Date: Jan 2003
Posts: 4,290
|
i just read something about webservices and php. sounds like you can do a bit more than just acessing a database.
__________________
im not tolerant, i just dont care.
|
|
|
11 Mar 2003, 02:12
|
#15
|
Pedantic hypocrite
Join Date: Jan 2001
Location: Back and to the left
Posts: 1,488
|
Quote:
Originally posted by wu_trax
i just read something about webservices and php. sounds like you can do a bit more than just acessing a database.
|
Be careful, grasshopper, for stepping down this path may lead to Demented PHP Disciple syndrom.
Jester
__________________
I always wanted to be a dancer, but I could never get the shit off my shoes
.......
|
|
|
11 Mar 2003, 10:16
|
#16
|
ŻŻŻŻŻŻŻŻŻ
Join Date: May 2001
Location: Sept 2057
Posts: 1,813
|
Quote:
Originally posted by wu_trax
i just read something about webservices and php. sounds like you can do a bit more than just acessing a database.
|
I've written a set of IRC services in PHP.
Easy.
__________________
in my sig i write down all my previous co-ords and alliance positions as if they matter because I'm not important enough to be remembered by nickname alone.
|
|
|
11 Mar 2003, 12:11
|
#17
|
Registered User
Join Date: Jan 2003
Posts: 4,290
|
Quote:
Originally posted by Jester
Be careful, grasshopper, for stepping down this path may lead to Demented PHP Disciple syndrom.
Jester
|
dont worry, i still dont like the language and probably never will
__________________
im not tolerant, i just dont care.
|
|
|
11 Mar 2003, 23:08
|
#18
|
Pedantic hypocrite
Join Date: Jan 2001
Location: Back and to the left
Posts: 1,488
|
Quote:
Originally posted by xtothez
I've written a set of IRC services in PHP.
Easy.
|
Considering the amount of IRC services floating around the internet I'd hazard a guess that the simple act of writing an IRC service package is easy in and of itself. The language chosen is of little consequence.
Jester
__________________
I always wanted to be a dancer, but I could never get the shit off my shoes
.......
|
|
|
|
All times are GMT +1. The time now is 03:13.
| |