answersLogoWhite

0


Best Answer

Please go to www.Google.com, and search for "php upload photo script" or something alike. I'm sure you'll find somthing there.

User Avatar

Wiki User

15y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Can you sen a code to upload photo in javascript or php?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is the php code to close the existing window using button?

It is not a PHP code but a Javascript code. w3schools.com has all the answers you need about Javascript. It will teach you how to use the code and implement it into your website. If you're creating your own websites I suggest you actually learn the code. It will come in handy later on.


How do you insert PHP code into JavaScript?

PHP is server-side code which means that the code is executed on the web server. The pages are dynamically created and sent to the user's browser. JavaScript is a client-side code which means that it runs on the user's computer after the page has been sent from the server. It is possible to combine PHP commands within JavaScript commands. You would mainly use this in setting up starting variables for your JavaScript. Example: ; …etc --> Another option is that you may consider using Ajax which allows you to dynamically call server-side code from JavaScript.


How can you use a JavaScript variable in the PHP isset function?

You can't actually do that. There is no direct way to make JavaScript code talk to PHP code, as the two languages are interpreted in different locations. The PHP is interpreted by the server, and the JavaScript is interpreted by the client. This means it's easy enough to transfer data from PHP to JavaScript (by generating the JavaScript with the PHP), but not the other way around. If you're simply looking for a way to see if a JavaScript variable is set (from within the JavaScript itself), that can be done with a line like this one: if(myVariable !== undefined){ /* do stuff */} If you actually want to handle it on the PHP side, one way to do so would be to use additional PHP code when that happens. For example: <?php $jsVars = array(); ?> <script type="text/javascript"> var foo = 'bar'; <?php $jsVars['foo'] = 'bar';?> var yub = 'nub'; <?php $jsVars['yub'] = 'nub';?> </script> ... You can then check to see whether a certain variable has been set by seeing if it's in that array: <?php function jsIsset($varname){ global $jsVars; return array_key_exists($varname, $jsVars); } ?> This however, only works when the JavaScript is generated, not when it's interpreted by the client system. For example, imagine you have a variable that is defined by a JavaScript function that is called from an onclick event. By the time that event happens, the page has already been served and the PHP is done executing. If you want the JavaScript to tell the PHP that a variable is defined, you would need to do it through an AJAX request, which I believe is beyond the scope of this question.


How do you use the JavaScript confirm function in PHP?

It has to be done with Javascript. Though you could do something like this:


How do you call JavaScript object in PHP?

You cannot do that, since PHP is serverside and javascript is clientside. The best way is usually to have an ajax layer (a php file) to handle requests from the main php file. For example: You would have 3 files index.php, ajax.php, and functions.js The index.php is what people would see, and would include the functions.js javascript file. The functions.js file would then send requests to ajax.php. These requests could be a search query, a login request, etc... or any other object for that matter. Accessing javascript objects on demand is not possible though.

Related questions

What is the php code to close the existing window using button?

It is not a PHP code but a Javascript code. w3schools.com has all the answers you need about Javascript. It will teach you how to use the code and implement it into your website. If you're creating your own websites I suggest you actually learn the code. It will come in handy later on.


How do you connect javascript using php?

Any communication between Javascript code and PHP code needs to be instigated by the Javascript. This is because Javascript is a client side script and PHP is server side. The server can't force data to the browser; it can only reply to requests. The technique of using Javascript on the client side to talk to server side scripts is referred to as AJAX (Asynchronous Javascript And XML). There are several libraries available for simplifying it's usage, and many online tutorials.


How do you insert PHP code into JavaScript?

PHP is server-side code which means that the code is executed on the web server. The pages are dynamically created and sent to the user's browser. JavaScript is a client-side code which means that it runs on the user's computer after the page has been sent from the server. It is possible to combine PHP commands within JavaScript commands. You would mainly use this in setting up starting variables for your JavaScript. Example: ; …etc --> Another option is that you may consider using Ajax which allows you to dynamically call server-side code from JavaScript.


How can you use a JavaScript variable in the PHP isset function?

You can't actually do that. There is no direct way to make JavaScript code talk to PHP code, as the two languages are interpreted in different locations. The PHP is interpreted by the server, and the JavaScript is interpreted by the client. This means it's easy enough to transfer data from PHP to JavaScript (by generating the JavaScript with the PHP), but not the other way around. If you're simply looking for a way to see if a JavaScript variable is set (from within the JavaScript itself), that can be done with a line like this one: if(myVariable !== undefined){ /* do stuff */} If you actually want to handle it on the PHP side, one way to do so would be to use additional PHP code when that happens. For example: <?php $jsVars = array(); ?> <script type="text/javascript"> var foo = 'bar'; <?php $jsVars['foo'] = 'bar';?> var yub = 'nub'; <?php $jsVars['yub'] = 'nub';?> </script> ... You can then check to see whether a certain variable has been set by seeing if it's in that array: <?php function jsIsset($varname){ global $jsVars; return array_key_exists($varname, $jsVars); } ?> This however, only works when the JavaScript is generated, not when it's interpreted by the client system. For example, imagine you have a variable that is defined by a JavaScript function that is called from an onclick event. By the time that event happens, the page has already been served and the PHP is done executing. If you want the JavaScript to tell the PHP that a variable is defined, you would need to do it through an AJAX request, which I believe is beyond the scope of this question.


Does JavaScript interact with PHP?

Yes, JavaScript and PHP can interact with each other in web development. JavaScript is a client-side scripting language that runs in a user's browser, while PHP is a server-side language that runs on the server. The two languages can communicate with each other through the use of AJAX (Asynchronous JavaScript and XML) requests. JavaScript can make an AJAX request to a PHP script on the server, and the PHP script can process the request and return data back to the JavaScript code. This allows for dynamic, interactive web pages that can update their content without requiring a full page refresh. Overall, JavaScript and PHP are complementary technologies that can work together to create powerful web applications


How do you add code for printing document in php code?

You cannot call the print function from within PHP code. This is mainly because the PHP code is run server-side, and the printer is firmly part of the client's individual setup. That said, you can use JavaScript to politely ask the browser to print the document. The call will cause the browser to bring up its default print dialog. The specific JavaScript method you're after is window.print();


What are the similarities between PHP and JavaScript?

there are not many similarities, except the if and else statements, loops, etc... but PHP talks to the server, JavaScript can't. That's why both languages have totally different functions. If you only use basic JavaScript, PHP doesn't differ too much.


How can you pass a JavaScript value into a PHP file?

JavaScript lives in the browser, PHP lives on the server.To pass a value from JavaScript to a PHP page, you can eitherdo an HTML form submituse AJAXIn both cases, the value is sent to the server and you write your PHP to handle it and send a response.The important thing is that the JavaScript value won't be available in PHP when you first generate the page, creating the page and handling the value submitted from the browser are two distinct steps.


How do you create a text editor in PHP?

Well it got nothing to do with PHP, you going to need JavaScript to do that :)


What programming language is used for webOS applications?

HTML5, JavaScript, CSS


How do you use the JavaScript confirm function in PHP?

It has to be done with Javascript. Though you could do something like this:


What is difference between java Front end developer and Back End developer?

An example of a back-end language is PHP, which is a scripting language. When a PHP page is requested, the server reads any PHP code and renders the markup. The result is HTML that is sent to you. You, the web page viewer, never see one line of PHP code. Assuming that the web server administrator has done his or her job correctly, the server would and could never show you the actual PHP code. It is parsed when the page is served up and the result of that code are turned into HTML.Front End Programming LanguagesJavaScript is probably the most commonly used front-end web development language. It is a scripting language and unless you explicitly have JavaScript disabled in your browser, you see and interact with JavaScript every day. When you request a web page, the JavaScript is either in the page, or is downloaded in a separate file. JavaScript runs in your browser. Most associate JavaScript with the annoying pop-up ads that we all find very annoying. This was true in the past, but today, JavaScript plays an integral part in creating rich user experiences.