Encrypting PHP page [closed] - php

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I have a basic PHP page that uses user input from a HTML page to generate a list for the user.
How do I encrypt this page to prevent users from accessing the source code?
I have seen a lot of information around the web regarding padding html, disabling right click and using Javascript to encrypt code. I could not get Javascript encoding to work, and I didn't feel confident using one of the 'specialized' services, so I came here looking for further answers.
After all that research, it turns out PHP code is not seen by the user like HTML code is able to be seen. As HTML was visible to users, I assumed the PHP code on my PHP file would be visible too. The result is a relief, because it means my PHP code is protected from the public eye.
After a short query and some helpful answers below I have found a very simple solution to what seemed like a difficult question.
I hope this post helps people in the same situation who feel like they are unable to protect their code, so that can find relief in what is really a very simple solution.
Thanks,
Andrew

As stated by others, php code is not accessible to the public, unless your server is wrongly configured or hacked in some way.
However, the form data is sent between the client and server unencrypted. For sensitive data(e.g. Passwords), this has security problems. To solve this you need to buy an SSL certificate. Most hosting companies can sell you this.
Bear in mind the final output source of HTML, CSS and JavaScript will always be visible of the user, due to the way the web works. For many people, this openness is what makes the Internet so great.

You can encode your code with ionCube Encoder.

Related

Need help choosing languague for this project [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
first of all, sorry for bad english. Please correct me if I write something wrong!
I'm a "noob" in the programing scene, so I need some help. I want to help my mom to automate a process at her bussines. The core thing I need to do are this:
I need to extract info from a webpage (it's an php webpage), and compare the products that arrive with the one's displayed in the webpage. I want to do that scanning the bar codes of the products (I've a database of all the products barcodes). Then I need to save the comparission in a file just to make sure that everything is ok. I want to know wich languague is better for my case. (Then I will try to do it, fail, learn from my mistakes and then have some "stable" program to do this)
TL;DR: I recive products, I check if everything arrived in a website. I want to do that using bar codes and "automate" the process. I want to know wich languague is better for my case.
Thank you!!
As others pointed out in the coments, there is not best language, you need to chose the one that fits you.
But let me give you some recommendations on what might work.
You said that the site is already in PHP, that's the backend language. You should keep using it since a part of the site is already built with it. Other options are JavaScript using NodeJS, Python, Java, Ruby.
You can do almost everything you need in the backend (server side) using PHP, but some things might be better to solve them in the client side (front end) using JavaScript, is the default language that runs on the browsers.
Usually you use the backend language to serve pages, interact with a database, send data to the client. And the front end (JavaScript) to add dynamic functionality to your website.
Web apps used to depend a lot on the backend, reloading the page for every action, sending a lot of information back and forth.
The modern aproach to build web apps (like yours) is a bit more dependant on JavaScript. You load the page once and then just do AJAX (Asynchronous JavaScript and XML) requests to the server asking just for the information you need and showing it dynamicly with out reloading and having to load the HTML/CSS all over again. Many frameworks like Angular, React (with its whole ecosystem), help you a lot with it.
Read more about it here.
EDIT: just to clirify, I answered with some recommendations and opinions because it is what the question asks for.

How to implement a database like search form into a website? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
How can I go about implementing a database like search form into an HTML website? For example, there is a form to enter your zip code and after entering the zip code, it searches a .txt file (for example) and returns results that fall under that specific zip code.
Any help would be greatly appreciated.
Thank you
There are many approaches you could take. It's a very broad question.
As an example solution, you would need to have both client and server side code. The client would submit the form to a server. The server code could be written in a multitude of languages, PHP, ASP, JAVA etc.
The server side code would take the request parameters sent by the form, read the file, calculate any result and pass it back in the http response to the front end, which could be dealt with by displaying a new page or as part of an AJAX refresh.
As you can appreciate though, this is a very broad topic and there are many possible solutions.
Also as #Dagon points out, if you are not restricted to using a text file (although your title probably suggests you are) then using a MySQL or other such database could be a better solution, maybe even Solr as an indexing solution, depending on what you are searching for.

Showing some parts of a external website and modifing HTML/CSS [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I would like to know what is the best approach, based on good programming practices to show an external webpage (say Facebook or Twitter) on my website while being able to modify the HTML and CSS before showing it.
I know that I could use an iFrame however based on some opinions the iFrame does not seem to be a good programming practice (width issues, ugly scrollbars, etc).
Is there a better approach?
Update: Question was put on "too broad", in order to limit the possible answers I would like to know if it possible to change the CSS (and only CSS) of an iFrame, the user Muhammad Umer commented that it would be possible but provided no more details. Someone knows how to achieve this?
This can be done in PHP. First I want to suggest to look for API's. Facebook has some nice API's which allow you to show them on your website, with some options to customize is.
The more difficult (and lots of work to maintain) is using file_get_contents() and using some parsers and regex to get the parts you want. Allthough facebook (and some other sites) might prove difficult, they load some parts via JS, so file_get_contents cant get everything
Again, API's are the way to go.

searching for a great php overview [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
as the title reads I'd like to find a webpage which presents an overview of the php language cause it's been a little while since I stopped to program server scripts.
By overview I see a page with the basic writing of the language (variable writing and the types, the control flows, some writing recommandations and some common functions about arrays and string manipulation) of course without the explicative text that generally comes with tutorials, I just want to refresh my memory about the basis.
I used google to find my request but not seeing anything like this on the first page.
I prefer asking here cause I trust in the stackoverflow community. If you have a personal page that refers to my wanting feel free to post back
edit: this sheet seems to be fine if you want php get the surface of your brain back
http://www.emezeta.com/weblog/emezeta-php-card-v0.1.png
I would say this:
http://oreilly.com/catalog/phppr/chapter/php_pkt.html
Combined with this:
http://www.addedbytes.com/cheat-sheets/php-cheat-sheet/
One great source to find information is actually stackoverflow. Whatever specific problem you encounter, the answer is sure to be found on this site :)
Good luck, PHP is fun!

How do you allow users to dynamically create a web page within a web app? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
For example, when a user adds a question to a Q&A site, that question typically gets its own web page, and that web page was created on-the-fly. How can you do this with PHP? Could anyone point me to any resources? Thanks.
By "that question typically gets its own web page" you are referring to "gets its own url". For example, this one is How do you allow users to dynamically create a web page within a web app?.
It's really just a trick. Very simplified:
When you submitted this question, it got a unique identifier 3723813 and was inserted into a database.
There is a single controller script that deals with questions, say https://stackoverflow.com/questions.php
When someone tries to open this page, the server knows to send it to questions.php by using a module such as mod_rewrite for apache.
Then, questions.php looks at the url parameters, takes the unique id for this question, 3723813, and loads up its information from the database in order to display it.
The rest of the url is just cosmetic and just there so that we can right away know what question it is before opening the page.
"How to" on this is bigger than a normal Stackoverflow question.
Maybe have a look here for some ideas(I'm just quickly scanning through it right now, can't really say if it's a great tutorial or not right now): http://www.tuttoaster.com/how-to-create-a-forum-in-php-from-scratch/
If you're a php novice, it may be better to look for one of the open source PHP forum applications like http://www.phpbb.com/ or something like that (phpbb just being the first that came to mind). That will be a lot more code to sort through, but the more popular open source applications will likely already know how to deal with security concerns like cross site scripting attacks and sql injection attacks.

Categories