•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 426,810 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,924 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 530 | Replies: 5 | Solved
![]() |
•
•
Join Date: Jun 2008
Posts: 7
Reputation:
Rep Power: 0
Solved Threads: 0
Hi all!
I have a script with a form with:
action="loadPhoto.php"
enctype = "multipart/form-data"
method="POST"
an input type=file and a submit button.
So when you click submit the php-script checks that the choosen file is a image-file and that the size isn't to big and saves it to server.
When you press the submit button, the file is uploaded, I get directed to the php-page and I redirect back to the origin page where the image is displayed.
How can I do this dynamicly??
I want to press the submit button and not get redirected to the php-page.
I just dunamicly want to "wait" on the "submit"-page and show something like "loading...", and when it is loaded, render it on screen again. All this without redirection.
Please help me!!
Marcux
I have a script with a form with:
action="loadPhoto.php"
enctype = "multipart/form-data"
method="POST"
an input type=file and a submit button.
So when you click submit the php-script checks that the choosen file is a image-file and that the size isn't to big and saves it to server.
When you press the submit button, the file is uploaded, I get directed to the php-page and I redirect back to the origin page where the image is displayed.
How can I do this dynamicly??
I want to press the submit button and not get redirected to the php-page.
I just dunamicly want to "wait" on the "submit"-page and show something like "loading...", and when it is loaded, render it on screen again. All this without redirection.
Please help me!!
Marcux
You could do this a number of ways. The easiest, in my opinion would be Flash.
However, if Flash isn't an option, JDOMP or AJAX will do it. Both of these will require some understanding of JavaScript and the DOM. In all three however, the same basic steps occur. Variables are sent to the php script and the output of the php script is sent back as a response. The url never changes.
However, if Flash isn't an option, JDOMP or AJAX will do it. Both of these will require some understanding of JavaScript and the DOM. In all three however, the same basic steps occur. Variables are sent to the php script and the output of the php script is sent back as a response. The url never changes.
•
•
Join Date: Jun 2008
Posts: 7
Reputation:
Rep Power: 0
Solved Threads: 0
Thanks buddylee17 that was exactly what I was after.
I realy liked JDOMP it seems like a realy good way to do it.
One thing I can't see clear is when I look at the code is when I send my var to the php-script like: "...myscript.php?myvar=value"
In php: How do I get hold of myvar??
$_GET['myvar'] or is it $_POST['myvar']
Many thanks
I realy liked JDOMP it seems like a realy good way to do it.
One thing I can't see clear is when I look at the code is when I send my var to the php-script like: "...myscript.php?myvar=value"
In php: How do I get hold of myvar??
$_GET['myvar'] or is it $_POST['myvar']
Many thanks
•
•
Join Date: Jun 2008
Posts: 7
Reputation:
Rep Power: 0
Solved Threads: 0
Thanks again!
The exaples you showed in your JDOMP does these url:s show up in the webbrowser?
If they are how do I make it a "POST", cos' then you will not get the url in the browser if I'm not wrong, right?
Second of all, isn't there a limit on length in the "GET" method, and not a limit in the "POST" method?
The exaples you showed in your JDOMP does these url:s show up in the webbrowser?
If they are how do I make it a "POST", cos' then you will not get the url in the browser if I'm not wrong, right?
Second of all, isn't there a limit on length in the "GET" method, and not a limit in the "POST" method?
![]() |
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Previous Thread: Random Testimonial Generator
- Next Thread: googlemaps - problem adding geocoding searchbox


Linear Mode