GET as in HTTP GET? If so why not convert it? If as a CLI script you could create a command
Is it possible to have access to a pure php file?
Hi everyone, I have a script in pure php, and that script receives 3 variables by GET method, my question is, how can I put that script inside my laravel project and send variables to it? Is it possible? Thanx in advance!
You could try including it in your controller method.. Still without knowing the content I cannot guarantee it will work. If at all possible I would recreate it in laravel like @joveice suggested
public function getHome()
{
include(app_path() . '\myfile.php')
The thing is that I have another php file from outside that sends variables to it using header Location and I put the script inside the root of my project, but when the other php sends the variables laravel shows the 404 error and it's obvious because Laravel doesn't know that the script exists inside the root
You will need to put it in the public folder for direct access
I did that, sorry, I said root meaning the public folder
That should work. What is the filename? Are you sure you are calling http://mywebsite.com/myfile.php ?
Yes I'm calling it like this: http://mywebsite.com/file.php?var1=something&var2=somethingelse&var3=anotherthing
If I'm not mistaken every request to you laravel application is routed through the index.php. That means that you can't access any specific php file in your public directory. I suggest that you convert that one to "laravel".
Setup a route for it and a controller with a method that does the same thing as you "pure" php file.
I do belive you can. Otherwise it would not be possible to use a phpinfo.php to check phpinfo();
I am unsure if the default htaccess denies accesss to all other files than index.php (don't use it myself)
Could also add a entry to the config file of your webserver to force it to that file if it matches, tho I would still highly suggest "larafying" it as I don't see a reason that can't be done.
Ok I understand, I'll try with the htaccess file, if it doesn't work, I'll convert it to laravel. i'll come back with the solution that fixed my problem for other users. Thanx guys!
Sorry for the delay... Well I don't know why the first try didn't work, but after trying again and putting inside the public folder and call it from outside just worked, so my problem is solved, thanx everyone!
Please or to participate in this conversation.