chrishea 182 Nearly a Posting Virtuoso

Here is a link to someone else who had the same error. In that case the "To" parameter didn't have a value and yours could be the same.

chrishea 182 Nearly a Posting Virtuoso

This is a forum that provides support for PHP programming. Even though PHPFox has PHP in its name, what you are looking for is support and add-ons for the PHPFox CMS. You are more likely to find that in the PHPFox Forum.

chrishea 182 Nearly a Posting Virtuoso

If your need is pretty simple, then you may get what you want the way that you are doing it.

Even for simple needs but certainly when you need to start accessing multiple pages, navigating from one to the next and, in some cases, having to log in first, then there are better tools.

Curl can be used for some of this. I have used a class that helps to handle more complicated situations. Overall, I found that the most effective tool, especially for complicated situations is a Windows programming tool called Autoit. It has an Internet Explorer function that lets it automate navigation and extract fields. It is pretty easy to use and it can do just about anything that a human can do. It has the advantage over PHP tools that it works through the browser so when you are accessing secure (https) pages or pages created in ASP it has no problem. I could not get any of the PHP tools to process ASP pages.

chrishea 182 Nearly a Posting Virtuoso

Now that I see the output, it's obvious. I didn't look at the whole thing carefully enough the first time. The While loop writes out the PDF output for a new store ID before it skips to a new page. The order needs to be changed as follows:

$first_store = "yes";
 
While($x=mysql_fetch_array($queryP)){ 

   if ($first_store == "yes") {
      $StoreId = $x['StoreId'];
      $first_store = "no";
   }   
 
   elseif($x['StoreId'] != $StoreId OR $p == 10){
      $pdf->ezNewPage();
      $p = 750;
      $StoreId = $x['StoreId'];
   }
 
   $pdf->addText(50,$p,7,"{$x['PolicyNumber']}");
   $pdf->addText(80,$p,7,"{$x['StoreId']}");
   $pdf->addText(120,$p,7,"{$x['NickName']}");
   $pdf->addText(220,$p,7,"{$x['ClientsName']}");
   $pdf->addText(330,$p,7,"{$x['DateReceived']}");
   $pdf->addText(410,$p,7,"{$x['Comments']}");
   $p = $p - 10;
 

}

I think that should work properly. Now it checks for a new store and skips to a new page before it creates any output for the new store.

chrishea 182 Nearly a Posting Virtuoso

That won't do it!

1. If you are already at the end of a page, you will skip to a new page (line 12-15) THEN you check for a change in Store ID and potentially skip to a new page again.

2. On lines 18 - 20, you are checking for a change in Store ID and if it is different you are decrementing $p. At that point, you should be going to a new page. Alternately, you could make $p = 20 and let the page skip happen on the next cycle but that makes it more complicated that it needs to be.

What you need is something like:

$first_store = "yes";

While($x=mysql_fetch_array($queryP)){ 
 
   $pdf->addText(50,$p,7,"{$x['PolicyNumber']}");
   $pdf->addText(80,$p,7,"{$x['StoreId']}");
   $pdf->addText(120,$p,7,"{$x['NickName']}");
   $pdf->addText(220,$p,7,"{$x['ClientsName']}");
   $pdf->addText(330,$p,7,"{$x['DateReceived']}");
   $pdf->addText(410,$p,7,"{$x['Comments']}");
   $p = $p - 10;
 
   if ($first_store == "yes") {
      $StoreId = $x['StoreId'];
      $first_store = "no";
   }   

   elseif($x['StoreId'] != $StoreId OR $p == 10){
      $pdf->ezNewPage();
      $p = 750;
      $StoreId = $x['StoreId'];
   }
}
chrishea 182 Nearly a Posting Virtuoso

CMS's have their own database tables and application databases in specific formats that the system and the applications expect. A database needs the code that understands the database format. If you have both the database and the code that uses it, then your problem is then to integrate both of them with a CMS (presumably because the CMS provides you with other functions that you need).

The three most logical approaches are:
1.Customize the "registration" / login function in Joomla or some other CMS. If your need is strictly limited to having a custom, more flexible user registration and login function but after they login you want to use (mostly?) standard CMS functions, then this probably makes the most sense. This is certainly a lot less work than creating your own CMS. It will require knowledge of the CMS internals. You may be able to get some help through the Forum for Joomla (or whatever CMS you choose).

2.In Joomla (and some other CMS's) there is a "wrapper" function that allows you to run a separate application but have it embedded within a Joomla page. The application and the database can be totally separate but they appear to be part of the CMS. There is no real integration, it just gives that appearance to the user. If you have a separate application then this is probably the easiest approach. If you are doing logins through this facility, that's ok as long as this only allows access to …

chrishea 182 Nearly a Posting Virtuoso

The simple solution would be to use one of the many existing open-source shopping carts! If you have the skills and experience to write your own and there is a good reason for doing it, then go for it. If that was the case, then I don't think that you would have had to add this post.

You have PHP code wrapped in a Javascript function and that doesn't make sense to me. The PHP needs to be resolved on the server before it is sent to the Browser. If you have variables that you are determining on the server, then you can insert those php variables into the Javascript code and they will be resolved and sent to the Browser as part of the Javascript. You can't interactively call PHP from Javascript unless you are using Ajax but that is whole different thing. You have onlick="cart()... and this will happen in the Browser but what will the cart function contain at that point? What will the server have generated and sent to the Browser (in html and Javascript)? Probably nothing! If you can make this code work, then more power to you but I don't think that is going to happen.

In straight PHP, you need to click on a form (Submit) button to send form data to the processing module (which can be the same module but you need code to determine what phase of processing it is in). That module will handle the MySQL updating. …

chrishea 182 Nearly a Posting Virtuoso

I don't see a problem with the logic. It may be a data problem. If you only have one field in each record or if your fields contain 'return' / line skip characters than that might give you the result your are getting.

chrishea 182 Nearly a Posting Virtuoso

You need to save the store id (near the end of your While loop) then and compare each new one to the previous one at the start of the loop. When you get a new one, then use the ezNewPage()command to start a new page (and reset your line counter).

chrishea 182 Nearly a Posting Virtuoso

It may be simpler to run them serially rather than mash them together. Use a header command at the end of execution of the first one (after line 47) to redirect to the second one.

chrishea 182 Nearly a Posting Virtuoso

It looks like you have a problem in your add-to-any plugin. If you haven't made any custom changes, then the simplest approach would be to drop that plugin and try again. This error means that add-to-any/services.php on line 2 issued some sort of output before the (standard?) WordPress classes.php module was able to issue a header command at line 1601.

In order to fix this so add-to-any works, you can start by contacting the people behind add-to-any or go onto a WordPress forum and see if someone can help you. This is most likely some kind of setup / configuration problem.

chrishea 182 Nearly a Posting Virtuoso

Wouldn't it make sense to look at the existing sites providing streaming TV to get a list of the stations that they provide. This won't necessarily get a you a list of the actual stream addresses, you might have to go back to the sites for the stations or even contact them to get them. You might get lucky and find a list but you may have to do it the hard way.

http://www.conduit.com/Resource-Center/Toolbar-Components/Sticky-Components/Add-TV-to-Your-Toolbar.aspx

http://www.tvtubex.com/

http://www.ovguide.com/browse_sites?c=live+tv&ci=87

http://www.viewmy.tv/

chrishea 182 Nearly a Posting Virtuoso

Unless there is some specific (good) reason for segmenting it this way, the action could be a single module or a very simple module that does an Include for A and B. If that isn't a good solution for some reason, then you could daisy-chain them by doing a header command in A to re-direct to B once A has done what it needs to do.

chrishea 182 Nearly a Posting Virtuoso

This is all in the PHP manual. If you don't have a copy, you need to get one:

If you just wanted the time in 24 hour format, it could be as simple as:

$time1 = date("Hi");

If you need to use strftime for local time, then it would be:

$time1 = strftime("%H%M");
chrishea 182 Nearly a Posting Virtuoso

This one looks pretty capable and it has an Ajax / javascript interface.It can be used for free from one (developer) domain. Probably not as slick as Gliffy.

http://www.yworks.com/en/products_yfilesajax_about.html

chrishea 182 Nearly a Posting Virtuoso

This might help. It is a class that you can use to send emails, including attachments. The calls to the lib are quite simple (see the module for the details. User interface is up to you.

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

chrishea 182 Nearly a Posting Virtuoso

After answering a lot of questions on this Forum, I found that many common questions keep coming back because newbies don't search prior to posting and we don't have a standard reference to send them to. My New Year's resolution was to create a FAQ to provide the best possible answers for some of the more common queries. I created an initial version and I now have a link to it in my signature. I intend to refer people to it when some of these questions come up. This is just the initial list and I know there will be other topics to be added. I'd be quite happy to see a standard Daniweb FAQ that would supercede this but for now I've done my own.

I welcome constructive feedback for any improvements or additional questions that deserve to be in the list. I guess that eventually there could be a couple of additional levels of FAQ for experienced PHP people and the advanced group but for now, this hits the people with the greatest need.

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

chrishea 182 Nearly a Posting Virtuoso

If the php module is copied to the correct place on the server (same place as the HTML) AND if the PHP is error free (and properly named and formatted) AND if the server supports PHP, then it should work. If you check out all of these points and and they are ok and a simple "Hello World" module won't work then you should start with your web host support and make sure that you are doing everything that the server requires.

Two things to verify are
* That you aren't using short open tags (<?) instead of the full PHP tag (<?PHP). Some servers won't take the short tags.

* That your PHP module has a .php suffix (not .htm or .html). If you don't do this, it won't recognize it to be a PHP module and your PHP code won't be processed by the Interpreter.

chrishea 182 Nearly a Posting Virtuoso

Ajax may be far more complex than what you need but just in case, this is one example of using Ajax. I'm sure that you can find many others.

http://www.webreference.com/programming/javascript/kh/

chrishea 182 Nearly a Posting Virtuoso

Yes, you could use some php to read a database and plug values into the html but as per Ardav's note, it has to be done on the server side. You can't have Javascript talking directly to the database. If all you want is database data plugged in, then no problem, PHP can do that. If you want the Javascript to process that data before it is displayed, then you would probably need to have your PHP code plug it into Javascript variables in the code that JS could then access when it gets control. If you wanted something more dynamic, then you could probably do something with PHP and the database on one side and the Ajax / Javascript running in the browser sending it requests.

chrishea 182 Nearly a Posting Virtuoso

In the future, you should enclose your code in code tags. It makes it more usable?

I don't know if it is causing your problem or not but was there a reason for commenting out:

include ('jpgraph/src/jpgraph.php');

In the examples that I looked at, it was always included along with an include for the specific graph type that is to be displayed (in this case jpgraph_line.php). I'd try removing the // and see if that helps.

chrishea 182 Nearly a Posting Virtuoso

You need to provide a much clearer definition of the requirement. It isn't clear what "an event" is or what user levels have to do with it. It may not be realistic to think that you will find the exact code you need. If this is your business or school project, then we would expect you to create some code and if you run into problems, then you can ask some specific questions.

chrishea 182 Nearly a Posting Virtuoso

It seems that you want a browser-based version of Visio.

This one looks pretty professional but you would need to get some more info from them on price, database etc. http://www.gliffy.com/

This is an open source option but it probably will require a lot more work than the previous one. http://code.google.com/p/raphaelgwt/

Avasulthiris commented: thanks! +2
chrishea 182 Nearly a Posting Virtuoso

You don't need to be constantly looking at the DB and updating the status of the users. You wait until he tries to login again. If the suspended period is over, then you change the DB and take out the date & time when the suspension ends (indicating no suspension). If the suspension isn't over yet, you just refuse his login with an appropriate message.

chrishea 182 Nearly a Posting Virtuoso

That's true of some but not all laptops. My old HP 17" laptop had two drive bays and it was just a matter of undoing the screws, attaching the HDD HP adaptor and sliding it in. I don't think too many have that option or make it that easy.

chrishea 182 Nearly a Posting Virtuoso

I looked at RainTPL and pretty quickly I got it. I played with it and tried a few things and they worked. It will take some more time to get any good with it but it doesn't seem difficult or intimidating. I have one application where I think it might be beneficial but I'm not sure if the retrofit effort would be worth it.

Previously, I tried to understand Smarty and I never got there. With more time I probably would but I didn't have a compelling need so I didn't pursue it. Just had a quick look at XSL/XSLT and it seems a bit like the Smarty situation. With some time I can probably figure it out but I'm not really sure that it's worth it (and still no compelling reason).

Thus, for potential occasional use, I think that RainTPL is the winner based strictly on simplicity. If I was to use a template system for every new project then there might be more capabilities in XSL or Smarty that would make one of them a better choice. I understand that there is some theoretical benefit in separating the view part from the logic and variables but I'm not sure if there is a real payback to make it worthwhile. Any thoughts on (real) benefits?

chrishea 182 Nearly a Posting Virtuoso

On the third try (that fails), save the date / time / timestamp when he gets re-activated into the DB. Always check this field when someone tries to login. If the time is still in the future, then reject the login. If there is one and the time has passed, then make sure that you clear that database field.

As a comment, this is a pretty severe lock out. In most cases, this type of temporary suspension is for 15 - 30 minutes. It is sometimes done using a session value so if you close your browser and start it up again (or use another one) you can get back in. It isn't all that difficult to screw it up 3 times in a row (confusion on the PW not just mis-keying).

chrishea 182 Nearly a Posting Virtuoso

I was looking at the actual example at:
http://www.642weather.com/weather/scripts-image-handler.php

Have you tried to run this code and it didn't provide the same text overlay? I haven't tried to figure out this code but if it is already doing what you need then it isn't an issue. If it isn't then it would make more sense to start by contacting the author.

chrishea 182 Nearly a Posting Virtuoso

If you have a template for the page you want to create (e.g. in a file) and you read it, modify it with the custom information and then write it out as a file (but with a php suffix, then you will have a new page. If the custom information is more than trivial, then you might get some benefit from a templating system like RainTPL or Smarty. You still have the challenge of how to integrate this into your Wordpress environment. Whatever Formidable Pro uses as the "action" for the form is where you will need to insert the custom code.

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

The example already has a date in the overlay so why do you need to add one?

chrishea 182 Nearly a Posting Virtuoso

There are many free PHP - MySQL shopping carts:

http://lmgtfy.com/?q=shopping+cart+php+mysql

chrishea 182 Nearly a Posting Virtuoso

You need to post your code (and please use code tags

...
chrishea 182 Nearly a Posting Virtuoso

You need a form field to create a POST variable. <input type=... >

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

chrishea 182 Nearly a Posting Virtuoso

The format for the mail statement is:

bool mail ( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] )

You have one too many parameters for your mail statement ($name)

If you don't have a copy of the php manual, you should download one.

Chris

chrishea 182 Nearly a Posting Virtuoso

You have short tags in this module as well. I ran this code through an error check and I don't get an error. This normally means that you have a syntax error like missing a closing quote or a closing bracket but I looked through the code and I don't see it. Try changing the short tags and see if you still have the same error.

chrishea 182 Nearly a Posting Virtuoso

This is the wrong place but since we're here!

If you are setting up a website that matters at all, then you need to consider availability, server loading / response time, support / services and cost. If you go for low cost, then you are probably sacrificing one or more of the other factors. The savings on a cheap package is pretty insignificant when you consider the hassles you can have with everything else. There are quite a few sites that rate web hosts (and you should look at them) but you have to be careful because they may be getting paid to list the hosting sites. Try to get a recommendation for the same host from at least a couple of these sites before you believe it.

Personally, I have been using ICDSoft for many years and I'm very happy with them. They don't provide a whole lot of frills and they don't promise unlimited bandwidth or disk space or databases but they provide a very solid service and their customer support is great. How much is it worth to get an answer to almost any reasonable question within 10 or 15 minutes or less? Is saving a dollar or two per month on hosting a good trade-off with poorer service? I don't think so.

chrishea 182 Nearly a Posting Virtuoso

I spent a bit of time with RainTPL the last time that Ardav mentioned it in a post and I agree that it is pretty simple and straightforward. I would certainly consider it for something new. Retrofitting it would need some meaningful payback to make it worthwhile.

chrishea 182 Nearly a Posting Virtuoso

Here are some options that you can look at. Obviously, you are looking for a database-driven version and there may be limits with respect to the platform that you wish to run it on:

http://www.network-weathermap.com/about

You will see some other ones listed at the bottom of this page:
http://www.network-weathermap.com/manual/latest/pages/main.html#installation

pritaeas commented: Nice link +7
chrishea 182 Nearly a Posting Virtuoso

A link back to the entry form could be as simple as:

<a href="entry_form.htm>Back to the entry form</a>

Using whatever you called your initial form module (in place of entry_form.htm).

The description of the assignment assumes that you already have a telephone file with about 10 entries. Based on your questions and code, I don't think that you have even reached that point. It seems that you have some catch-up to do.

On this forum, we'll provide answers to specific questions but it isn't our role to teach you to program or to teach you PHP. That is especially true if you are taking a course that you need to pass on your own merit. Right now I think that you have a problem in building the initial telephone directory and you need to sort out your logic for creating/updating the file and then add some additional PHP code to do it.

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

I think that you need to post some code before anyone can really comment.

chrishea 182 Nearly a Posting Virtuoso

Your expectation isn't clear and it may not be feasible to do what you are saying you want to do. You have four choices for saving the data:
1. You can save it as an array as you have done. When this program finishes, the array is gone.

2. You can define the array as a session variable. In that case, the array will still be available until the session finishes (when you close your browser).

3. Store the data into one or more files. You opened a file in the program but you don't seem to be saving anything to it. You can use a file as long as there is only one user for the program or if you use a unique file name for each user, or you add some code to serialize the users so only one user can be active at one time.

4. Store the data in a database.

Your initial statement seems to imply that you will be saving multiple files into a directory but maybe that is just a problem with the choice of words. Please clarify exactly what you are trying to accomplish.

chrishea 182 Nearly a Posting Virtuoso

Just to clarify, does this have to be an online real-time tool or is it basically a static image?

chrishea 182 Nearly a Posting Virtuoso

When you do a mysql_fetch_array, it is getting a one-dimensional array with all database table columns for a single row as elements of the array. You can address them as:

$view_rows[1] or
$view_rows["ndlCode"]

but not both the way you have done it. Your version would make it a two-dimensional array (and it isn't!). You have coded it this way in more than one place so they all need to change.

chrishea 182 Nearly a Posting Virtuoso

Which line is 274? Is it the third line (if ($view_rows[1]["nIdCode"]!=...)?

chrishea 182 Nearly a Posting Virtuoso

Same answer that I gave to someone yesterday. You need to create a proper form and then you need to process the results from the form. Have a look at the two links below and try to apply what they are telling you.

Learn about HTML forms

Click here to see more about how to retrieve the data from the form in your php program.

chrishea 182 Nearly a Posting Virtuoso

You don't have a closing bracket before the else if on line 7. This doesn't result in an error in the interpreter but I think it is causing it to skip over the else if and go directly to the else on line 9 every time the initial if isn't satisfied.

chrishea 182 Nearly a Posting Virtuoso

Presumably, the previous insert failed. Your problem is likely with the insert itself not with this piece of code.

chrishea 182 Nearly a Posting Virtuoso

Mysql returns an array with the individual database fields/columns as elements of the array. If you don't have a copy of the PHP user manual, then you need it. You can get one here.

Once you have the birth date from the database, then you can turn it into a time stamp using strtotime and then extract what you need using date.