chrishea 182 Nearly a Posting Virtuoso

Those who spend time helping to provide solutions deserve, but very often don't get some positive feedback. Maybe showing something as solved isn't treated by everyone as being significant but you have to take what you can get. As mentioned, many op's make a single post with their issue and are never heard from again. I think it is worth encouraging people to provide answers, otherwise this whole process doesn't work. If that encouragement has to sometimes come from the forum (through the moderators) instead of the OP, then that's ok (with the understanding that it's a bit more work for the moderators). To make it easier for the moderators, it would be good for other experienced contributors to recommend posts that deserve to be closed as "deemed as solved". Maybe there should be a separate status for ones that are forced to solved status rather than shown as solved by the op (even though they would both count in the solved count). For anyone who is looking for a solution to their current issue, finding an old post that is "deemed as solved" provides a higher level of assurance that it is a correct answer than nothing as all (i.e. dead silence).

On the flip side, I think that anyone who makes a post that is replied to but then does not provide any feedback (pro or con) within a certain period of time should automatically lose reputation points (with the rules updated appropriately). It would also be …

chrishea 182 Nearly a Posting Virtuoso
chrishea 182 Nearly a Posting Virtuoso

What is your point in adding to a thread that started in 2004 and hasn't had anything posted since 2009. Your post didn't add anything useful and neither did many of the sporadic posts since 2004.

chrishea 182 Nearly a Posting Virtuoso

Free Tip: It can sometimes be a lot quicker to search for your problem on the web and see what solutions other people have come up with rather than post it on a forum such as this one and hope that someone will solve it for you.

It appears that you are using GoDaddy as your web host. If that is the case, then the link below should be pertinent to your situation. If not, do some further searching on the web for the message you are getting.

http://www.phpbuilder.com/board/showthread.php?t=10367822

chrishea 182 Nearly a Posting Virtuoso

I went through a bunch of quotes about making a difference and this one seemed as good as any of them:
You must be the change you wish to see in the world.
Mahatma Ghandi.

Most of the quotes focused on the ability of an individual to make a difference. There is another quote that wasn't in the list that says something to the effect that the only way that change has ever occurred is by the efforts of an individual.

We have some intelligent people in this forum who have provided comments on this topic. I think there is general agreement that the current economic (and political) system in North America and Europe is pretty badly broken. It is easy to imagine everything getting worse and worse as the impact of the debt load in these countries really hits home. We don't see great political leadership. Instead we see political "leaders" spending us into bankruptcy.

So my question is: If we as individuals can make a difference, what kind of difference should we make and how should we go about it? It's easy to get on the gloom and doom track and that is what we naturally tend to do. If we actually want to look forward to these major issues getting addressed and resolved, how can we be that change?

diafol commented: Nice tack +0
chrishea 182 Nearly a Posting Virtuoso

It's time for you to pause and calmly sort things out a bit before jumping into something else. It seems that you have a passion for music and you don't necessarily have a clear passion for anything else. Just doing something to make money without having much real interest in it means that you'll be spending 40 hours a week wishing you were playing music or doing something else and you'll probably never be really good at it. I understand the attraction that music has because I played in bands over the years and liked that better than most other things that I did. I was never under any illusions about making a living from it (and you may not be either at this point) and I really did like programming so that gave me a path that worked out pretty well.

Most Universities have guidance departments and there might be some benefit to going through one or more of the standard aptitude tests to get an inventory of what you like and don't like. If, for example, you have a problem with "A job sitting in a cubicle all day" whether its programming or something else, then you might need something more active. That would put a lot of office jobs much lower on your list. You can probably get a book or find internet resources that would help you to do an assessment on your own.

There are certainly other computer-related jobs that don't involve programming …

chrishea 182 Nearly a Posting Virtuoso

You gain skills and knowledge by doing smaller projects first (and by looking at other people's code). This includes coding standards and debugging skills. You will also pick up modules and code snippets (and build your own library) that can be used to address specific needs when you do further projects.

If you do a relatively small project and the code is organized so poorly that you can barely understand how it works anymore; you can write it off as experience and even rewrite the whole thing if you have to. With a larger project with many modules, if you don't have a good structure and good standards to start with, then you could end up spending a lot of time creating something that you have great difficulty maintaining or changing when it's done. After spending a lot of time to create this much larger system, you would be very reluctant to throw it out and start over (but your ongoing cost if you don't could be quite high). If someone was designing and constructing a multi-storey building, you would expect them to have some training and experience starting with something small. Is software design and construction so much easier that we can just jump in and do it successfully on a large scale before spending the time to develop the appropriate skills and knowledge? I don't think it is. In both cases, I think that the end result may be something in danger of crumbling.

jbennet commented: good advice +0
chrishea 182 Nearly a Posting Virtuoso

if you are on a linux system, you can define the permission for the file as 4-0-0 which only lets the system read the file. Some hosts don't allow 4-0-0 so give it the lowest possible permission. If you are under Windows, there must be an equivalent.

Nahiyan commented: Thanks for the hint +2
chrishea 182 Nearly a Posting Virtuoso

That there is a thread called "What New Thing Did You Learn Today??"

chrishea 182 Nearly a Posting Virtuoso

If your web host supports Cron (most Linux hosts do)) then you need to set up a PHP job to select the records and do the emailing and schedule it using Cron. Your web host should be able to provide you with info on how to set it up but it is quite straightforward. If you are running on a Windows host, they should have an equivalent facility.

To do the mailing, you can build it yourself using the PHP mail command or you can use a library that makes it a bit easier (especially if you are sending attachments). More info on that here.

karthik_ppts commented: useful post +6
chrishea 182 Nearly a Posting Virtuoso

You can find sites dedicated to Open Source and C# with an Internet search. You are most interested in "project teams" so that should probably be in your search terms. The link below is one I found with only a few minutes effort.

http://www.codeplex.com/site/search/openings

chrishea 182 Nearly a Posting Virtuoso

One way to get some experience would be to join up with an Open-Source project team (as a developer or a tester or both). It isn't a short-term fix but it might be a way to get some additional development skills and to have something else that's relevant on your resume. You could inquire at the outset who would be able to give you a reference and find out what credentials they have.

chrishea 182 Nearly a Posting Virtuoso

It probably would be easier to find a position in testing / Quality Control. The training that you have had so far could work in your favor but it might not. If you have already had some training / experience in preparing test plans,matrices and cases; and, you can demonstrate that, then that will help. If most of your experience to-date is development with the testing being relatively informal and undocumented then it may not help as much. If the interviewer is looking for a long-term person for the testing function and your main interest is getting some more knowledge and then getting out of testing and into development, he/she may get a sense of that and that may reduce your chances.

It depends to a significant degree on your testing experience and the Company's culture. If you have some applicable experience and if they are looking for a good person for the longer term for the Company not just for a specific function: then your academic credentials and management experience could be seen as a significant asset. If you don't have a lot of exposure to formalized testing methodologies (assuming that the Company uses one or would find that knowledge beneficial), then I suggest that you do some research and learn as much as you can before you go out for any interviews. You also need to be prepared to make a commitment to a testing role for 2 - 4 years. You should also leave the door …

chrishea 182 Nearly a Posting Virtuoso

What would lead you to that conclusion? There are probably hundreds of PHP-based systems that use templates. In addition there are thousands of templates built using HTML, CSS, Flash and everything else you can possibly think of. Rather than second-guess exactly what the question really means, JorJah needs to clarify the question and provide more info.

chrishea 182 Nearly a Posting Virtuoso

Since this is your first post, welcome to Daniweb.

This sounds like a school assignment. If so, then it is up to you to complete the assignment, otherwise you won't learn much and your grade would be meaningless. If you have a specific problem where you need help, then you can post that and someone may be able to give you some suggestions / guidance.

With respect to creating PDF files, you can create the PDF directly in your code using a PDF library or you can create a report in HTML that is written to a file and then converted to a PDF for you. The latter approach is quite easy to do using HTML2PDF. Click here for more info. I don't know of a program that would dump a file to a PDF (unless the file is already formatted as a report using html) but if that is what you need you might be able to find something doing an internet search.

For emailing output, you can use the PHP mail command and set everything up in your program or you can use some pre-defined Functions that will do it for you. I use a library called LibMail that makes it quite simple. You can get more info here.

chrishea 182 Nearly a Posting Virtuoso

It helps if you decide what your priority is. There are many web hosts that do a good job but they aren't all exactly the same. I've been using ICDSoft for many years and I'm very happy with them. If you were to compare them with some of the other web hosts you would find that many others offer "unlimited" databases, "unlimited" bandwidth and so forth. ICDSoft doesn't. They offer a good package managed very professionally and backed up by excellent service. Some people have said in past discussions on this topic that they require unlimited databases so they wouldn't use ICDSoft. In that case they should use someone else. There can be a lot of smoke and mirrors involved in the "unlimited" term so if that is important to you, it's best to look a little deeper because there are usually some limits whether they publish them or not.

Getting a recommendation as you are trying to do can be a good way to get a short list. If your needs are simple, then you might be satisfied with any of the companies on the list. If you are going to push the limits, then it's worthwhile to do some extra research first.

chrishea 182 Nearly a Posting Virtuoso

Maybe the fact that there is no semi-colon ending line 175 might have something to do with it!?

iamthwee commented: Okay you get the cookie... +15
chrishea 182 Nearly a Posting Virtuoso

You may find this useful, especially about setting up a test environment. Using a Content Management System would provide you with restricted areas, user logons and a lot of other stuff right out of the box. There are many open source (free) systems available. You'll probably save a lot of time by doing that rather than building your own. If you ask which one is best, you will probably get a lot of answers from those who are fans of one system or the other. I don't use it myself but WordPress is one of the more popular systems and relatively easy to use.

If you are already too far into this project to go that way, then you may be able to find some code that will provide most of what you need for the login part.

With respect to setting up a system on a server, it is mostly a matter of uploading the programs / scripts to the server directory (usually the www or htdocs directory). If you are using MySQL, then you would have to set up the database (probably using PHPMyAdmin: a utility that is available most everywhere) and you would probably have some config info that would be different on the server (vs your test env).

None of this is overly difficult but for someone new there will probably be a lot of things that are relatively new to you so it may take some time and it will …

faroukmuhammad commented: good resource +4
chrishea 182 Nearly a Posting Virtuoso

As a server-side programming language, PHP isn't the right way to deal with a device like a modem. You can certainly do it by sending to a third party service or to the phone company server as an email (if they provide that service where you are). If you search this site you will find some previous posts about doing this directly through a modem but you will probably see that it is being done using C or Java.

chrishea 182 Nearly a Posting Virtuoso

What is the context for your questions? This sounds like a school assignment. If that is the case, I would hope that the course includes material that would address these questions or that you can do better research than just dropping the questions into a forum such as this one.

With respect to the last two points, developers want and need frozen requirements but actually getting a truly frozen requirement is quite difficult. You may do a good job of defining what will and won't be delivered (in your own mind) but at some point the user may finally understand what they are getting and it isn't what they imagined (or maybe they just didn't think about it too much). "Legally" you may have written an agreement that protects you but you now have a situation where the user may not be getting what they really want/need. Do you then stand by what was originally written or do you go through a revision to the requirement? At a minimum, if things were well defined, there can be some recognition that you tried to define it and that you are trying to deliver what you promised. Otherwise, you get finger pointing and attempts to place blame on the developer(s).

Customers also need well defined requirements so they know what they are supposed to get and so there is a reference which can be used to determine if they got it or not. From the Customer point of view, the …

happygeek commented: good answer +0
chrishea 182 Nearly a Posting Virtuoso

You shouldn't post the same question in multiple forums. Start somewhere and if you don't get an answer there, you will probably get a suggestion on the best place to get an answer.

A CSV file is pretty simple. It is almost the same as a text file in terms of any sort of formatting. If you want to save the file with formatting included, then you should save it in some other format

You don't say how you want to print this file. If you are creating the file in PHP then saving it locally on your PC, then you could open it in Excel or some other spreadsheet program and manually add colors then print it. If it is still on the server, you could open it in a PHP program and have the program add colors to the text. You can't save formatting in a CSV file as you would in a Word (.doc) file.

pritaeas commented: If I'd seen this I wouldn't have posted. +13
chrishea 182 Nearly a Posting Virtuoso

Here is a little sample program to demonstrate this:

<?PHP

// This demos how to access (Post) variables that have been created in a series 
// with a base name and an index number.
// For a real app, the $x variable will probably be $_POST

     $count     = 3;            // create this in the form (hidden variable) 
     $x[field1] = "aaaa";       // set up some test data
     $x[field2] = "bbbb";
     $x[field3] = "cccc";
     
     $i = 1;

     while  ($i <= $count) {
          $name = "field".$i;
          $val = $x[$name];
          echo "<br>Do whatever processing needs to be done for ".$val;
          $i++;
     }
?>
aphpdeveloper commented: very helpful +0
chrishea 182 Nearly a Posting Virtuoso

If you want to create a series of variables (checkboxes) in a form and then be able to use those variables in the processing of the form data, you can:

1. Create the variables in a loop using
<input type=checkbox name="check".$i value= ...

giving you a series of variables from check1 to checkn

2. In the program that receives the form data, you can also construct variables with these names but in a slightly different way:

$wk = ${"check".$i};

This creates the $check1 variable (if $i = 1) thus both $check1 and $wk would have
the same value.

aphpdeveloper commented: Thanks for the help so far +0
chrishea 182 Nearly a Posting Virtuoso

As a general approach, if you are having a problem with a query, the fastest way to sort it out is to echo the query, paste it into PHPMyAdmin and work on it there until you have it figured out. Then you can change your code accordingly.

karthik_ppts commented: yes +5
chrishea 182 Nearly a Posting Virtuoso

If you get bored with programming that easily, then maybe you just weren't made to be a programmer. Programming requires patience and perseverance. I don't think that there is any way around that. There are solutions like frameworks that are supposed to speed up the development process but in order to get to the point where you can effectively use the framework, you have to invest quite a bit of time to understand it.

One way to cut down the development time is to collect a library of code for common functions. Using include modules and reusing / adapting code can cut down the development time quite significantly. No matter what you do though, I don't think that you'll be able to develop anything significant in a day. There are some code generators (e.g POG) but I don't know if any serious development is being done with them or how much quicker they make the process.

kolibrizas commented: Very interesting tool that you have just suggested. Big thanks! +1
chrishea 182 Nearly a Posting Virtuoso

If you want help, then you need to demonstrate some effort and provide an initial design with some specific questions. If you can't get that far on your own, then maybe you don't deserve to graduate! There are lots of reservation systems out there and that probably includes some open source ones that you can download. Do some research and build a rough design and define the features that you want to include. There's all kinds of stuff out there on the Internet waiting to be found.

chrishea 182 Nearly a Posting Virtuoso

As you seem to already recognize, when you include the module with the arrays, you are getting a fresh copy every time. If your intent is to pass these arrays around and update them, then you are right again, using session variables would be the best way to do it. In your include module, you could enclose all the definitions in an if:

session_start();
if ($_SESSION['array_flag'] <> "set") {
   $_SESSION['array_flag'] = "set";
   $_SESSION['model'] = array(1=>"Compact",2=>"Saloon",3=>"SUV" );
   ...
}

That way you'll only do the definitions once. All of your arrays need to become Session variables as I showed above for mode1. Anywhere that you use the arrays, you will now reference the Session versions. Any modules that use the session variables must have a session_start statement.

llamaboy commented: Was simple and easy to understand +1
chrishea 182 Nearly a Posting Virtuoso

You could explode the string using the ":" as the delimiter. This will give you an array with two entries. Take the first entry, multiply it by 60 then add the result to the second entry and you're done.

chrishea 182 Nearly a Posting Virtuoso

I stand by my comments and some of yours are rude and inappropriate. If you don't ask a good question, you are probably not going to get a good answer. If you want round corners on boxes or background images or whatever, then stating the specific needs may get you a useful response. "Fancy" may mean some specific things to you in this context but it won't mean a lot to anyone else who hasn't seen your site in its current state and doesn't know what things you like or don't like. If you have ever worked with customers on doing any web design, then you will know that it is like art and what appeals to one person may be very unsatisfactory to someone else. I don't think that there is any cookbook for this sort of thing, it tends to be pretty personalized. So I say again, if you were to post a screenshot and provide some ideas of the type of changes that you would like to be able to make, you might get some helpful feedback.

chrishea 182 Nearly a Posting Virtuoso

Your question is pretty broad and difficult for anyone to respond to in a meaningful way. You say that you already know css, html, php, mysql, ajax and javascript but that you can't get beyond a very basic appearance for your system. That is contradictory since making a system look "fancy" is done using CSS and Javascript, often using one of the Javascript libraries like JQuery. If you don't know how to apply these tools to achieve your goal, then you need to post a very specific example / question (and maybe in some other forum rather than the PHP forum since PHP probably isn't your issue or the solution). If you said, here is a screenshot of my current forum page and I want to add drop-down lists / a shadowed border / some other specific feature, then someone could probably point you in the right direction.

chrishea 182 Nearly a Posting Virtuoso

Since you have limited experience, you might want to find someone who does have business and website experience who can review your idea and provide you with some feedback. If it is going to be a large project, then you will want to create a realistic plan with respect to the time and cost required (with help from someone with relevant experience). You'll also want to do some research to determine if your idea is really unique or if someone is already doing t.

In terms of protecting your idea, you can use a non-disclosure and "non-compete" agreement with anyone that you bring in to help you. You will still want to be careful who you share the info with since agreements are only as strong as the legal action that you are prepared to initiate to enforce them.

chrishea 182 Nearly a Posting Virtuoso

You also have an issue that your page doesn't scale to the screen size and the minimum width is pretty wide. On my screen (1366 wide) I have to scroll horizontally to get to the right side of the page while you have unused gray space on the left and your menu extends beyond the width of your "tabs" on the right to make the screen even wider than necessary.

chrishea 182 Nearly a Posting Virtuoso

It looks like this Zend facility has the ability to convert .doc to .pdf. That way, you could display it as a PDF:

http://www.phplivedocx.org/2009/02/06/convert-doc-to-pdf-in-php/

diafol commented: Whooaar! Nice - been looking for an implementation. Shame about the ZF though - can't get my head around it. +9
chrishea 182 Nearly a Posting Virtuoso

"Getting a little action" means you don't need to take a laxative.

The little gray-haired lady you help across the street is your wife.

There's nothing left to learn the hard way.

When you don't care where your wife goes, just so you don't have to go along.

Your supply of brain cells is finally down to a manageable size.

You're asleep, but others worry that you're dead.

Your friends compliment you on your new alligator shoes and you're barefoot.
___________________

As a senior citizen was driving down the freeway, his car phone rang.
Answering, he heard his wife's voice urgently warning him, "Herman, I just
heard on the news that there's a car going the wrong way on 280. Please be
careful!"

"Hell," said Herman, "It's not just one car. It's hundreds of them!"

Ancient Dragon commented: LOL +0
jingda commented: Nice +0
chrishea 182 Nearly a Posting Virtuoso

There are just too many students and other newbies who want you to do it for them rather than make some effort, do the research and give it a decent try before asking for help. It adds some traffic to Daniweb but it does nothing for the quality of the site. When people are clearly demonstrating that they are lazy and/or looking for an easy way out, they deserve some negative feedback.

diafol commented: very well said +0
chrishea 182 Nearly a Posting Virtuoso

The (unix) timestamp is defined as "...the number of seconds elapsed since midnight Coordinated Universal Time (UTC) of January 1, 1970, not counting leap seconds".

Thus, it is a relative time in seconds. If you subtract one timestamp from another, you get the number of seconds between the two dates-times. You can convert a date to a timestamp with strtotime and you can convert a timestamp to a formatted date with the Date command.

chrishea 182 Nearly a Posting Virtuoso

$strcontent (line 8) can be any html (including the html that you are creating dynamically). The html2pdf examples read example files as the input but there is no requirement to do it that way. In your code, as you create lines of output, append them to $strcontent until it has the full output ( $trcontent .= ...)

chrishea 182 Nearly a Posting Virtuoso

You can write it out using any of the File functions (e.g. file_put_contents) under a a temp name ending with a .php suffix. You should probably be putting it in a separate folder just for that purpose. You can give the user a link to that temp program file. If this is software that the user will load onto his/her own site and this function is well protected, then there may not be a security issue (at least not for you). If it is on your own site, then you need to carefully consider the security hole that you are opening.

diafol commented: Needed to be said +8
chrishea 182 Nearly a Posting Virtuoso

Cron is the Linux facility that schedules jobs based on start time. Most hosts provide it. Usually there is some kind of setup utility for it that you can access from your Control Panel. You can schedule a PHP program using Cron but if you prefer Python, you can probably do it that way as well.

chrishea 182 Nearly a Posting Virtuoso

I recently came across Twilio.com that provides API facilities to implement voice or text capabilities through the internet. They aren't the first to provide this kind of service but the capability of the API and their pricing seem to make them worth looking at for anyone who has a need for this type of facility. The service is mainly intended for North America at this point however, they do support international outbound calls.

Twilio can get you your own phone number for $1 / month ($2 toll free) if you need it. It is pay-as-you go at 1 cent / minute for incoming voice, 2 cents / minute for outgoing voice or for SMS in either direction. They provide API facilities to put in a virtual PBX and other kinds of voice apps. They have a sample phone system app that can be used and examples of using the API in a number of languages, including PHP.

We see questions on a regular basis about implementing an SMS interface. For those who need incoming SMS (to their app) this seems like a pretty good option. You can do your own outbound SMS interface through email for free if you know the carrier for each number. This sort of interface lets the supplier (Twilio) sort out the carrier. For business use, you can also implement a pretty sophisticated voice app.

Their prices seem pretty reasonable. I don't have any personal interest (financial or otherwise) in this …

chrishea 182 Nearly a Posting Virtuoso

Here are a couple of links to comments about the Google changes. In theory, the changes were aimed at so-called "content farms" like eHow but they seem to have cut a wider swath than that. From early reports, it isn't just low-quality sites that are getting hit. That's the problem in Google being close to a monopoly.

http://www.webmasterworld.com/google/4272069.htm
http://searchengineland.com/google-forecloses-on-content-farms-with-farmer-algorithm-update-66071

chrishea 182 Nearly a Posting Virtuoso

Check the manual for mysql_query. It returns a resource it doesn't return a field.

chrishea 182 Nearly a Posting Virtuoso

Please restate the key issue. This statement says the same thing twice:
" If the IP isn't existing, the system will add the IP but if the IP doesn't exist he also adds the IP."

chrishea 182 Nearly a Posting Virtuoso

I just read through one of the Spoonlicker threads and as Ardav pointed out, it's quite amazing that as one person realized that it was a waste of time and gave up, someone else would jump in and keep it going some more. It's too bad that we can't have some annual awards. There are positive categories like Most Interesting Question or Most Thorough Answer but then there are a bunch of others like Most Gullible, Laziest Person Posing as a Programmer and so forth. You have to get cheap entertainment wherever you can!

chrishea 182 Nearly a Posting Virtuoso

Hi Rohit,
Advice is free. It's your job to develop the code.

You have defined the output that you want. If you aren't sure of the logic needed to get that result, then I suggest that you develop some pseudo-code to work out the logic before trying to make it PHP code. It may take a while and you may have to revise it a number of times before it seems to do what you need it to do but that is what programming is all about. The only way that you get better at it is to do it. If someone hands you the answer, then you will hit the same situation again and you will be no better at it than you were the first time. In order to give you an answer, I would have to go through the same process and what is the point of that for me or for you?

If you get to some pseudo-code that seems to be what you need, then you turn it into PHP and test it. It may not work exactly as you had hoped and then you dig at it again and figure out why. Again, that is what programming is all about. Once you have gone through the whole process and if it is still not working, then you could bring back some code or even pseudo-code, outline what you have already tried, what isn't working and ask a specific question. That is …

mschroeder commented: Absolutely agree +3
chrishea 182 Nearly a Posting Virtuoso

There are many languages that could be used to do this. PHP is a good choice because it is widely used, it is supported on most servers, it is free (as is the MySQL database) and there are lots of resources available.

Even though PHP is relatively easy to learn, it isn't something that you learn overnight and then produce commercial quality scripts. Besides the PHP syntax, you need programming and debugging skill / knowledge / experience, you will need to be quite familiar with HTML and you will probably need to know some CSS. If you want your scripts to have a snappy web2 user interface, then you will need to get into Javascript or a Javascript library like JQuery. You will need to set up a development environment, you will need some knowledge of the server that you'll be running this on (probably running under Linux) and you will need to use an FTP program to move things back and forth.

If this is something that you want to implement relatively soon, then the best way would be to pay someone to do it who already has the required skills and experience. If you have lots of time to complete this and you really want to learn some or all of this stuff (not just for one project) then start reading tutorials (e.g. from W3Schools), download and install a development environment and go for it.

AndreRet commented: Nicely outlaid answer. +0
chrishea 182 Nearly a Posting Virtuoso

Assuming that this isn't just an academic question and that you want to do it yourself, then the best answer is to use something that you are comfortable with. If you want it to be lightweight and you are already into C or C++ then they can do it. It is unlikely that you will learn a new language just to code this module. If I had to do it, I would probably use something that isn't so lightweight because that is what I am familiar with and because I don't think that lightweight is all that important anymore given todays processors and larger memory under 64 bit systems.

chrishea 182 Nearly a Posting Virtuoso

You can get the user's IP ($_SERVER)

If you store this in the user's DB record, you can check it on a subsequent login request for the same user.

It isn't very difficult to prevent additional logins but you need to handle the situation where the user just shuts down without logging out.

Do you have code that will detect this and log the user out automatically? If you don't, then the next time the user tries to login, you might reject it unless you have some sort of check to recognize the situation. OK, your next question is how to do that. I don't have a specific suggestion or code. You can handle it up-front when a session has been inactive for a certain period of time or you can handle it on the next login attempt. You may need to set a cookie on the user's machine in order to manage this properly. This additional error-handling will make it a bit more complicated so with limited knowledge, you might find this challenging. I don't have any code to offer but you can probably find some on Daniweb or the web. You might want to try a search on 'auto logout' for starters.

Suzie999 commented: helpful advice +1
chrishea 182 Nearly a Posting Virtuoso

echo vs print
Time to find on the internet 20 - 30 sec max
http://www.htmlite.com/php004.php

endif isn't used in normal everyday php. It may be used in one of the frameworks that implement MVC.

Return
You can use return in a function to return a value to the function call. The use of return is covered in the PHP manual. If you don't have a copy, get it. If you do have one, you need to use it.

Die
To quote the manual:
"This language construct is equivalent to exit()"
If you aren't familiar with exit, look it up in the manual.

To be a good programmer, you need to be reasonably self-sufficient. That means being able to search for what you need on the Internet and to use the manuals that are available. Yes, you need to understand how the various commands/verbs work but PHP is pretty well documented and has all kinds of info/examples/tutorials on the internet. It's usually a lot quicker and more effective to find the answers for yourself. PHP has been around for quite a long time and there are many thousands of people using it. All of the easy questions and most of the harder ones have been asked and answered already. It's all out there, you just have to use it.

chrishea 182 Nearly a Posting Virtuoso

If you are so anxious to write another vBulletin, maybe you should do a bit of research to understand what you are getting into. For starters, the history of vBulletin itself:

In 1999, [1] James E. Limm and John Percival were running a Visual Basic website using Infopop's UBB.classic forum software on VB Forums.[2] As their site grew, they noticed that their software, written in Perl using a flat-file database, could not always cope with the number of users they had. In February 2000, the two decided that it would be better to write their own solution as both were unfamiliar with the software's code and thus unable to optimize it. Initially, it was designed solely as a rewrite of UBB, in PHP using MySQL, and was meant only for their own forum. Other UBB owners expressed interest in the solution, and they offered to sell it to Infopop, but their proposal was rejected. As there was still a demand for the software, Limm and Percival created Jelsoft and released their work as a paid solution, called vBulletin 1.

After subsequent minor releases of their software, the two decided to start working on a new version that would be more than a rewrite of UBB: they wanted to turn their software into a competitive solution for forums. Rewriting the entirety of the product, vBulletin 2 commenced development. Shortly thereafter, Limm became the managing director and Percival the lead developer. To help with the scale of the project, two …

vinayakgarg commented: Well said!! +2
mschroeder commented: very well put +3