Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

PHP Q

Thread Tools
 
Search this Thread
 
Old 07 January 2002, 03:21 PM
  #1  
stevencotton
Scooby Regular
Thread Starter
 
stevencotton's Avatar
 
Join Date: Jan 2001
Location: behind twin turbos
Posts: 2,710
Likes: 0
Received 1 Like on 1 Post
Post

Yes, ASP is only relevant to extremely poor performing, broken and insecure webservers

Steve.


[Edited by stevencotton - 7/1/2002 3:27:26 PM]
Old 07 February 2002, 01:07 AM
  #2  
legacyPete
Scooby Regular
 
legacyPete's Avatar
 
Join Date: Dec 2001
Posts: 202
Likes: 0
Received 0 Likes on 0 Posts
Post

I started to learn ASP and thought it was needlessly complicated. PHP is more similar to other languages such as C++; therefore it made more sense to me. As dsmith is saying, we all have our own preferences.

I have also found that ASP hosting tends to be more expensive than *nix, especially if you want a decent database (not Access in other words).

Companies only want ASP because they don't know any better, they just think "duh... we need a website, what technology do we need... best use Microsoft because other companies are". I have nothing against ASP - if you're confident using it and can produce the results then great; but I have found it to be an obstructive language and it has not performed as well as PHP in my experience.

In conclusion, I would say that PHP is the better of the two (from my own experience before I get flamed ).

[Edited by legacyPete - 7/2/2002 1:09:56 AM]
Old 01 July 2002, 02:11 PM
  #3  
dsmith
Scooby Regular
 
dsmith's Avatar
 
Join Date: Mar 1999
Posts: 4,518
Likes: 0
Received 0 Likes on 0 Posts
Post

Starting to experiment with basic PHP scripts.

I want to read a file that has several lines each with

filename.jpg,"Description text here"

I can open the file, loop through and read all the lines etc. but what is the best/easiest way to parse each line into 2 variables

Tried sscanf($tempstring,"%s,%s",$var1,$var2);

But $var2 - which I want to be the description cuts off at the 1st space.

Suggestions ?

Thanks
Deano
Old 01 July 2002, 02:15 PM
  #4  
legacyPete
Scooby Regular
 
legacyPete's Avatar
 
Join Date: Dec 2001
Posts: 202
Likes: 0
Received 0 Likes on 0 Posts
Post

This might do it:

<?
$fcontents = file ('file.txt');
while (list ($line_num, $line) = each ($fcontents)) {
$myline = explode(",",$line);
echo "$myline[0]<br>";
echo "$myline[1]<br>";
}
?>
Old 01 July 2002, 02:19 PM
  #5  
Andrewza
Scooby Regular
 
Andrewza's Avatar
 
Join Date: Jan 2002
Posts: 667
Likes: 0
Received 0 Likes on 0 Posts
Post

list($filename,$description) = split(",",$tempstring);
Old 01 July 2002, 02:22 PM
  #6  
dsmith
Scooby Regular
 
dsmith's Avatar
 
Join Date: Mar 1999
Posts: 4,518
Likes: 0
Received 0 Likes on 0 Posts
Post

Andrew - would that allow the description to have commas in aswell , or would the second variable then cut off at the comma ?

Thanks

Deano
Old 01 July 2002, 02:29 PM
  #7  
Andrewza
Scooby Regular
 
Andrewza's Avatar
 
Join Date: Jan 2002
Posts: 667
Likes: 0
Received 0 Likes on 0 Posts
Post

Oops, do this then:

list($filename,$description) = split(",",$tempstring,2);

Tells split only to break into two parts
Old 01 July 2002, 02:36 PM
  #8  
dsmith
Scooby Regular
 
dsmith's Avatar
 
Join Date: Mar 1999
Posts: 4,518
Likes: 0
Received 0 Likes on 0 Posts
Post

Thanks andrew - just found that extra argument as you posted

Deamo
Old 01 July 2002, 02:39 PM
  #9  
Andrewza
Scooby Regular
 
Andrewza's Avatar
 
Join Date: Jan 2002
Posts: 667
Likes: 0
Received 0 Likes on 0 Posts
Post

Although of course we should be using explode() not split() since you aren't trying to use regular expressions, just a string. Both take exactly the same arguments anyhow.

Bit braindead today, car with clutch fliud backing up, train crash causing nice delays to work, then tube ****ed, then rained on and now my favourite lunch place has a power cut so no nice toastie sarnie for lunch, pffft!
Old 01 July 2002, 02:50 PM
  #10  
super_si
Scooby Regular
 
super_si's Avatar
 
Join Date: Feb 2002
Location: Lurkin Somewhere
Posts: 7,951
Likes: 0
Received 0 Likes on 0 Posts
Post

ive being told ASP is more relevant im starting that
Si
Old 01 July 2002, 02:52 PM
  #11  
Andrewza
Scooby Regular
 
Andrewza's Avatar
 
Join Date: Jan 2002
Posts: 667
Likes: 0
Received 0 Likes on 0 Posts
Wink

Well I get well paid to hack php for itv-f1.com and other itv work mostly, if that counts as relevant
Old 01 July 2002, 02:54 PM
  #12  
legacyPete
Scooby Regular
 
legacyPete's Avatar
 
Join Date: Dec 2001
Posts: 202
Likes: 0
Received 0 Likes on 0 Posts
Post

ASP is the biggest pile of cr@p, don't waste your time!
Old 01 July 2002, 08:59 PM
  #13  
AdrianFRST
Scooby Regular
 
AdrianFRST's Avatar
 
Join Date: Oct 2000
Posts: 368
Likes: 0
Received 0 Likes on 0 Posts
Post

I've just started my fifth role doing ASP.

I do PHP as well (all my own sites run PHP ) but as yet I've not found anyone who'll pay me to do it.

Everyone want to use ASP it would appear!
Old 01 July 2002, 09:11 PM
  #14  
super_si
Scooby Regular
 
super_si's Avatar
 
Join Date: Feb 2002
Location: Lurkin Somewhere
Posts: 7,951
Likes: 0
Received 0 Likes on 0 Posts
Post

which is better then PHP or ASP
Old 01 July 2002, 10:51 PM
  #15  
Andrewza
Scooby Regular
 
Andrewza's Avatar
 
Join Date: Jan 2002
Posts: 667
Likes: 0
Received 0 Likes on 0 Posts
Post

I would say PHP is better, I haven't done any ASP in a while though. Business like to use things you pay for, hence using MS/IIS/ASP, now if only they wouldn't keep coming out with so many security notices for IIS
Old 01 July 2002, 10:58 PM
  #16  
dsmith
Scooby Regular
 
dsmith's Avatar
 
Join Date: Mar 1999
Posts: 4,518
Likes: 0
Received 0 Likes on 0 Posts
Post

Super_si (ever thought your user name was a tad optimisitic ?)

There is no "better" - some people will use one in some situations - others will prefer something else. yet more people will prefer another option.

Arguments about which programming language is best are just slighty further up the futility scale than "Impreza vs Evo etc." arguments.

If you beleive you'll make one choice about which language to learn as a professional developer and that will be that, then I would suggest you'll find keeping a job when you finish your degree quite hard.

I'm not a dveloper myself - I'm just keen to learn a new skill so I've picked PHP to start with.

Deano
Old 02 July 2002, 10:25 AM
  #17  
super_si
Scooby Regular
 
super_si's Avatar
 
Join Date: Feb 2002
Location: Lurkin Somewhere
Posts: 7,951
Likes: 0
Received 0 Likes on 0 Posts
Post

If its like c , and java done them for 4yrs now so thinkill start PHP anyone got any reccomended books?

Si
Old 02 July 2002, 01:13 PM
  #18  
legacyPete
Scooby Regular
 
legacyPete's Avatar
 
Join Date: Dec 2001
Posts: 202
Likes: 0
Received 0 Likes on 0 Posts
Post

Don't really need books - php.net has all the info you need. Though if you do get stuck you can always just post on here
Old 02 July 2002, 01:30 PM
  #19  
super_si
Scooby Regular
 
super_si's Avatar
 
Join Date: Feb 2002
Location: Lurkin Somewhere
Posts: 7,951
Likes: 0
Received 0 Likes on 0 Posts
Post

Do i nee ILLS installed??

its crucify my network games?

Si
Old 02 July 2002, 01:39 PM
  #20  
snowcrash
Scooby Regular
 
snowcrash's Avatar
 
Join Date: Mar 2002
Location: www.scoobyzone.co.uk
Posts: 2,082
Likes: 0
Received 0 Likes on 0 Posts
Post

install apache with the php addon

http://www.apache.org
Old 02 July 2002, 01:41 PM
  #21  
legacyPete
Scooby Regular
 
legacyPete's Avatar
 
Join Date: Dec 2001
Posts: 202
Likes: 0
Received 0 Likes on 0 Posts
Post

If you want it on your own PC for testing just use something like phptriad - it installs Apache / PHP / MySQL for you. Not sure if it effects networked games though.
Old 02 July 2002, 01:42 PM
  #22  
super_si
Scooby Regular
 
super_si's Avatar
 
Join Date: Feb 2002
Location: Lurkin Somewhere
Posts: 7,951
Likes: 0
Received 0 Likes on 0 Posts
Post

cool do it later in process xp dual boot thingy




All times are GMT +1. The time now is 09:36 PM.