chrishea 182 Nearly a Posting Virtuoso

If you have a date and a time such as 2010-08-24 18:00 you can first convert this to a (unix) time stamp with the strtotime command. You can then use that time stamp in the date command to convert it to whatever display format you need:

$timestamp      = strtotime("2010-08-24 18:00");
   $date_and_time  = date("Y-m-d g:i A",$timestamp);
   $just_time      = date("g:i A",$timesatmp);
chrishea 182 Nearly a Posting Virtuoso

There is no mystery to this. The info is available in the MySQL manual and partially in the PHP manual.

To get the number of rows use the php mysql_num_rows command.
For the info on the date and time of last update do a mysq_query with the "show table status" command

chrishea 182 Nearly a Posting Virtuoso

I found an example that used different headers than yours. You may want to give these a try:

header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="example.zip"'); 
header('Content-Transfer-Encoding: binary');
chrishea 182 Nearly a Posting Virtuoso

Word has various format handlers, some of which are optional. According to this list from Microsoft (for Word 2003), the HTML converter is standard. It's possible that it was optional in other versions.

Even if you specify the format to be RTF, if Word is your default program for handling RTF files you may hit the same problem. If your wish is to be able to work with any version of any word processor whether or not they have the (optional) format handlers installed, then you need to produce native RTF format and the path that we have been going down in this post (generating html and letting Word do the conversion) won't work). Personally, I'd rather let Word do the work for me but if your intent is to provide the code to a wide audience, then you're right that there could be some accessibility issues so, at a minimum, you might need to define some minimum requirements.

chrishea 182 Nearly a Posting Virtuoso

The division by zero error is only a warning so it doesn't stop execution. You can prevent the warning from printing (if necessary) using error_reporting (E_ERROR);

It looks as if the division by zero returns false rather than a numeric value. Thus, your code could be changed as follows:

$result = $row['PTS0910']/$row['GP0910'];
if ($result == false) {
   $result = 0.00;
}

echo  number_format($result,2);
chrishea 182 Nearly a Posting Virtuoso

In my case it just opens in Word like a normal Word document. It defaults to saving it as a web page but you can select from the list and save it as a normal Word document. The version of Word and the Browser you are using might have some impact. I'm using Word 2000.

chrishea 182 Nearly a Posting Virtuoso

I have had no problem with formatting. Word correctly picks up the html formatting and uses it. One thing that I did different from you was the header statement on line 5. I used the following:

header("Content-type: application/msword");

Give it a try see if it makes any difference.

chrishea 182 Nearly a Posting Virtuoso

Read about the PHP explode command. In order to use it for what you want, your file will need to have a unique delimeter between the fields that you wish to break into separate array elements.

What you are trying to do is what a Content Management System (CMS) does (but in a less effective way). A CMS normally uses an editor like FCKeditor to allow the user to edit the page contents. The content is then stored in a database (usually MySQL). I suggest that you consider using a CMS rather than trying to create your own version.

chrishea 182 Nearly a Posting Virtuoso

If you are you just sending SMS, then you don't need a gateway. SMS messages can be sent as an email if you know who the cell phone provider is for the person that you are sending to. There are lots of previous posts on this topic on Daniweb so you can get some additional info by doing a search.

chrishea 182 Nearly a Posting Virtuoso

See my response to the post below. I think that it can deal with your need.

http://www.daniweb.com/forums/thread301615.html

chrishea 182 Nearly a Posting Virtuoso

To get from SMS to your server you will need to use an SMS gateway service (and you will need to pay for it). That will allow you to go in both directions.
One example: ClickaTell

At no cost, you can go from the server to SMS if you have the phone number and know the cell phone provider (and the SMS email address format for that specific provider).

chrishea 182 Nearly a Posting Virtuoso

Add a name and a value to your <input type=submit> in the first part (e.g. name=submit value=submit> . The second part then needs to be surrounded by an if and a closing bracket. The If needs to check $_POST.You only want to execute the second part if $_POST has a value of 'submit'.

In the current version, you execute the second part every time the module is executed (even the very first time) so that will give you a blank record in the database even if you don't refresh the page.

chrishea 182 Nearly a Posting Virtuoso

I think that it is just as important to know where and how to find the information you need when you need it. As I learn things I keep notes and then when I want to do something that I haven't done for a while, I go back to the notes and look it up. If it's something that I haven't done before, then I'll go and find it on the web and probably add it to the notes. Avoiding the re-learning has saved me quite a bit of time.

One of the ways to learn is to look at other people's code (mostly good examples) and then try making changes to it. We are lucky with PHP that there is huge amount of open-source code out there along with lots of tutorials and help forums. You can see more advanced techniques like functions, classes, mvc structures and oop. You can start with more basic stuff but all levels of examples are easily available. It's a lot more fun to work on things that interest you so you should just pick a topic and jump in.

chrishea 182 Nearly a Posting Virtuoso

With respect to CMS systems, this site will give you an idea of how many CMS's are available out there.
http://www.cmsmatrix.org/

The most popular ones are Joomla, Drupla, Mambo and Wordpress (that has morphed from a blog system into a quasi-CMS). I have used a system called Website Baker for years because I find it easier to setup, maintain and modify than some of the better known ones (but you will find people who will make the same case for each of the options out there). They are all based on PHP and MySQL and they are all open source / free.

Most of the CMS's have the ability to include a forum as an add-on. If you want to go for a stand-alone version see the link below for a list: Many / most of these are also open source PHP-MySQL.
Forum List

If you go with a package, then the most PHP you will probably need is to modify the config module with the parms for the database and few other things. This will give you a lot of bang for the buck right out of the box. The setup of the pages is generally done through an editor (somewhat like a Word interface for text and graphics pages) so you don't need to be writing code.

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

Have a look at this as an example:
http://www.siteground.com/tutorials/php-mysql/display_table_data.htm

There are lots of other tutorials out there if you do a search.

chrishea 182 Nearly a Posting Virtuoso

A few comments:

1. It would be helpful if you could clearly identify what you need this site to do. If it is an information site with forums and so forth, then you should be looking at implementing a Content Management System (CMS) and/or a pre-packaged forum system. There are lots of these available as open source systems. They require some technical knowledge in order to implement them but it a whole lot faster and easier than trying to build something yourself. If you are aiming for something very flashy or if you are thinking of actually coding some sort of online game yourself, then you will need a level of expertise that you don't seem to have at this point (and takes quite some time to develop even if you have adequate natural talent). Your needs might go beyond what PHP can do on its own (as a server-based system). In that case you might need to look at javascript / Ajax, possibly in combination with PHP.

2. I don't understand your references to VB. The two most common script languages for online development are PHP and ASP. Maybe I haven't been paying attention but my experience with VB was as a PC desktop application development system.

3. PHP isn't too difficult to use but you do need an understanding of programming basics, the language syntax and the environment that it runs in. I had many years of programming in other languages when I first got …

chrishea 182 Nearly a Posting Virtuoso

Echo $sql2 after line 7 and see if contains what you expected. If it is correct, it will work.

chrishea 182 Nearly a Posting Virtuoso

The option to be selected needs the word 'selected' after the value=xxx. In order to make this dynamic, you need a variable as part of each option as follows:

<select name="attend">
  <option value="No"<?PHP echo $selected_no; ?> >No</option>
  <option value="Yes" <?PHP echo $selected_yes; ?> >Yes</option>
</select>

Before you get to this point, you will decide if it is to be yes or no and set one variable to empty and the other one to 'selected'.

chrishea 182 Nearly a Posting Virtuoso

Please be more specific. Are you trying to upload programs and images to the server (i.e. FTP) or are you trying to write a PHP program to do uploads?

chrishea 182 Nearly a Posting Virtuoso

If you want to expand the page to include the ticket details within the context of all of the other tickets (still as one or two lines) then you may want to look at using jquery and an accordion plug-in. There are multiple versions. I have provided a link to one of them below:
http://plugins.jquery.com/project/accordion

This page provides an accordion example:
http://jqueryui.com/demos/accordion/

Note: jquery makes using javascript much easier. You can embed this in your php program just as you would do with html. You'll have to assess your comfort / expertise level and decide if you want to go down that path. The simpler way is to just link to a new page where you show all of the details associated with a particular ticket.

chrishea 182 Nearly a Posting Virtuoso

You can lots of info and examples through a google search:

http://www.tizag.com/phpT/examples/formex.php

chrishea 182 Nearly a Posting Virtuoso

If it was as simple as 1. everything worked fine. 2. Turn it of normally, disconnect the wires and move it 3. reconnect the wires and boot it up: then it is more likely a hardware problem than software. I'd certainly start by checking that the video card (and any other cards) are all still seated corrected and that all of the physical connections are correct and tight. If nothing changes, then you could try booting from your install disk just to see what happens on the screen. It would be surprising if it displayed everything fine in that case but if it did, you would have to reconsider what might be wrong. In that case, you could try running the repair option to see what that finds.

chrishea 182 Nearly a Posting Virtuoso

The question that you are asking is for a pretty basic html capability. I suggest that you spend some time on the W3schools site or on some other html tutorial and use W3schools as an ongoing reference. If you are going to be doing more work in html / php then you'll have a lot more questions and it doesn't make sense to be posting them one at a time as you try to do something new. Once you've done the tutorials and done some research on a specific question, then come back if you can't find an answer.

For this particular question, have a look at the link below:
http://www.w3schools.com/TAGS/tag_hn.asp

chrishea 182 Nearly a Posting Virtuoso

Daniweb has lots of solved problems and good advice from past posts. All you need to do is use the search box. If that doesn't work, then Goggle is the next step.

I tried a search on Daniweb and the post below has some useful info:

http://www.daniweb.com/forums/thread254622.html

chrishea 182 Nearly a Posting Virtuoso

This is a shot in the dark but maybe your while statement should be:
while($dev_count>=1)

As it is, it appears that it would try to do the array_push even if the count was zero and that might be a problem.

chrishea 182 Nearly a Posting Virtuoso

You can try re-booting from the (Vista / Win 7) install disk and try recovery / repair from the menu.

chrishea 182 Nearly a Posting Virtuoso

Google search still works well!

Read this and see if it helps:
http://forums.techarena.in/customize-desktop/1129820.htm

chrishea 182 Nearly a Posting Virtuoso

Let me suggest that you're more likely to get an answer if this question is posted in the VB forum (under software development).

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

Your session_start on line 2 and the header on line 13 are probably conflicting as they both cause output to the browser (session_start creates a cookie). You may get some resolution by putting the session_start on the first line with the <?PHP (that's what I've read but I don't know the reason). If that doesn't help using ob_start and ob_end_clean before and after the session_start may let you work around it.

chrishea 182 Nearly a Posting Virtuoso

Google works pretty well still!.
PHP Class to do this

The first one seems to have the type of features that you want. Haven't used any of them so you'll need to read the documentation and try them out.

chrishea 182 Nearly a Posting Virtuoso

I think you need to make the first module a PHP module as well. After line 10 add:

<?PHP echo "<input type=hidden name=key value=".$_GET['key'].">"; ?>

In the second module you would then access it on line 3 as $_POST

chrishea 182 Nearly a Posting Virtuoso

Since you didn't provide any code I am guessing a bit as to how you structured it. If you have a page that then has a form to go to another page and if you need to retain variables that were available on the first page: then you need to make them hidden variables in the form (or session variables) to make them available on the second page.

chrishea 182 Nearly a Posting Virtuoso

Try plugging an external screen into the laptop and see if you can get something that way. Toshiba has some history of screen failures. If you can demonstrate that it is hardware-related then you should contact Toshiba and see what they are prepared to do for you (maybe not much from what I've read). You can also try booting into safe mode and see if you get anything on the screen that way. If that works, then you probably have a setup / driver problem.

chrishea 182 Nearly a Posting Virtuoso

Use the eject button on the tray (kind of a version of "Patient: Doctor it hurts when I do this. Doctor: Stop doing that").

Seriously though, if this is a special feature on the Dell keyboard, then there is probably some code that supports it and that code may not be compatible with Win 7. I suggest that you find a Dell forum and ask the question there and also contact Dell support.

chrishea 182 Nearly a Posting Virtuoso

I don't see anything obvious from your code. If I was going to debug this, I would be looking for answers to the following questions:

1. Which insert is failing? We have to presume that it isn't the first one since the order id in the first table should be an auto-increment field.

2. If there was a duplicate order id already on file (in one of the other two tables), where did it come from?

If the answer to the second question isn't obvious, then you may need some debug code at appropriate points in your code to get more info. This module is pretty straightforward and it probably isn't the source of your problem (on its own).

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

The way in which you have done this, you re-display your form every time. I suspect that is why you want to clear the results on a refresh. The POST'ed values don't get deleted on a refresh so you will keep displaying them until you select a different manufacturer.

A better way to do it would be to display one or the other. Check if there is a value in $_POST["Manufacturer"] before you display the form. Only display the form if it is empty. Only display the results if it has a value. At the end of displaying the results, define a form that includes manufacturer as a hidden value with a value of empty (value = "";). The button will say something like "Display Another". This way you can toggle back and forth between displaying the form or displaying results.

To display the results side-by-side, I would personally use a table as it is the most straightforward approach. There are those who advocate other approaches through CSS and if you have the CSS knowledge to do it you can try that approach. In either case, your while loop (which seems to be missing its closing bracket) will need a variable that tells you which is next, the left side or right side. Every time you display one, you reset it to the other value. Doing it as a table, in the first case the output will have <tr><td>... and in the second it will have <td>...

chrishea 182 Nearly a Posting Virtuoso

If you are running on Linux, it doesn't treat upper and lower case as the same thing. Either your upload routine has to force everything to lower case (or upper if you prefer) or the display routine has to look for both variations. I didn't go through your code but that is the most likely reason.

chrishea 182 Nearly a Posting Virtuoso

Here is a discussion on this topic with some suggestions:

http://forum.kohanaframework.org/comments.php?DiscussionID=2782

chrishea 182 Nearly a Posting Virtuoso

FYI. Here is another option. I built this quite a while back to sort a two-dimensional array on up to 6 keys (using the array_multisort command). This is a bit more than you need in this case but anyone who needs to sort records by one or more keys may find it useful.

You would need to load you data into an array so that records would look like:

$test['0']['name'] = "Example name 1";
	$test['0']['date'] = "3rd July 2010;21:08";
	$test['0']['comment'] = "Example of a comment 1";

________________________________________________________________________
Module: array_rows_to_columns.php
This sets up the data so array_multisort will work.

<?PHP
Function array_rows_to_columns (&$array_name, $field1="", $field2="", $field3="", $field4="", $field5="", $field6="") {

	// this changes the rows to columns (ie as separate arrays) so that multisort can sort them
	// This can be used when you have a multi-dimentsion array of the form:
	//	$test_array[key][field1], $test_array[key][field2] etc
	
	// when you want to be able to do a multisort on field1, field2 and so forth.
        // This can handle up to 6 fields that are to become new arrays and sort fields.
     
        // When these are sorted, the association between the fields is retained even though they are
       // in separate arrays.
     /*
     	Example use:
		array_rows_to_columns ($test,"last_name","first_name","address","phone");
 		$result = array_multisort($sort_field1,$sort_field2,$sort_field3,$sort_field4,$test);
 		
 		where: 	$test is the original array
				last_name, first_name etc are field names to sort by
				
		It sorts the original array so you can access the results there.

		You must use "foreach .. " to extract the data - see the examples 
	*/ …
chrishea 182 Nearly a Posting Virtuoso

There are commands such as parse_url that may help but maybe the solution in this case is to do your addressing differently. If your programs define a session variable that has the base address of the root folder of your application, then you can do all of your includes relative to the root folder and it will be the same include string in every program regardless of where they are nested in your directory structure.

Instead of include "../a.php";
You would use include $base_address."/x/y/a.php";

As a tip, you can also keep a directory of utility routines that can be included in any program on your site in the root of the site. You can get the address of it in any program as follows:

$path_global = $_SERVER."/your common directory name";

You can then get any of these common modules by addressing them as follows:

include $path_global."/b.php";

chrishea 182 Nearly a Posting Virtuoso

For basic questions like this go to W3Schools and search there for the info.
http://www.w3schools.com/css/css_background.asp

chrishea 182 Nearly a Posting Virtuoso

For a start, the $assigning_night_row variable used on line 155 isn't being set anywhere in the code that you provided.

chrishea 182 Nearly a Posting Virtuoso

If everyone is required to sign-in, then you can update the "online" indicator when they sign in. When they sign out or after they have been inactive for a certain amount of time, you can reset it to "offline". If you can also have active users who aren't signed in (just browsing), then you can also get the total count of active sessions - see the link below:

http://www.olate.co.uk/articles/131

chrishea 182 Nearly a Posting Virtuoso

I don't believe that there is a facility that you can just download and use that can do auto form filling and screen-scraping to return the results to you.

The more straightforward way to do this would be to copy the list of schools from their website into a spreadsheet then upload it into a database table. The list has a zip code and there are facilities such as the one from Googlethat can give you the geolocation based on postal code. You can create your own entry form and you could ask for their postal code and then do a geolocation for their address. You can then match up the two based on proximity. If the assignment to a school is in any way arbitrary or based on geography rather than distance as the crow flies, then your results wouldn't be consistently accurate. You'd then need to put additional info the table. This might seem like a lot of work but I'm not sure that there is a shortcut.

I tried an experiment by copying their page, making a few changes for absolute url's instead of relative and submitting the form. It worked and displayed the required info. If you really want to go down that path, there are ways to auto-submit a form using javascript and there are facilities that you can use to screen-scrape a web page (e.g.class-http by Troy Wolfe and various others). This will require some research and experimenting on your …

chrishea 182 Nearly a Posting Virtuoso

I'm pretty sure that the person on the target machine can still do stuff while the person on the other machine observes. The observer can then jump in and take on control. If they both try to do it at once, I'm not sure if one gets priority or if it just creates a bit of chaos. In any case, as you try it out you'll find out what's possible and what isn't.

chrishea 182 Nearly a Posting Virtuoso

As far as the headers are concerned, I already have a program of my own that does downloads so I compared what I had with what you had and started experimenting. You had more header statements than I did so I tried it with and without some of the others to see if they had any impact. Once I had your returnMimeType routine working, I found that it would display the file but didn't give a chance to save it. By replacing your Pragma: Public with Pragma: no-cache it gave me the option to save it. I used no-cache in my own program. I didn't have a Content-Length: in my program so when I found that I couldn't open the downloaded file, I started trimming back your headers to see if that was the cause. After I removed Content-Length, the program worked. When I looked at that statement again it seemed likely that $file_path would not actually contain the file length.

So in conclusion:
1. Use your own work and others as a guide because most of us can't remember everything or do the full research on how every PHP command works. Do keep a copy of the PHP documentation handy and use it when your aren't sure of the command format, input or output.

2. Take advantage of the fact that there are many thousands of examples of php code on the internet. It's often easier to figure out how a piece of code that is …

chrishea 182 Nearly a Posting Virtuoso

Some of what you want could be done with shared files with the only copy of such files residing on just one of the machines. You won't be able to see the changes made on the other machine until they are saved so you won't be able to do real-time collaboration using a standard desktop utility like Excel.

If you want to work collaboratively sharing files and info as you go, then you need to look at Zoho or some of the Google facilities. In those cases, you will be using their online utilities and data, not the desktop utilities and data. At the end of the processing or every day, you could download the data to your local machines if you have the need.

Another version that wouldn't normally be used for machines that are side-by-side (but could be) is a remote control program where one machine can take over control of the other. I have used Team Viewer for this sort of thing and it is free. If you want the capability for either machine to take over or update files in real time on the other machine, I don't know if such a thing exists or if it is really necessary or desirable. That would probably lead to data control and conflict issues that are dealt with already by the online collaboration approach.