User Name
Password

Go Back   Planetarion Forums > Non Planetarion Discussions > Programming and Discussion
Register FAQ Members List Calendar Arcade Today's Posts

Reply
Thread Tools Display Modes
Unread 8 Mar 2003, 22:46   #1
wu_trax
Registered User
 
Join Date: Jan 2003
Posts: 4,290
wu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet society
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.
wu_trax is offline   Reply With Quote
Unread 8 Mar 2003, 23:13   #2
wu_trax
Registered User
 
Join Date: Jan 2003
Posts: 4,290
wu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet society
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.
wu_trax is offline   Reply With Quote
Unread 8 Mar 2003, 23:24   #3
pablissimo
Henry Kelly
 
pablissimo's Avatar
 
Join Date: Apr 2000
Posts: 7,374
pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.
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.
pablissimo is offline   Reply With Quote
Unread 8 Mar 2003, 23:49   #4
wu_trax
Registered User
 
Join Date: Jan 2003
Posts: 4,290
wu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet society
thanks, and thanks for that page
(i dont get along with that language at all )
__________________
im not tolerant, i just dont care.
wu_trax is offline   Reply With Quote
Unread 8 Mar 2003, 23:59   #5
queball
Ball
 
queball's Avatar
 
Join Date: Oct 2001
Posts: 4,410
queball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so little
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?
queball is offline   Reply With Quote
Unread 9 Mar 2003, 00:28   #6
wu_trax
Registered User
 
Join Date: Jan 2003
Posts: 4,290
wu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet society
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.
wu_trax is offline   Reply With Quote
Unread 9 Mar 2003, 15:59   #7
Ares
Guest
 
Posts: n/a
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"); 
  Reply With Quote
Unread 9 Mar 2003, 18:12   #8
MT
/dev/zero
Retired Mod
 
MT's Avatar
 
Join Date: May 2000
Posts: 415
MT is an unknown quantity at this point
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
MT is offline   Reply With Quote
Unread 9 Mar 2003, 18:23   #9
wu_trax
Registered User
 
Join Date: Jan 2003
Posts: 4,290
wu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet society
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.
wu_trax is offline   Reply With Quote
Unread 9 Mar 2003, 18:45   #10
Ares
Guest
 
Posts: n/a
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.
  Reply With Quote
Unread 9 Mar 2003, 19:01   #11
wu_trax
Registered User
 
Join Date: Jan 2003
Posts: 4,290
wu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet society
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.
wu_trax is offline   Reply With Quote
Unread 9 Mar 2003, 20:04   #12
Ares
Guest
 
Posts: n/a
And I got experience with PHP but not (yet) with Java / jsp
  Reply With Quote
Unread 10 Mar 2003, 16:05   #13
Mong
Forever Delayed
 
Join Date: Sep 2000
Location: www.netgamers.org
Posts: 1,475
Mong is on a distinguished road
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"
Mong is offline   Reply With Quote
Unread 10 Mar 2003, 16:35   #14
wu_trax
Registered User
 
Join Date: Jan 2003
Posts: 4,290
wu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet society
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.
wu_trax is offline   Reply With Quote
Unread 11 Mar 2003, 02:12   #15
Jester
Pedantic hypocrite
 
Jester's Avatar
 
Join Date: Jan 2001
Location: Back and to the left
Posts: 1,488
Jester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond repute
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
.......
Jester is offline   Reply With Quote
Unread 11 Mar 2003, 10:16   #16
xtothez
ŻŻŻŻŻŻŻŻŻ
 
xtothez's Avatar
 
Join Date: May 2001
Location: Sept 2057
Posts: 1,813
xtothez has much to be proud ofxtothez has much to be proud ofxtothez has much to be proud ofxtothez has much to be proud ofxtothez has much to be proud ofxtothez has much to be proud ofxtothez has much to be proud ofxtothez has much to be proud ofxtothez has much to be proud ofxtothez has much to be proud of
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.
xtothez is offline   Reply With Quote
Unread 11 Mar 2003, 12:11   #17
wu_trax
Registered User
 
Join Date: Jan 2003
Posts: 4,290
wu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet societywu_trax is a pillar of this Internet society
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.
wu_trax is offline   Reply With Quote
Unread 11 Mar 2003, 23:08   #18
Jester
Pedantic hypocrite
 
Jester's Avatar
 
Join Date: Jan 2001
Location: Back and to the left
Posts: 1,488
Jester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond reputeJester has a reputation beyond repute
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
.......
Jester is offline   Reply With Quote
Reply



Forum Jump


All times are GMT +1. The time now is 10:25.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright İ2002 - 2018