• Some users have recently had their accounts hijacked. It seems that the now defunct EVGA forums might have compromised your password there and seems many are using the same PW here. We would suggest you UPDATE YOUR PASSWORD and TURN ON 2FA for your account here to further secure it. None of the compromised accounts had 2FA turned on.
    Once you have enabled 2FA, your account will be updated soon to show a badge, letting other members know that you use 2FA to protect your account. This should be beneficial for everyone that uses FSFT.

PHP n00b. Help!

mcplaayer

n00b
Joined
Dec 29, 2004
Messages
59
Hey guys,

I noticed that a lot of you guys have a lot of experience developing server side applications through php and was wondering if you could give a n00b a few tips.

I just got hired by Veritas and was commissioned to develop a web-side bug reporting user-interactive web page through the use of PHP. Prior to this stint I worked as an embedded systems programmer so basically know jack shit about PHP.

A few questions:
What kind of IDE do you use?
What is the best way to go about developing this project?
Any tips for the newbie?

Thanks guys
 
1. vim
2. check sourceforge.net to see if it's already written. if it isn't then clone bugzilla
3. bookmark php.net/manual/en
 
doh said:
1. vim
2. check sourceforge.net to see if it's already written. if it isn't then clone bugzilla
3. bookmark php.net/manual/en
that pretty much sums it up.
 
thanks guys, i'll check those resources out.
gvim is my mo, but that's kind of old school. It'd be nice if there was an IDE (like eclipse) that gave me real-time syntax checking.

Also, I was wondering how you guys go about developing code that is supposed to exist on a web server. Do you guys load your .php file to the server each and everytime you want to check if that questionable line of code you just put in is valid/syntax free?
 
I don't know what others do, but I have apache and mysql running on my pc. that way, i can check stuff out straight away.

Apparently, zend studio is pretty good if you can get the money for it.
 
Actually there is a PHP thing for eclipse

sourceforge.net/projects/phpeclipse/

haven't really used it though since I have the Zend IDE for my php stuff at work.
 
great, i checked out the eclipse plug in. I don't know how well it will work though. I'm just accustomed to the eclipse env cuz we use them at school.

Alright guys, i'll be posting more questions and stuff about this project of mine, thanks all for your help.
 
This thread has also helped me out, but could you guys give a recent book recommendation for php?
I bought some old ones I found via searching, but just seeing if there is anything new :)
 
Well, if I'm on windows I like to use a free IDE called PHP Designer. If I'm on linux I like to use another free IDE called Quanta Plus.

They're both pretty good. I know a lot of people like to stick with the simple vim or whatever plain jane text editor but I'm not that way. I do like to actually work with code rather than WYSIWYG type editors. I also, being fairly new to PHP myself like to have code highlighting because it helps me out in more ways than one.

Also, since they're both free it's easy to at least try them out.
 
mcplaayer said:
thanks guys, i'll check those resources out.
gvim is my mo, but that's kind of old school. It'd be nice if there was an IDE (like eclipse) that gave me real-time syntax checking.

Also, I was wondering how you guys go about developing code that is supposed to exist on a web server. Do you guys load your .php file to the server each and everytime you want to check if that questionable line of code you just put in is valid/syntax free?

You need to basically turn your machine into the server, which is not difficult by any means (Well it could be I suppose, depending on your setup).

Either way, I would 1) Download, install, and setup Apache. 2) Download, install, setup PHP and 3) Download, install, setup MySQL.

You can actually prolly get all 3 of those wrapped into a nice package for ya somewhere, but I always go seperate, not for any particular reason.
 
Wingy said:
You need to basically turn your machine into the server, which is not difficult by any means (Well it could be I suppose, depending on your setup).

Either way, I would 1) Download, install, and setup Apache. 2) Download, install, setup PHP and 3) Download, install, setup MySQL.

You can actually prolly get all 3 of those wrapped into a nice package for ya somewhere, but I always go seperate, not for any particular reason.

XAMPP is very convenient.
 
I have XAMPP installed and use PHP Designer 2006, which can do localhost tests and debugs for you. I also have a demo server that I upload to once my code checks out on debug to be sure it works in a live environment.
 
zman099 said:
here a good book im using right now to learn php

http://search.barnesandnoble.com/bo...321336577&itm=1

I used the first edition (PHP 3 & 4 MySQL 3 & 4) and I must say, it really helped. I knew a bit of regular SQL so I skipped some of the basic SQL stuff. The examples given in the book are really great and easy to understand if you have no knowledge at all about PHP.

I'm assuming the second addition is relatively the same as the first with just new additions, but the first one helped me with PHP when I started. That book should be able to get you going and if you need any other references, the regular php.net manual is good.
 
Hey thanks for all the posts guys,

I'll try and figure out which installer packwould suite my needs the most. Also what is the purpose of mySQL? I'm not doing anything database intensive. I think all I am doing is query-ing a text file (either remotely or locally not sure yet), grabbing the information (bug sev, priority), and putting it all nice and pretty in a web format.

help?!
man i have no idea how i got hired to do scripting. I work embedded!
 
mcplaayer said:
Hey thanks for all the posts guys,

I'll try and figure out which installer packwould suite my needs the most. Also what is the purpose of mySQL? I'm not doing anything database intensive. I think all I am doing is query-ing a text file (either remotely or locally not sure yet), grabbing the information (bug sev, priority), and putting it all nice and pretty in a web format.

help?!
man i have no idea how i got hired to do scripting. I work embedded!

how about me im a electronics guy and i got hired to do half IT and VOIP sound quality testing heheh
 
Ok, just had a meeting with the manager.

So, I'm gonna ask you guys a language selection question. Should I do this in Perl or PHP?

Design requirements:
1. Create a web user interface to edit (create/delete/modify) a large text file that exists (under CVS control) on one of our large unix clusters.
2. This form will then take the modifications, and insert them into a copy of the original file.

Bascially, create a text editor to edit a file, making sure no extra carraige returns are put in (as that will screw up chrono job script)
 
compslckr said:
easyPHP is also very good, it contains mySQL, apache and PHP, here is a link for that

EasyPHP

I agree, this is the easiest way to setup a mysql/php env on your pc.
 
As for "why MySQL": You really, really want to put this kind of data in a database; It makes inserting, retriving, sorting and querying that much easier.
The sheer convenience of being able to do something like
Code:
SELECT number, name, bugs.description, severities.description
FROM bugs
LEFT JOIN severities ON bugs.severity=severities.severity
WHERE fixed=0 AND bugs.severity>2  and product='whatever' 
ORDER BY entered_date DESC
instead reading/parsing/selecting/sorting a text file is worth the overhead alone.

BTW, no guarantees on the above being accepted by MySQL (or even being correct). :)

edit: I notice there's already a text file in place that you have to work with.[1] I would still suggest tinkering with a database capable of doing the same things, with a future migration in mind. Dependent on you having the time, of course.

[1] One day I'll have to begin reading everything before posting.
 
I like Web Applications with PHP and MySQL (or something like that). It's an O'Reilly book, and very useful.
 
sigh i need to ask my co-workers for a SQL book. I can't do this all through the [H]ardForum =(

Thanks for all the help guys!
 
hitokiri said:
I used the first edition (PHP 3 & 4 MySQL 3 & 4) and I must say, it really helped. I knew a bit of regular SQL so I skipped some of the basic SQL stuff. The examples given in the book are really great and easy to understand if you have no knowledge at all about PHP.

I'm assuming the second addition is relatively the same as the first with just new additions, but the first one helped me with PHP when I started. That book should be able to get you going and if you need any other references, the regular php.net manual is good.

I got the second edition. It is a fantastic book. I really like the author. Easy to read and understand. A supurb resource. Go get it now. (no, I don't work for him)
 
Hey guys, this is what I currently have set up:

1. I have a large text file that exists on our Unix cluster that will display everything on the file, on a TEXTAREA html form.

Question: Using the POST method of a form, will carraige returns that are entered by the user be passed to the server?

Question: How do I create a script that will make a diff on the file that user submitted (basically small changes of the existing file mentioned above), and display the results of the diff to the user?

this is what my form looks like:

<TEXTAREA NAME="results" COLS=90 ROWS=30 wrap = off>
<?php
if (!($fp=fopen('EmpericalContext.text', 'r+'))) {
printf("Could not open file EmpericalContext.text");
return;
}

$textArray = file('empericalContext.text');
foreach ($textArray as $sIdx => $sVal)
{
if($textArray{0} == '/') continue;
echo("$sVal");
}

if (fclose($fp) == false){
printf("Could not close file EmpericalContext.text");
}
?>
</TEXTAREA>
 
Back
Top