chrishea 182 Nearly a Posting Virtuoso

Make sure the value is in quotes if it contains a blank.

chrishea 182 Nearly a Posting Virtuoso

You can check the php ini parameter session.cookie_lifetime. It is normally set to 0 to make the session last until the browser is closed.

chrishea 182 Nearly a Posting Virtuoso

If the flow of control moves between modules using forms and as a result of the action parameter on the <form statement, then there should be no problem retaining session data as long as every module has a session_start. If you are using a header statement to re-direct the flow of control, then the original session may be lost at that point. If you are doing a re-direct and want to retain the same session, then you will need to pass the session ID and re-establish that session after the re-direct.

header("Location: newpage.php?phpSESSID=".session­_id());

// Then in new page the code looks like this 
<?php 
session_id($_GET['phpSESSID']); 
session_start();
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

This post seemed at complete in a normal fashion at 7:57...

ans then it stalled again.

chrishea 182 Nearly a Posting Virtuoso

I'm continuing to add to this in the hope that it is useful to you. If you already have the info or want me to stop, just say so.

Response time was really bad at 7:40 or so this evening (and seems to be continuing that way). I didn't time it but response time was probably 1 minute +. I tried a network test to New York and it was within the normal range. Other sites are responding in a normal fashion.

chrishea 182 Nearly a Posting Virtuoso

If you have programming experience, then you know how to do some debugging. You haven't identified if anything is working and just dumped some code.

A few comments:
You didn't define "...coming up with nothing." Does that mean a blank page, an error message or something else?

On line 2, the real program presumably uses the real id, pw and database name. Presumably you aren't getting a "Failed to connect" message.

You are using a class to access the database that code isn't included here. We can't know for sure if that is working correctly or not. You need to determine if you are getting a result at line 8 and if it is then ending up at the while loop at line 12.

If you are getting to line 14, I'm not sure that it will work. You have single quotes embedded within another set of single quotes embedded within double quotes with some braces thrown in for good measure. I suggest that you keep it simple as follows just in case this is a problem:

echo "<img src=".$row['image_path']." alt=".$row['image_name']."><br>";
chrishea 182 Nearly a Posting Virtuoso

I'm not giving you a legal opinion so if you feel that you need one, then go for it. I looked into this a while back because I am using some GPL code in a number of systems that I built. These systems are not open-source and they are not sold or distributed. I use them as an online service. I did not get a legal opinion, I just did some research on the Internet. What I found was that using GPL code in a system that isn't distributed / sold is ok and does not require you to release all of the source and does not limit you from using the GPL code. Apparently, some people consider this to be a loophole in GPL. There are versions of the GPL that do address this "loophole" so you need to look at the specific license for the software that you plan to use to see if it has the additional provision for ASP (Application Service Provider) systems or not. You can use the link below to get a bit of background on that:

http://en.wikipedia.org/wiki/Affero_General_Public_License

JQuery is dual licensed under the GPL and MIT licenses. From what I can see, it uses the original GPL license and that addresses "distribution" not online use as an ASP. I strongly suggest that you read the licenses referenced by JQuery for yourself. Remember that each plugin is also licensed so you will need to look at those as well. You …

chrishea 182 Nearly a Posting Virtuoso

As a general rule, you can use open-source code under one of these licenses within a website without any issue. This applies even if you are charging to implement it or charging to use the site. The license only becomes an issue if you develop a program that you wish to sell that includes / uses code that is available under one of these licenses. Then you have to check the wording more carefully.

chrishea 182 Nearly a Posting Virtuoso

If you can find something, it's going to be really basic and probably old because I'm guessing that any that are currently being maintained probably have some javascript. Since everyone uses editors which include some javascript, why are you trying to avoid it?

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

The simplest way is to have a link to the PHP module with your javascript variable as the parm.

<a href=myphp.php?parm=[I]your_js_var[/I] ...  >
chrishea 182 Nearly a Posting Virtuoso
chrishea 182 Nearly a Posting Virtuoso

Suggest that you make the first module PHP rather than HTML then set a session variable when they enter that page. In your Login module, the first thing that you do is to check if the session variable is set or not and return to the login form if not. You might also want to make it a count rather than a simple switch. You can use a second session variable in the login module as a count as well. You could use these to determine if someone had used the initial module once then just kept banging away at login.php. Also could be used to determine the number of tries before you freeze them out for a while.

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
chrishea 182 Nearly a Posting Virtuoso

I bought an Asus laptop a year ago (and I am writing this on it). I did some research before I bought it and when I looked at the record of reliability and Customer Service for all the major brands and then I looked at bang for the buck, Asus (and this machine in particular) looked pretty good. Most machines work for at least one year so I can't say too much yet other than so far so good. I haven't had a need to go to Asus support but from what I read prior to buying it, their customer support tries to be helpful even if they didn't always get it right. This was the better option compared to others who didn't always get it right and weren't very helpful.

As with most things, some people get religious about certain brands so you may get recommendations from people based on their experience with a particular brand. An example is Toshiba which apparently makes a good product and many people are very happy with them. I considered getting one before I went for Asus. When I looked online for info on people's experience with Toshiba Customer Service, there were some horror stories about poor service from Toshiba that made me change my mind.

chrishea 182 Nearly a Posting Virtuoso

You have defined what needs to be done and you say that you have a decent knowledge of PHP. So what is the problem? Display 5 messages and then display a button (as part of a form) with the action back to the same module (or not defined since it will default). You can pass back the range that you processed so it can know where to start for the next 5. You may need to do some initialization the first time through so you will need to segment the module a bit and skip some of that initial logic in subsequent passes. Straight PHP and HTML makes it necessary to re-display the whole page each time (but with new content each time). If you wanted to avoid re-displaying the page and just display another 5 messages then you would need some Ajax.

chrishea 182 Nearly a Posting Virtuoso

Your statement of the problem isn't clear in terms of why it is a problem. If you have all of the countries in an array and you get a country as input (from a form?) then there should be no problem comparing the two and determining if it is in the list or not. You could use a while loop to go through the array and compare your country from the input to every country in the array. Your statement "...there literally seems to be no way of doing this in PHP." makes no sense unless there is something important missing from the definition of the problem.

chrishea 182 Nearly a Posting Virtuoso

It seems that your page that lists the files should be able to open the form for the transcription and pass the name of the next file.

Conceptually, your list of files could be part of a form with a radio button beside each one. You would click on the submit button to open a new window with the form. The name of the file to be used would be passed based on which radio button was checked. The transcription form page would have an <img statement to open the graphic being processed. The user would enter the info, and click enter for the transcription form. This could open a "success" page or it could just go directly back to the page that shows the list. That would receive the name of the file that was just processed as a parm so it could automatically check the next one in the list as the default. You would just cycle back and forth between the two forms as you work your way down the list. You could do fancier things with Ajax but this is the simple straightforward way to do it. Given the large number of files, you probably don't want to have to re-list them each time so read on.

If you don't really need the list except to drive the process, then you could probably eliminate displaying the list at all and just cycle from one transcription form to the next passing the current file name …

chrishea 182 Nearly a Posting Virtuoso

This one might give you what you need but only for certain countries

http://www.yelp.com/developers/getting_started

chrishea 182 Nearly a Posting Virtuoso

It's moving in the right direction however; I think that it is still too subtle. The tiny font makes it too easy to ignore. I'd also include a search box for at least Daniweb right in the instructions. It seems that a lot of people don't know how to create good search terms either. I"d be inclined to at least provide some help on how to search effectively. Helping them to create a search term with 3 - 5 search boxes, one for each term in declining order of importance might help too.

chrishea 182 Nearly a Posting Virtuoso

If I were in your position, I'd probably start with a very short piece of code that demonstrates the problem and prove that it works on a local test system. Move it to your server and try it again. If it doesn't work there, I would immediately go to your web host and get their help. Maybe they installed a new version of PHP or did something in the config that is creating a problem. Obviously, if your demo code works on your server, then you have some sort of problem that is specific to the web site.

Until it is resolved, I'd probably take the web site offline rather than take the risk.

chrishea 182 Nearly a Posting Virtuoso

I support the previous posts about trying to get people to use [code] tags. I have three more that I'd like to see:

1. When someone tries to add on to an old post (e.g. more than a year old), force them to open a new topic. If it was really slick, it could automatically add a reference link to the old post.

2. Add an FAQ section / pinned topic for (at least) the most used sections of the site. There are many questions that keep coming back over and over again (especially from newbies) and its a waste of time and space to keep answering them as one-of topics. With a well-written FAQ section, the experienced posters who are answering questions could be encouraged to provide a reference / link to the FAQ rather than start over again. My New Years resolution was to produce my own FAQ for PHP / MySQL and I now reference it in my signature (as you will see below) and I now try to use it in my response to these recurring questions. Having a standard FAQ would be a major step beyond that.

3. A lot of people don't know how to ask questions properly and they don't provide enough supporting information. They also don't check existing sources on Daniweb or the web before asking their question. I'd like to see a questionnaire that would lead people through asking their question. It wouldn't have to be long or …

chrishea 182 Nearly a Posting Virtuoso

ana10192000,
Are you replying to the post at the start of this thread that was posted in Feb 2009? If so, why?

chrishea 182 Nearly a Posting Virtuoso

Any reason for this post since you are adding to a thread that is two years old? Just trying to add to your post count and or push Drupal for your own purposes?

chrishea 182 Nearly a Posting Virtuoso

I provided what I can. Now it's up to you. Suggest that you update this thread once you decide what you're going to do (and maybe when you have something working).

chrishea 182 Nearly a Posting Virtuoso

You need to use code tags so your code is properly formatted.

For this error see [URL="http://innovationsdesign.net/wb_2.7/pages/tech-resources/php-help.php#question_18"]this. [/URL]

chrishea 182 Nearly a Posting Virtuoso

You should mark it as solved even though you found it yourself.

chrishea 182 Nearly a Posting Virtuoso

Have a look at str_ireplace and preg_replace. It's all in the manual!

chrishea 182 Nearly a Posting Virtuoso

You can find some specs for reservations systems if you do a search (one example here).

There are open-source booking systems, mostly for hotel reservations. It probably wouldn't be that difficult to modify such a system to handle buses instead.

You can also buy a system. Here is one example.

The biggest questions are:
1. The purpose of doing this.

2. Your skills and experience.

If this is a school project, that is far different from building a system that will be used for real buses and real people. If they wanted someone to manage the bus company, they'd be looking for someone with experience as an executive preferably with knowledge of the bus business. If they wanted someone to paint a mural in the main bus station, they'd want someone with a a track record of painting murals. If they need someone to build a reservation system... (you can fill in the rest).

chrishea 182 Nearly a Posting Virtuoso

gwendoloyon,
It is commendable to search for old posts that are relevant to your question but it is poor protocol to open up an old post and add on to it. Opening a new post is the preferred approach.

Given that this is a forum for computer-related technical topics, I don't know if you'll get much response for this sort of topic. Computers may have some pseudo-intelligence but on an emotional level, the current generation of hardware and software is pretty deficient. There is a lot of stuff on the internet if you do a search including this one.

chrishea 182 Nearly a Posting Virtuoso

I don't know if this is any good, but it makes more sense to use something that exists than to try to build your own custom system.
http://www.boonex.com/dolphin/

chrishea 182 Nearly a Posting Virtuoso

When you give it an address of http://localhost it will look for an index file in the root directory (usually www or htdocs). Your program could be in the root directory but more often than not it will be in a separate folder. If you put it in the root folder, you should be able to execute it by typing http://localhost/ex.php.

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
chrishea 182 Nearly a Posting Virtuoso

if this is php code, then it should be plain text and you should be able to open the file in notepad or a programmer's editor (on the PC). Are you able to do that?

chrishea 182 Nearly a Posting Virtuoso

Even though you have labelled showpopupshare as php, it is Javascript code so I would think that your onclick could go to your javascript code and never go back to PHP. Thus, it could all be one module. I think that it would look like:

onClick="javascript: showpopupshare('2');"

with showpopupshare as a javascript function in the head part of the same script.

If you need to go to PHP then the "normal way would be something like:

onClick="go('showpopupshare.php?id=2')"

but I don't think that is what you want to do in this case.

I'm not a js guy but from what I know, that is what you need to do. Maybe someone who is a js expert can confirm this.

chrishea 182 Nearly a Posting Virtuoso

I would have replaced line 273-279 with:

if (isset($_GET['redirect'])) {
     $wk = "?redirect=" . $_GET['redirect'];
}
else {
     $wk = ""
}
?>
 
<h1>Sign In to your account </h1>
 
<form action="login.php<php echo $wk; ?>" method="post"
id="frmcontact">

I am sure that there are those who will say that this isn't as efficient as your version and doesn't take full advantage of what PHP can do but I value my time more than machine cycles so I'd rather keep it simple and obvious. To each his own however; it's partly a matter of style and partly what you're used to and what makes you happy.

chrishea 182 Nearly a Posting Virtuoso

I didn't do anything that you couldn't have done which is to go through methodically, organize the indents and check that all of the curly braces are matched (Netbeans should help you to do that part). I had to add three more closing curly braces after line 272 to get them to match up. There was another problem with the form at line 277 but it's gone away and I don't know what I did that fixed it. My version of your code now shows no errors.

Maybe you are used to this style of coding but if you are having trouble debugging it yourself then maybe you are making it more complex than it needs to be. PHP let's you do things like you have done with the form action at line 277 (as an example) but personally, I'd make it simpler and not try to embed logic like this in order to derive a variable. It's up to you but personally, I'd rather keep it simple and straightforward because it will probably save time when there is a need to debug it. Just my opinion.

http://innovationsdesign.net/wb_2.7/pages/tech-resources/php-help.php#question_17

phplover commented: Solved my problem. Some nice advice :) +1
chrishea 182 Nearly a Posting Virtuoso

See MySQL_Insert_ID

chrishea 182 Nearly a Posting Virtuoso

Even though it is a related question, you should have probably started a new thread since you are asking a new specific question.

If you have a local program that will convert ppt to SWF and you can provide it with parameters from the PHP program, then you can probably do it. Is there some particular reason / advantage to running it from PHP rather than just doing it manually?

chrishea 182 Nearly a Posting Virtuoso

You could use something like this:

<a href="delete.php" onclick="return confirm('Are you sure you want to delete?')">Delete</a>
chrishea 182 Nearly a Posting Virtuoso

Are you saying that you want to abandon the results of the Selects that were done on the first pass and now start over with another database (in the same format as the first) and keep executing your while loops using data from the second database? That would be a pretty unusual approach. If that isn't what you mean, then you need to explain what you're aiming to do with the second database.

chrishea 182 Nearly a Posting Virtuoso

If you have an application in PHP / HTML / CSS / Javascript, you can test most things in a local test environment. You need to have a "LAMP" environment installed on your local machine. For more info: http://innovationsdesign.net/wb_2.7/pages/tech-resources/php-help.php

One of the things that you are limited on testing locally is the sending of emails. The library that I use has the option of dumping the output that it would have sent so I can still verify it that way. You can set up your local machine to act as a mail server but that isn't usually necessary. Other than that, you can do almost anything in your local machine.

chrishea 182 Nearly a Posting Virtuoso

You have a pretty vague requirement where you want to use a dynamic feature but the full context for it and the purpose of it is unclear and maybe not defined. If you don't already have an outline of your application defined, I suggest that you start there. The user-interface features are just a means to an end. If you already have some knowledge of PHP and if you have a need for a server application (and a database), then PHP would be a good choice. It won't give you the dynamic user interface so for that you would need to use something like JQuery. You could use Java (and a variety of other languages) as well so it depends on what you want to do and what skills and knowledge you already have.

Your mission is to define what you want to do in more detail, assess your own skills and knowledge, make a choice of the development language / environment that you want to use (that can provide you with the functionality that you need) and then find or put together some code for an initial version. No one else can do this for you (unless you want to hire someone!). The most you can hope for are some examples doing similar things to what you want to do or some components (like JQuery plugins) that provide some of the functionality. Once you decide on a language / environment then you can start looking for them. The …

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

Nothing is obviously wrong that I can see. Suggest that might want to add a log for messages deleted, added etc. Until you have it sorted out you may want to remove the expunge and do some testing to see if you can see what is happening. If you have a mail reader open for the same mail file, you should see the (delete) boxes ticked once you've done the delete with no expunge. That will show you what it was going to delete. The code is driven by $_REQUEST so maybe it's doing what it's being asked to do but the "request" is for the wrong record number.

chrishea 182 Nearly a Posting Virtuoso

I don't understand why this is a problem. After line 6 you need something like the following:

mysql_connect ("localhost","id","pw");    
     mysql_select_db ("my_db");  
     $result = mysql_query ("update users set login='$date_time' where user_id=".$_SESSION['MEMBER_NO'].")";

This assumes that you have a user table called "users". You need to decide how you want to handle the status. if you record login and logoff date and time then you could assume that they are online if the logoff date & time is older than the login date & time. You could also set a specific status flag but it could be redundant. This also requires you to force a logoff if a user hasn't be active for a certain period of time. Otherwise, many users could appear to be logged in on a permanent basis.

chrishea 182 Nearly a Posting Virtuoso

As per the PHP documentation (you do have a copy don't you!):

Return Values
For SELECT, SHOW, DESCRIBE, EXPLAIN and other statements returning resultset, mysql_query() returns a resource on success, or FALSE on error.

You need to use this resource id in a mysql_fetch_array or mysql_fetch_assoc to return an array of rows and fields (in your case just one row and one field). You can also use mysql_result to return just one field from a specified row in the result.

chrishea 182 Nearly a Posting Virtuoso

It sounds as if you want the best of your existing site and the best of what a standard CMS can provide but it might be a lot of work to get that. One of the benefits of a CMS is that someone else is supporting and developing it and you get the benefit of fixes, new releases, new templates and new applications. If you heavily customize it, then you have to look at any problems as being potentially the result of your customization. You may not be able to easily implement new releases because your customization may have to be adapted and everything re-tested every time. If I was in your shoes, I would:

1. Make an assessment of the functions that are in the existing site versus what Joomla or some other CMS can provide you using the native functions. Where possible, I think that you would want to convert to the native functions if you can. Existing data would be a problem so you would have to consider the effort needed to convert it or even re-enter it. There are automation tools that could potentially help if there is a lot of data.

2. For existing function where #1 doesn't work, see if you can leave the site / application running as it is and use the "wrapper" approach that I explained in the previous post.

3. For anything that's left, consider doing something custom but try to avoid this if you can. You …