chrishea 182 Nearly a Posting Virtuoso

A system like PHP Shadow might deter the amateur but I suspect that a serious hacker would find a way to break it. Since the code is still there, just encrypted, it has to be de-encrypted in order to run it. At that point it would be vulnerable. I'd rather trust Ioncube where you don't get the original code in any form, just the byte code. But then again, you said you wanted to do it yourself from scratch.

chrishea 182 Nearly a Posting Virtuoso

This may help.

chrishea 182 Nearly a Posting Virtuoso

I am using Adblock. I temporarily disabled it and the menus have started working again. I re-enabled Adblock and the menus are still working but I'll have to see if they stop again. if I have to make a choice, I'll leave Adblock on and do without the menus I guess.

chrishea 182 Nearly a Posting Virtuoso

For the record, I am using Chrome.

chrishea 182 Nearly a Posting Virtuoso

Keep in mind that PHP is running on the server while your HTML code (including the <input statement ) runs in the browser on the desktop / laptop / phone etc. The only way that the PHP program on the server gets to see the user input (unless you are using some sort of Ajax approach) is for a form to be submitted from the code in the browser with the PHP program as the "action". This sends the fields from the form to the server addressed to the program that is defined in the action. You haven't defined a form in your code even though you have some of the elements that could be contained within a form. Your button may trigger the program that is defined as $cart_url but it isn't going to pass txtQty to the server as a Get or Post variable unless you define a proper form.

chrishea 182 Nearly a Posting Virtuoso

This is a pretty specialized topic. You have to consider what your product will be worth and how good you want the protection to be. If you are selling it for $10 a copy maybe the protection doesn't have to be all that great. If this is a product that has taken you a lot of time to develop and will be selling for $50 - $100 / copy or more, then putting cheap do-it-yourself protection on it may almost be the same as giving it away.

You are actually looking at two separate but related facilities. The first one takes your source code and produces something that will run successfully but does not contain the original source. It can't (easily) be de-compiled / reversed so pirates can't easily make changes to it or disable any other security features. Commercial products like Ioncube, Zend and Source Guardian produce "byte-code" which is like a semi-compiled version of the program. The byte code doesn't have the original source but it isn't true executable code either. This requires some sort of run-time module to interpret the byte code.

If you do some internet searching you will find programs (some of them free) that "obfusticate" the code. These use fairly standard techniques to make it difficult to understand the code and usually produce a string that can be executed with an Eval statement. The problem with this is that it can easily be broken so it is not a secure way to …

chrishea 182 Nearly a Posting Virtuoso

I reported the problem with the drop-down menus a while ago and the answer was to clear the cache. I did that and they started to work again but after a while it got back to the same point again. As a result, I no longer use the menus because I couldn't be bothered to clear the cache all the time. Something has changed because it wasn't doing this prior to a month or two ago.

chrishea 182 Nearly a Posting Virtuoso

Have you contacted your web hosting provider and asked them? They know exactly how they have configured their servers and what is allowed. They may be able to offer you a way to do this.

chrishea 182 Nearly a Posting Virtuoso

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

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

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

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

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

If your research skills are that poor, you should give up now. I found this in less than a minute:

"After the installation is complete, you will find XAMPP under Start | Programs | XAMPP. You can use the XAMPP Control Panel to start/stop all server and also install/uninstall services."

http://www.apachefriends.org/en/xampp-windows.html

chrishea 182 Nearly a Posting Virtuoso

There is a process to start everything. It doesn't run all the time. I'm not an XAMPP user but I'm sure that there is some pretty obvious documentation about how to start it up.

chrishea 182 Nearly a Posting Virtuoso

How about posting the code within code tags the next time to make it easier to understand.

You have double quotes embedded in your string. How is the poor PHP interpreter supposed to make sense of this since you can't nest strings within strings? You can change the embedded quotes to single quotes as long as there are no variables between the single quotes. The more general purpose solution is to escape all of the nested quotes so they will not be treated as the end of the whole string. Thus (as an example):

$post_xml = "... version=\"1.0\" encoding=\"utf-8\" ... ";

will work. This may not be your only problem but it will fix the problem with the quotes.

chrishea 182 Nearly a Posting Virtuoso

It seems that learning PHP would be the next step. There are lots of online tutorials and examples. Try W3schools.com or do a search for tutorials. You will need to download and install a development environment that includes Linus, Apache, PHP and MySQl. More info on that here.

chrishea 182 Nearly a Posting Virtuoso

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

chrishea 182 Nearly a Posting Virtuoso

Your links are defined as "localhost". You need to change them to proper urls so people can see them.

chrishea 182 Nearly a Posting Virtuoso

Moodle is an open-source learning system that you may want to look at.

chrishea 182 Nearly a Posting Virtuoso

For info on saving to Excel click here.

I suggest you consider using PDF instead. Click here for info on how you could do that.

chrishea 182 Nearly a Posting Virtuoso

Even if you don't use it, you may want to look at this PayPal IPN class. It works.
PayPal IPN Class

chrishea 182 Nearly a Posting Virtuoso

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

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

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

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

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

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

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

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

If you look at the example you will see that you just need to define the input, the output file name and then include the module.

$dfw_data = $data;
$dfw_filename = "fileout.xls"; 
include ".../desktop_file_write.php";

Your input to this (your $data variable) needs to be a properly formatted html table. Again, see the example. You don't want/need the \t or \n at the end of a line. The line should end with a </tr>.

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

Here is a little sample program to demonstrate this:

<?PHP

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

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

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

In the module that has the form you are just creating Post variable names by concatenating a couple of values. That's no big deal. You create the variables by using the concatenated string for the name of the Post variable exactly as shown in my previous post. The value would be something that you can use as a key for the DB. Since the program will be working in a dynamic environment where a user can post a new comment at any time, what your program gets (and will display in the form) is a "point-in-time" snapshot. A second later, or while the list is being reviewed by the administrator, someone could add another one. Your program won't show that additional one until you go through the process again. This kind of processing isn't critical, so there isn't a need to be adding to the list in real-time. That would require some fancy code using Ajax and it just isn't necessary. Additions happening while the list is being processed shouldn't create a problem because your Post values should be a key that can be used to reference the database that will still be valid even if additions have happened since the list was produced. If the database was being dynamically re-organized and keys were being changed in real time then that would be an issue but for what you are doing new items should get added to the end (of the DB table) and existing records shouldn't be changing.

chrishea 182 Nearly a Posting Virtuoso

If your main objective is to write it in some language that's find. If what you really want is the actual tool, then you might want to consider downloading something that already works. One example is:
http://www.tac-soft.com/

chrishea 182 Nearly a Posting Virtuoso

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

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

giving you a series of variables from check1 to checkn

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

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

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

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

It also depends on where you want it to run. Is it a desktop (windows, mac and/or linux), a tablet or a phone (iphone, android, win7 soon and proprietary os's) or a server (linux or windows). The platform that you want to use will lead to a more limited range of choices. On the other hand (as per the previous response), if you want to use a language that you already know, that will dictate which platform(s) it can be run on.

chrishea 182 Nearly a Posting Virtuoso

You can get the referring page with $_SERVER

Re-directing can be done with header ("location: the url ")

As for the part in the middle, you will need to write some code to open a MySQL db and get the url from there. I'm sure that you can find tutorials and sample code if you do an internet search. To keep the setup simple, you could upload the content from a CSV file using PHPMyAdmin.

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

Just because it works in one browser doesn't mean that the code will be acceptable to all of them.

Don't know if it will fix your situation but here is one solution to a similar problem.
http://www.figured-it-out.com/figured-out.php?sid=181

chrishea 182 Nearly a Posting Virtuoso

If you want to modify what you show for each user, then:

  • For information that is specific to the user like birth date you should be querying the data base for a record for that user (e.g. by login id) and then displaying what is in the record. The code to do this will be the same for every user and the info would all be contained in a single table with one (or more) records for each user.
  • Users could belong to groups and the group id could be stored in each user record. This could be used to control what is displayed like images.
  • If the users have their own data like uploaded files, then you will probably want another table to track this. This table could contain the user id, the type of resource and identifying info for the resource (e.g. a file name for an image.). Each user could have multiple records in this table, one for each resource that they "own" or are linked to.

If everything is well organized, you only need one database and maybe as few as 2 tables.

chrishea 182 Nearly a Posting Virtuoso

There is more than one version of software with this name. If you are using HTML2PDF V4 from here (the best one), then the examples that come with the distribution demonstrate using images. See exemples/res/exemple00.php

chrishea 182 Nearly a Posting Virtuoso

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

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

Just a note that some web hosts don't allow email piping (mine doesn't). For those who can do it, this should be very useful so thanks for taking the time to share it.

chrishea 182 Nearly a Posting Virtuoso

Homework assignment?

You need to come up with the initial approach and then if you have specific questions or problems then you can post those and someone may be able to help you. If you haven't got a clue as to how to even start, then it's time to hit the books, use your brain or give up.

chrishea 182 Nearly a Posting Virtuoso

A PDF is an output file meant for viewing or printing. Trying to pull it apart to get at the content is technically feasible (there are desktop utilities that can do it) but I don't think you will have too much luck finding PHP code to do it. I think that it makes more sense to re-examine why you want to do this and look for an easier alternative.

chrishea 182 Nearly a Posting Virtuoso

Your logic seems to be reversed. If the expiry date has already passed, then you would want to delete the record. Assuming the $timestamp is the current one, then it needs to be greater or equal to $row before you do your delete.

chrishea 182 Nearly a Posting Virtuoso

It's easy to send a text message and there are lots of posts that address that. One example.

If you really want to do this as a voice message, it gets (a lot) more complicated. You now need access to a server that has a telephone network connection and an API that lets you send (or receive) messages. Someone has to pay for that so chances are that it is going to cost you something. A couple of possibilities are:
Twilio
Google Talk
You can do a search and find others.

You might be able to find something off the shelf that does what you want but you're going to have to do some research. If you want to keep it simple, asking for a cell phone number and sending it as a text message is a whole lot quicker and simpler.

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

You can use the php mail command to send an SMS message. The email address needs to be formatted however the telecom company requires it. The general format is the phone number followed by the telecom company site name. There is no need to use Gmail if you already have access to an email server. If you really want to do it through GMail, then you can probably connect with GMail through SMTP but that is a more complicated way to do it. There is lots of info that you can find through a search on Daniweb or the Internet. One example is this one.

SMS messages can be sent for free (for the sender) in North America but that may not be true where you are.

chrishea 182 Nearly a Posting Virtuoso

I think that it's simplest to create your report in html and then generate your pdf from that. I've been happy with HTML2PDF to do that for me.

chrishea 182 Nearly a Posting Virtuoso

I did exactly that in the past for a sports registration system. It allowed multiple players to be registered and as the final step it went to paypal for the total payment. In the description line, I included the names of all of those being registered for the single payment and my reference number. I built this myself using Paypal IPN but since that time I discovered a class that does the same thing and takes away the need to re-invent that wheel. You can link to it for a download from here.

chrishea 182 Nearly a Posting Virtuoso

Provide some code.

chrishea 182 Nearly a Posting Virtuoso

If you want some help with an assignment, you need to do the initial work and provide some code and tell us what problem you are having. You need to do most of it or you don't deserve to get a passing mark. It sounds as if you don't have much understanding of PHP so I would guess that you don't have much or any experience using a DB either. You also don't seem to know much of anything about encryption. You have a lot of learning to do if you are going to complete this assignment through your own efforts. If you haven't already had an introduction to PHP (and databases if this assignment requires you to use one) in your course, then this assignment doesn't make too much sense.

chrishea 182 Nearly a Posting Virtuoso

You may want to look at Dolphin. The Free version may not have everything you want but you have the option of paying to get more.

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

You need to remember that the PHP is all done when the Javascript executes in the Browser. Thus you can't casually go back and forth between the two. With some Ajax, you can get back to the server and have PHP do something for you (e.g. some SQL stuff) and return the result to the Javascript. I don't have any code to give you for that but someone probably will or you can do a search. You can't do a PHP re-direct from the Javascript but I believe that a window.location command in the javascript will accomplish the same thing.