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

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

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

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

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

In the program that processes the form you will still see them as individual fields. When you have an unknown number of fields, the best way to handle it is to have a standard field name followed by an index number (as you are doing). In the receiving program, you can check if the variables exist and then concatenate them before you save them to the database. In this example, I separated the values with commas. That would allow you to explode them to process them as individual fields later. You should do some editing on the incoming fields before you save them. if you use a separator, you'll need to check that it isn't in any of the strings.

$features = "";
$i = 1;

while (isset($_POST[feature$i])) {
      $features .=  $_POST[features$i].","; 
      $i++;
}
epicrevolt commented: Solved my problem, I love you :) +1
chrishea 182 Nearly a Posting Virtuoso

Wow, quite a pile of code. We can't see what is in the files that you are reading in. That could be a source of a problem or not (but probably not at this point). It seems that on line 67 it should have been $var_Ulist = ...

On line 109 you should probably dump the arrays (print_r) and the two variables (with an echo) so you can verify that the data is what you think it is.

Your Else If statements at 120, 127 and so forth will never be executed / true. If the statement at line 113 is true, then the statements immediately following the IF will be executed and it will ignore the else if's. On the other hand, if the IF statement at line 113 is false, then all of the Else If statements will also be false because they have the same condition as the initial IF.

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

I believe that this one is the best for generating PDF's from HTML:

http://html2pdf.fr/en/default

It handles forms and Javascript and pictures and almost anything that you can throw at it.

chrishea 182 Nearly a Posting Virtuoso

You can't have a where clause in an Insert statement. See the format here.

chrishea 182 Nearly a Posting Virtuoso

I generally answer two kinds of questions:
1. Questions where I know the answer or I can determine it /confirm it fairly quickly.
2. Questions where I don't know the answer but I have a reasonable chance of finding it out with a little bit of research.

If you have some interest in the topic and you will potentially learn (or refresh) something that may be useful, then it makes it worth investing a little bit of time. It is surprising how many questions can be answered through a search on the topic. A lot of people who post questions are too lazy or just not competent enough to find the answer to their own question. That leaves lots of opportunity to fill that gap.

chrishea 182 Nearly a Posting Virtuoso

Just like desktop development, it could be anything, including web sites. PHP and ASP are the most popular languages. PHP is popular because it is relatively easy to use and it is open source. It has a large user community with lots of open source systems to choose from. w3schools is the best source for tutorials and reference info. In addition to PHP, you will want to know some sql and learn about MySQL; you will need to know HTML and some CSS and you'll probably want to know something about Javascript. The JQuery library and its plug-ins make this pretty easy.

chrishea 182 Nearly a Posting Virtuoso

You haven't had any replies because what you are asking for goes beyond the normal definition of "help". If you want collaborators, then you should be posting in the Project Partners Wanted forum. Realistically however; you would have to ask what you are bringing to the table and why anyone else would want to spend their time helping you or collaborating. With what you have posted it is a bit like saying:
"I'd like to build a bicycle. I have a few spokes: here let me show you. Please help."

In terms of what you would like to build, it has probably been done many, many times before. If you would like to use this as a learning process, then I suggest that you download an existing system, study it and make some improvements to it. If you are serious about this, then you will have to be prepared to do a lot more work and research before you ask for help. One existing PHP Journal system that you could start with is this one.

diafol commented: You were really polite chris - I wouldn't have been +7
chrishea 182 Nearly a Posting Virtuoso

It could tie up their mail server so yes they might not be happy but 600 isn't all that many. I'd look at the hosting provider's policies. If you can't see anything there about it, I would give it a shot with all 600.

chrishea 182 Nearly a Posting Virtuoso

It's actually pretty easy. Based on the first example they provide with the package, here is the code with a few extra comments

<?PHP
        // first get the html that is to be converted
        // they have them all as separate files but it could be a variable that you
        // built within this program 	
        ob_start();
 	include(dirname(__FILE__).'/res/exemple00.php');
	$content = ob_get_clean();
	
	// conversion HTML => PDF
        // you need to include the class module and then give it a few commands 
	require_once(dirname(__FILE__).'/../html2pdf.class.php');
	try
	{
		$html2pdf = new HTML2PDF();     // you can use the default parms
		$html2pdf->setDefaultFont('Arial');
		$html2pdf->writeHTML($content);
		$html2pdf->Output('example00.pdf');
	}
	catch(HTML2PDF_exception $e) { echo $e; }
?>

I think that Arial is the default font so you probably don't even need that. The key to getting it converted is to give it valid HTML. That means that it needs opening and closing tags for html statements. It does a pretty good job but it doesn't handle everything. I've done some of my own examples to understand the features better. I suggest that you do a little experimenting as a way of learning it better. If you have a specific problem I may be able to help.

With respect to mysql: if that's where you want to save it, then I think it would be simpler to save the HTML (probably in a blob field). I think that the html will probably take less space and you can easily re-create the PDF when you need it. This facility is made to produce …

chrishea 182 Nearly a Posting Virtuoso

They are big enough that they probably have their own gateway. The gateways are probably done by an internet link to one of the cell providers and they probably do the rest. On a small scale, you might be able to do it through a phone but on a large scale that wouldn't be practical.

chrishea 182 Nearly a Posting Virtuoso

I don't believe that you will be able to do this without signing up with an SMS Gateway service who will do it for you (at a cost). You might be able to hook up your PC to a cell phone and have the cell phone act as your gateway but I don't know for sure that you can do this (or how).

I'd like to believe that there is an intended level of secrecy around this to avoid spam sms messages being sent too easily. There are probably financial reasons as well.

chrishea 182 Nearly a Posting Virtuoso

I got my Asus laptop (2.1 ghz dual core 64 bit with Win 7, 4 gig memory 500 gb drive, 16" screen) for under $600. That's a pretty good price for a pretty good machine. You can certainly pay more for less. It isn't made to be a high performance machine (and I don't do much gaming) but it runs very well (especially compared to my previous HP running Vista). If you can find something off the shelf then you have a much better chance of getting a deal. You might still be better off buying something adequate and then replacing the video card (if it's possible). Desktops are pretty easy to customize. Laptops aren't really intended for that even though it may be possible on some machines.

codingNewB commented: good information +0
chrishea 182 Nearly a Posting Virtuoso

Have you tried it? I don't believe that Cron will have a problem because the password protection should only apply for access from the web.

chrishea 182 Nearly a Posting Virtuoso

Assuming that "automatically" means doing a query to write it to another table, then the answer is yes. Do a MySQL Insert or Update into the appropriate table.

ceeandcee commented: Thank you! +1
chrishea 182 Nearly a Posting Virtuoso

If it is simpler (less code) then it is probably better. If you need to do the same thing multiple time using different parameters then a function would seem to be the way to go. Unless there is a lot of complex / extra code in the function to make sense of the input parameters and what you need to do with them (versus customized modules for each type of parm), then it won't have any performance impact.

chrishea 182 Nearly a Posting Virtuoso

You're probably better off using timestamps. Have a look at this tutorial:

http://www.dreamincode.net/forums/topic/19953-calculating-age-tutorial/

chrishea 182 Nearly a Posting Virtuoso

Seems that a Ping is the standard way to see if you are getting a response.

chrishea 182 Nearly a Posting Virtuoso

I developed my own Paypal IPN interface and it has been running successfully for quite a few years now. I discovered a Class that does pretty much the same thing that lets you avoid most of the research and experimentation. You can download a copy from:

http://www.micahcarrick.com/php-paypal-ipn-integration-class.html

You do still need some understanding of how Paypal works so you should still read the documentation from the Paypal site. You will want to set up a "sandbox" account so you can experiment with the interface. There is a program that is included in the download that uses the Class to do a payment but you will need to customize it with your account info. If you have difficulty making that work, do another post and we can probably help you to make it work.

chrishea 182 Nearly a Posting Virtuoso

You can generate these files using Headers. This pretty simple module packages it together for various output formats. You need to generate the formatted output in HTML. Word and other programs can take that HTML input and then use it as if it was the native Excel or Word format.

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

chrishea 182 Nearly a Posting Virtuoso

It is actually the HTML that you need not PHP. In your link you add target=_blank. Depending on the browser and the settings, it may open in a new tab or a new window.

chrishea 182 Nearly a Posting Virtuoso

Try enclosing line 6 in single quotes rather than double. Your line would then look something like:

$hc1 = ' <?php $site_status = \'';

Single quotes tell PHP not to interpret what is between the quotes whereas it does try to interpret what is between double quotes (finding $site_status to be an empty value in your case).

natchattack commented: Very helpful +3
chrishea 182 Nearly a Posting Virtuoso

Uniform Server is recommeneded over WAMP and Xampp because it has better security.

If you still want to use XAMPP here is some more info on that:
http://www.astahost.com/info.php/xampp-wampp-questions_t18396.html

http://textpattern.net/wiki/index.php?title=Using_XAMPP_(Apache-MySQL-PHP-Perl)_for_Windows

chrishea 182 Nearly a Posting Virtuoso

Is this supposed to mean something that someone could actually reply to?

chrishea 182 Nearly a Posting Virtuoso

I'm not sure that I totally understand your question based on your explanation but let me take a stab at it. If I understood it incorrectly, then you'll need to clarify:

If you need to send the RoomName from module to module2 that is just a (straightforward) use of a form variable. Your option (0 or 1) will be sent to module2 and so will the room name. You can do this as a free form entry of a text field (not the best solution) or provide them with a drop-down list that you load with all of the possible room names or have a checkbox or radio button beside each room that you are displaying in the first module. Whichever way you do it, module2 will know which room name to use when it reads the database.

chrishea 182 Nearly a Posting Virtuoso

$_SERVER will give you the root address.

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

Your initial statement / request is almost as unrealistic as:
"I am a PHP programmer. I need to build a bridge. I don't have the time to learn all about civil engineering. Just tell me the most common design approaches for building a bridge so I can get on with it."

There is no list because it depends on what you are doing. If you have programming experience in another language, then you may know conceptually how to accomplish what you need to do but you still need to turn that into working PHP. If you don't have much programming experience, then you can't take a PHP cookbook, put together a program and expect that it will work (or that you will know enough to be able to debug it).

If you need to put together a site, I strongly suggest that you use a Content Management System rather than build it from scratch. Even if you are experienced in PHP, HTML, CSS and Javascript, it makes no sense to do it from scratch unless you have a requirement that can't be satisfied with a CMS.

chrishea 182 Nearly a Posting Virtuoso

I ran a little test program from my (virtual) linux server. I ran it from IE, Firefox, Opera and Chrome. It checks the filesize for another program in the same directory. It gave exactly the same (correct) result in every case. You must have a problem or limitation in your server environment or something wrong in the program or a problem in one or more browsers (try another version?). The program that I used was:

<?PHP
/*
     Test filesize (change the module name to check to something in the same directory)
*/

     $size = filesize ("div_by_zero.php");     
     echo "<br>div_by_zero.php reported as size=$size ";    
?>

If you run this and you don't get a value at all then something strange is happening on the server. If you don't get a value (or it is inconsistent) in different browsers then there could be a problem with the version of one or more browsers that you are using.

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

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

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

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

You can also add:

error_reporting (E_ALL);

Which is similar but a little different.

chrishea 182 Nearly a Posting Virtuoso
chrishea 182 Nearly a Posting Virtuoso
diafol commented: Nice - I like it - most useful thing I've seen for a while +6
chrishea 182 Nearly a Posting Virtuoso

You will need to use javascript. have a look at the following item as a start:
http://www.webreference.com/programming/javascript/mk/column2/

There are some JQuery drag and drop plugins here:
http://plugins.jquery.com/project/Plugins/category/45

chrishea 182 Nearly a Posting Virtuoso

I agree with the previous note that you will need some expertise and some time to put this together. Have a look at the following links:

Expedia Affiliate Program: http://www.expediaaffiliate.com/private-label-xml.html

A service similar to what you are trying to do: Kayak

A sample of the Expedia API Spec (2007): Expedia API

I'm sure that Travelocity and other such companies provide similar capabilities. I think that you have a lot of research to do before you decide on the best approach.

scaiferw commented: Well considered links contributed. +1
chrishea 182 Nearly a Posting Virtuoso
theighost commented: very helpful :) +0
chrishea 182 Nearly a Posting Virtuoso

It's pretty simple and you don't need to pay for a gateway.

You can send an SMS message just like an email. The wrinkle is that the email format differs between cell phone providers. When you want to do an SMS authentication, you must ask the person (on the website) for their cell number and provider name (best to use a drop-down list). Then, you must create the right email address format and send the message like a normal email. On the website, you will have a 'Continue' button and it will provide a form where they can enter the code. To get the formats for the various providers you can do a web search for something like 'PHP SMS send' and you'll probably find some sample code and as starting list of providers and formats. Any others that you need can be found by going to the web sites for the providers that you need.

Questions on working with SMS come up often enough I guess I'll have to create a tutorial but right now, this is what you get.

iWalletMobile commented: Great Help +1
chrishea 182 Nearly a Posting Virtuoso

If you use a relative address like include "inc/xxxx.php" or one that points to the root like $_SERVER... I don't see why you would need to change it. I don't understand why you would anticipate a need to totally change the structure. Once you define a need to have $_SERVER."/inc/top.inc.php" then that becomes a requirement for your site. Unless I am misunderstanding your question, it seems that you are trying to be unnecessarily flexible.

chrishea 182 Nearly a Posting Virtuoso

[start_rant]
Maybe it's just me but we seem to be getting a lot of posts from newbies (more than normal) who post vague general questions or dump a whole bunch of code that isn't working and expect someone who knows what they are doing to spend a bunch of time doing something that they may have been too lazy to do for themselves. You don't need to be a php expert to post a question or a problem (probably quite the opposite most of the time). I think that we should expect some effort on their part first to do some research, some testing / debugging and provide a decent statement of the problem / question before they get any help. In many cases, you can do the work to get them an answer and you don't even get a response much less a thank you. Maybe what the internet needs is a global rating of every person for intelligence and as a decent human being. This would follow you around everywhere you go so everyone would know what they are dealing with. Sort of like the DaniWeb + or - ratings for individual posts but on steroids. I am kidding (mostly) but it seems that there are quite a few people who would deserve to be blacklisted on one or both counts.
[end_rant]

vaultdweller123 commented: agreed, very well said ^_^ +1
Lusiphur commented: My sentiments exactly! +1
chrishea 182 Nearly a Posting Virtuoso

Good luck getting an answer!
First: You have dumped a large amount of code into your post without code tags so that makes it difficult for anyone to make sense of the code.
Second: Debugging is part of programming. You give no indication as to what you have already done to try to isolate the problem or where in your code the pertinent code is to choose the state or set the value.

chrishea 182 Nearly a Posting Virtuoso

You won't see the php when you view the source. The php executes on the server and all you see in the browser is the html and javascript if there is any. In this case, the "Hello World" string should appear after the <Body> statement.

There are lots of things that could be wrong but for starters, your module has to be recognized as a PHP module by the (WAMP) server. Thus, it has to have a .php suffix. If that is correct, I would verify that the content of the module is what you have shown above. If not, I would take Eclipse out of the equation initially and just use a text editor to save the module and try to run it in WAMP. If that works, then WAMP is ok and you have some sort of problem in what you are doing with Eclipse. If WAMP has a problem, then I'd fix that first and then sort out Eclipse.

chrishea 182 Nearly a Posting Virtuoso

if you are a computer science student then you need to learn to do research. The internet and sites like this make it so easy. If you do a Google search or search this site, you will find some pertinent references. This is a bit old but it sounds like the same question from a few years back.
http://www.daniweb.com/forums/thread33423.html

Once you do the initial work, if you run into a problem, then you can probably find someone here to help you.