Skip to content

Tag: php

PHP/JavaScript random number

I am playing around with JavaScript and trying to choose some random images. What I’m actually trying to do: I have $totalsixes = rand(1,6); in PHP, and let’s say that chose 4. Then in JavaScript I want to show 4 images with the number 6 and 2 others with random numbers from 1-5. Here’s what…

How do I refresh a DIV content?

I am trying to refresh a certain div within a bunch of divs. The div content is basically generated by PHP along with data from a MySQL database in addition to many variables being sent with the help of an XMLHttpRequest. The idea is to reload/refresh the div itself and not load a php file or to overwrite it …

Javascript image upload and display

My basic task is select image and display it,without saving it in database. For this 1.I have made a select tag in html,through which I can upload the image. 2.I have made a blank image tag in which at there is no image source,alternate is upload image. 3.select tag has onchange javascript event handler which…

Convert PHP string to javascript string [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 7 years ago. Improve this question For example, I have this php string: “2015-06-26”. I want to assign it to a java…