I have seen that after url for example
Please help me tu understand this, i have tried to find somewhere else but nothing
What does" php?later_word=" mean, and how to do that
So, you wan't to do the same as you said in the comment section on your first post.
So here a short resume how you can use GET paremter. Lets say, you have a index.html file. Create a link in it, for example:
Click here
So, in your filename.php you can do:
<?php
$yourvalue = $_GET["key"];
?>
So, this means you can acces this key from the url with $_GET. In this example, $yourvalue would contain "AnythingYouWant". So if you would do the following:
<?php
$yourvalue = $_GET["key"];
echo "Here is your $yourvalue";
?>
The output would be:
Here is your AnythingYouWant.
This is useful because PHP variables are not saved when you click on a link for example.
But dude, we posted you a link to the official description... normally you would find this answer by yourself. I really recommend you to read more tutorials, this are the basics of basics.
I know this can seem overwhelming, so I'll give you some pointers on which parts of internet basics you seem to be unclear about:
URLs. Find out what a URL is, what it is made of (scheme, path/suffix, domain name, query, port, and also the optional username/password in URLs might be good things to know about).
HTTP requests and in particular HTTP "methods". The most common you need to know are GET and POST, but there are many others, and you should have a basic understanding so you know how to look up a new one.
Web servers (i.e. HTTP servers, which at their most basic show static files of a web page). Usually people use Apache or NGinx as servers
Scripting languages to run scripts when someone sends a request to a web server. Examples are Python, Ruby, Perl and, in your case, PHP.
All of these work together to present a modern web site that shows more than just static text and pictures. #1 in that list is something you already need to know as an advanced user of any web browser, understanding 2 and 3 kind of goes hand-in-hand with making even simple web sites of your own, and once you understand that, you can advance to one of the languages mentioned in #4 to make a web site that can do something with user input.
Related
I am not asking about regular "execute php on my domain and get URL" but this:
I display image from php, here: http://myservice.com/ShowImage.php?Id=10
So Bobby who runs a website BobbyBlog.net could use this image on his blog like:
<img src=http://myservice.com/ShowImage.php?Id=10>
I want to know that Bobby has loaded image on his website, so what I need to intercept in my ShowImage.php script would be "BobbyBlog.net" string. I am afraid this is not possible with PHP as image request is separated from Bobby blog. What do you think?
As far as I know there is not way to capture which site executed your script, like you ask for. The server variable $_SERVER['HTTP_REFERER'] sets the referring page (the page that referred to yours) but I don't think that will have any values in this case. If I am not mistaken, this is the case for most programming languages, as this depends on the web server level, not the programming language. This means that you can not simply use Python or Perl and expect it to work.
Edit: On web server level this should be possible. Linking to images from other sites is commonly referred to as hotlinking. There are several guides on how you can disable this. Here is one for Apache.
Edit2: Looking deeper at the problem it may seem like you can inspect the $_SERVER['HTTP_REFERER'] value. This is described in this related SO question. It also mentions that this is not possible if sent over HTTPS, and that the value can be spoofed. In those cases there is no way of knowing the origin. Hope it helps.
I'm not asking for a whole engine of code. I'm working on a blog/magazine website. Here are the 2 styles of paginations. I see people use these types of addresses:
example.com/browse?page=100
example.com/page/100/
I understand 1.'s. But, 2. doesn't give me an impression of php usage in the address.
I did a search on Google, but there are only helps on 1. How do you manage 2.? Because whenever you write a new article, you have to push the content throughout every html? Did they use "fake addresses"? because I tried example.com/page/100/index.html and there is no such website.
Can anyone point me to a webpage or explain to me how did they manage 2. style of pagination? Which has a better UX?
Sorry if this is a bad title. Please help me edit and ask me if anywhere isn't clear.
It's URL Rewriting that is responsible or translating nice-looking Urls to their 'real' path on the server.
In your case,
www.example.com/page/100/
might be rewritten on the server to something like
www.example.com/browse.php?page=100
More info:
mod_rewrite for Apache
Url Rewrite for IIS
I am wondering if this is possible with PHP, or if not with ASP since it's relatively similar and I could pick it up quickly. Let's say I have a text input for a user to search a database; as an alternative to using the text field I want a user to be able to go to 'www.examplesite.com/SEARCHTERM'. Is this possible? I've seen it done, but I can't figure out how. Thanks!
You might have to look in to url rewriting based on the server you use.
URL Rewritting
This can be done:
1) Using $_GET
www.examplesite.com/?SEARCH=SerachTermHere
In the page you can get the search variable with $_GET['SEARCH']
2) Using URL Rewritting
Yes that's easily possible. For example if you have apache server then you can enable mod rewrite and write one rule to redirect all such requests to your script in a variable and it will then handle accordingly
It is possible, you have two options.
Using URL Rewritting in your server configuration.
Using $_GET global. Everything in URL after your actual page address is available through $_GET.
This goes a bit beyond your question but might prove to be very useful. Even though it is a framework, you might want to look at Symfony 2 routing for ideas how to implement it. Specifically at "Under The Hood" section. You can even explore their routing code on github. Applications made in it have exactly the form you are searching for (content displaying based on $_GET data).
can you tell if a site is made with cakephp, how,
how to check it - to check any folders, initial pages , to see some specific queries ?
Maybe this CMS detector can help you. HTTP headers in many cases reveal a lot about technology used to power a site.
1) find a form on it, if it has values in the format data[Something][whatever] chances are its cake
2) url format is normally /something/anotherthing/id and a lot of times there will be some urls like /pages/something, also wont often find extentions in the url
3) check the name of the main css file, some people wont change it, cake.default.css iirc
4) try going to a random url and see what the error looks like, default cake will be something like "Error: The requested address '/sdfsdfsfsd' was not found on this server."
5) if the url is site.com/something/etc and you can go to site.com/index.php?url=/something/etc
obviously these can all be done on any system, but its a pretty good giveaway if the all/mostly work
You can use WhatWeb which is created for this purpose and has a plugin for cakephp.
You can use the tool I made called PageXray, it can detect CakePHP apps.
http://pagexray.com
It uses some quick Curl techniques to check if files exists, if some css or images are in webroot and also checks the page's header for some CakePHP signatures.
Then for a list of sites that was made with cakephp, check this out.
http://pagexray.com/technologies/php_cakephp.htm
I've tried searching everywhere but there's seems to be no implementation available other than having the client use a file (batch/exe of some sort).
You just can't do it. PHP is server side scripting language, maybe you can do that using JavaScript, but I'm not even sure about that.
I know someone implemented such service, but actually he had to use Mozilla browser, which opened, a script (I think it was not JS, maybe perl, c/c++) made a screenshot and uploaded it.
I'm assuming you mean "your" in the general sense. If you mean "how does one take a screenshot...", you generally hit the print screen key. If you're trying to capture your users' browser output, I'd say that it's probably not possible. If it were, the best you could get is the output of what you wrote yourself.
Google Gears might be hackable to do something close, if you can simulate the print screen key press with JS and get the file to save somewhere gears can access.
You can't do that in PHP, as PHP is running on the server, and not the client.
To get screenshots of the browser, you can take a look at, for instance, this list.
If you are look for an automated solution to take screenshot of web pages opened in a browser window, you could also look at this question : How to capture x screen using PHP, shell_exe and scrot and it's answers.
And, finally, and without selecting any particular post, you can try a search on SO ; something like screenshot browser, sorted by relevance, seems to get some interesting posts :-)
Good luck !