How to Ad Parameters to XML URL? - php

URL is https://xmlfeed.game.eu/xmloddsfeed/v2/xml/feed.ashx?apikey=8712-d4953-ed11-9f37-003042d5&includeFraction=true&includeCent=true
I want to add a parameter delta="60"
Thanks
I tried
https://xmlfeed.game.eu/xmloddsfeed/v2/xml/feed.ashx?apikey=875e92-d453-ed11-9f37-003048dd5&Delta=60

Related

how to pass a link as paramameter in url

i want to pass a domain link with http or https protocol as parameter in the link
for example
http://www.payskip.me/url.php?go=https://www.oast.com
problem is when i pass the link without .com or any other extension it works well
like if i pass
http://www.payskip.me/url.php?go=https://www.oast.pk
its working but when i pass the link with .com its not working
example
http://www.payskip.me/url.php?go=https://www.oast.com
please tell me how can i solve this
URL encode the parameter, see reference:
http://www.payskip.me/url.php?go=https%3A%2F%2Fwww.oast.com
There is a url_encode function in php.

PHP - GET parameter

i need help with my code:
Im including pages in index.php like:
if(isset($_GET['xx'])
{
// include('yy/'.$_GET['xx'].'.php');
}
and now in the file page.php i wanna use get parameters like from and to.
i use htaccess for short url
RewriteRule ^([a-z]*)$ ./main.php?xx=$1
So i get this url in final:
index.php?xx=page?from=a&to=b
When i print_r($_GET) i got only first parameter xx
$_POST parameter works fine, but i need it with $_GET.
Look at the URL:
index.php?xx=page?from=a&to=b
It should be
index.php?xx=page&from=a&to=b
You put ? in there twice instead of a &
Solved!
by misorude
By specifying your own query string in the replacement, you are
discarding the original one - this is default behavior with
mod_rewrite. You need to specify the QSA flag to keep it.
httpd.apache.org/docs/2.4/rewrite/flags.html#flag_qsa
Thanks for fast responds without reading. Have a nice day!

How to remove specifc query string parameter from Laravel redirect()->intended('/')?

How to remove specific query string parameter form redirect()->intended('/') if exist?
For example redirect()->intended('/') would redirect to:
https://www.exampleDomain.com?specificParameter=true&anotherparameter=123
And I would like to get rid of "specificParameter=true" before redirection so it will get redirected to this instead:
https://www.exampleDomain.com?anotherparameter=123
I'm using Laravel 5.3.
Thanks in advance
Use PHP's parse_url function: http://php.net/manual/en/function.parse-url.php
Then you can grab the components you need specifically and create the correct redirection URL.

Getting Parameters in a URL without question mark

Is there any way that I could I could have a parameter in the URL but not using question mark in PHP?
The inputted url as:
http://www.example.com/y/foo
But it actually parses as:
http://www.example.com/y/?y=foo
but the actual URL which the client has is the original URL.
The /y/ directory does exist and so does the index.php file inside of that.. But the /foo file does not exist.
This can be achieved via url rewriting. The url structure you are looking for will not be the actual url but it can replace the actual url and make your url look pretty, while the original url is responsible for the page being displayed.
The foo here is a parameter or supposedly argument for a function present on that page.
http://www.addedbytes.com/articles/for-beginners/url-rewriting-for-beginners/

How to extract URL parameters on 404 Error in PHP

I have my htaccess redirecting to a error404.php but I want that PHP file to be able to extract the original url parameters.
For example:
http://mywebsite.com/unknownfile.php?param1=value1&param2=value2
I've tried $_GET['param1'] but that's empty. The $_SERVER['PHP_SELF'] just shows error404.php
Many thanks in advance.
You can access original URL via $_SERVER["REQUEST_URI"].
For example: requesting URL /hihi/meow?key=rumba which does not exists. The $_SERVER["REQUEST_URI"] will have that string, which you can parse with parse_url() function to split into parts and use other functions (like explode() to get to individual query strung parameters.
If you redirect this info will only be present in $_SERVER['HTTP_REFERER']

Categories