Request other URL in one PHP Script [closed] - php

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
Hi i wana make a request in my script to a other page and the request have some get Parameters they come back.
(I dont wana do this with ajax only php in one script)
this should be done without redirecting to other page. I wana make this in the background to validate the data they come back from the other page in one script
www.example.de -> request www.exampel2.de/?ex=1
then i will validate the example2 get parameter in example.de
Any solutions?

PHP's cURL functions will allow you to perform advanced HTTP requests. You can use file_get_contents to access REST APIs:

Related

Get window size with php [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
What is the problem this code:
$window_width= '<script>screen.availWidth</script>';
$window_height= '<script>screen.availHeight</script>';
any idea?
Nothing wrong in your code, but you can't get any values in PHP variable, because PHP is Server side scripting language.
You need JavaScript, not PHP.
var screenWidth = window.screen.width,
var screenHeight = window.screen.height;
You can then send it to the server via Ajax (with an XmlHttpRequest).
You seem to be misunderstanding the basic concepts of how PHP and HTML/JavaScript works together. PHP is a server-side language and JavaScript is a client-side language.
PHP generates the output first and then it's transferred to the client where it's being executed. You're trying to do it the other way around.
What you need to do is first, generate a page using PHP, have it sent to the client for client-side execution, and from there have JavaScript perform a call that sends the information back to PHP using a GET/POST request.

Why using AJAX File Upload if PHP already sends the file? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Improve this question
Here there's a tutorial about AJAX file upload :
https://phpacademy.org/course/javascript-ajax-file-upload-with-progress-indicator
"A JavaScript AJAX file uploader that handles multiple file upload and percentage progress indicator. Uses PHP to handle file uploading."
What's the purpose of doing all this javascript with FormData and XMLHttpRequest to send the files?
I'm sorry, I just don't get it.
It's PHP that sends the file. What's uploaded by AJAX ?
Patrick
One of the advantages of using AJAX in your life is that you send stuff to the server without making the browser loading a new page. With that AJAX file uploader, you send files to the server but you are always on the same page. With FormData you can do things like showing a progress bar of the upload.
What's the purpose of doing all this javascript with FormData and XMLHttpRequest to send the files?
So you can do it without leaving the page
It's PHP that sends the file.
No, PHP receives the file.

Passing data from html server (with no php) to server with PHP and return data to that non-php server [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
Here's the deal:
I have blog, where I can only use a javascript and free php server. I need to send form data to that php server (this I know how to do), and return some info back to the blog page. Is that even possible?
The only way I can think with out cross domain request is as below
1) make this form in your blog
<form action="FULL_URL_TO_YOUR_PHP_FILE">
/// your fields
</form>
2) in your php file save data received from form and serialize the data(that you want to send back to your blog) in url format like
if you want to pass name and surname YOUR_BLOG_URL?name=myName&surname=MySurname and make redirect from your php file to your blog
header('location:YOUR_BLOG_URL?name=myName&surname=MySurname');exit;
3) now on your blog make an onload event like if you have jquery than
$(document).ready(function(){
alert(window.location.href);
// do some spliting or regexp or anything else to get your data from url
})

The best way to create a popup box login with php and jquery [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions must demonstrate a minimal understanding of the problem being solved. Tell us what you've tried to do, why it didn't work, and how it should work. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I need some help with something. I will be creating a popup login with Jquery with php code.
And my question is what is the best way to go.
Must php and jquery communicate with each other or can I keep them separate ?
I want to write Popup with Jquery and login code with php. I want my code as clean as it can go so there will not be any problems in the future.
I don't need any code for it, I will create it my self. I just need your opinion.
Sorry for my English.It is not that good. I hope my question is clear so you can understand it.
If you want to verify the login credentials within the popup, you need some sort of communication between jquery and PHP. -> AJAX.
PHP -> Serverside
Jquery -> Clientside
So offcourse you will have to use 2 different languages and be a clean programmer, i don't understand your number 2 question.

POST data to URL using PHP [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
I want to post an array or set of variable in a URL and post that data to that URL.
i have a URL to post data
i have code igniter
i have to send data to that URL using code igniter function
So how should i send that data to that URL?
people say use curl PHP, i am a web developer using Linux but new to it, so kindly be easy.
Best Regards
cURL is an easy way to send/retrieve data from other URLs. Personally, I find it to be fairly easy to use too -- you can see a tutorial here. If you don't have cURL, there are other options.
If you need to forward the user to another URL using POST, then you're in a bit more of a bind. HTTP was not designed that way. You can create a page on your side which has a form filled out with all of the post variables and have a script tag with document.forms[0].submit().

Categories