Skip to content
Advertisement

Tag: url

Form doesn’t take me to action url when submitting

When I submit my form it doesn’t take me to the right url, it instead just stays on the same url and adds the params to it. Like this: /todo?message=themessage rather than what it should be as /todo/add In my /todo/add url, I have a php script that is assigned to that route, which just echos a string and nothing

how to get url last part after slash as get value in php

My url is look like: http://localhost/event_manage?slug=hello and last value as like hello So that page is in index.php when i go http://localhost/event_manage/hello and shows error because there is no folder as named hello. But i want this hello is like GET value When I go http://localhost/event_manage/hello I tried in .htaccess file: But it still shows error and couldn’t pass the

REST Server-Client Communication

I’m developing an Android app in Java and I need to add a REST Server-Client Communication feature to it. I assume that the following code should post data to a .php file and will be thankful if someone explains to me what does it do and how to use it properly: Answer My answer is in as comments in your

PHP – Tunneling the API

I don’t know what this method called : Reverse Proxy , Tunneling, Bypassing ? Imagine, we have 3 website : 1. I bought the API or Payment Gateway service for example1.com , the website don’t have any content , forms, data. (Just to get the API) 2. Now, I want create tunnel between example2.com | example1.com | exampleapi.com. I mean,

Handling PHP URL and GET requests

I am currently parsing any given url, for example example.com/page/1 or example.com/api/info/1, by exploding the URL: and then accessing its elements in the array like so: But how could I handle (and access via array in the same way) a url that also includes GET elements, such as example.com/page?id=1 or example.com/api/info?=hello ? I am using nginx and trying files like

PHP Header Function Redirects to 404 Error

I am using a header redirect after the user submits a login and registration form and the input has been stored in a mysql database. The registration info is successfully stored into the database but when the script goes to redirect I reach a 404 error. I am using the variable $redirectURL to pass the absolute path to the header

PHP – get URL param with or without key

I know how to do this in a clunky verbose way, but is there an elegant way to retrieve a single param from a URL whether or not there is a key or index page in the URL? i.e. there will never be a &secondparam=blah. $_GET[“slug”] only works if the url has slug=foobar E.g. return foobar for any of these

php mvc url pattern which takes three arguments

I’m new to MVC. what I’ve learned from a few articles and some videos is that the general form of URL in MVC structure is as controller/action. but I’ve come across some URLs like this: www.exmaple.com/users/login/confirm which takes three parameters(users, login, confirm). I don’t understand which one is the controller, which one is the action, and what the third parameter

Get data from URL using PHP

This is incoming call API URL. so, this URL wont stop loading. this URL keep loading and give data in json format. how to get data from this kind of URL using PHP. Answer Why you used the php CURL to http request. You can use the laravel HTTP client. You can see: https://laravel.com/docs/8.x/http-client#making-requests

Advertisement