Help needed in forms submission

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dakkonz
Forum Commoner
Posts: 69
Joined: Sat Dec 27, 2003 2:55 am
Location: Asia

Help needed in forms submission

Post by dakkonz »

Hey guys,
I have one file say called X.php which contains a form to submit data and a file. I have another file called Y.php to process the data and the file submitted and insert them into the database. The form action in X.php will be directed to Y.php. Is there any way to have a interim page to display and show the user that uploading file is in progress? My case now is that once i click on submit it will go process Y.php and will not display anything until the whole transfer is through. I just want a page indicating that upload is in progress to inform the user.
oscar
Forum Commoner
Posts: 27
Joined: Wed Sep 24, 2003 7:27 pm
Location: sydney, Australia

Post by oscar »

the easiest way is to put it at the start of y.php... somethng like:

Code: Select all

<?
echo 'Now being processed...';

//this is where we do our adding to the db

if ($value){
    //adding to database sutff goes here
    echo 'Successfully added to the database';
}else{
    echo '$value is blank';
}
?>
p... somethng like:

Code: Select all

<?
echo 'Now being processed...';

//this is where we do our adding to the db

if ($value){
    //adding to database sutff goes here
    echo 'Successfully added to the databa]
<?
echo 'Now being processed...';

//this is where we do our adding to the db

if ($value){
    //adding to database sutff goes here
    echo 'Successfully added to the database';
}else{
    echo '$value is blank';
}
?>
/this is where we do our adding to the db

if ($value){
//adding to database sutff goes here
echo 'Successfully added to the database';
}else{
echo '$value is blank';
}
?>
processed...';

//this is where we do our adding to the db

if ($value){
//adding to database sutff goes here
echo 'Successfully added to the database';
}else{
echo '$value is blank';
}
?>
to put it at the start of y.php... somethng like:

Code: Select all

&lt;?
echo 'Now being processed...';

//this is where we do our adding to the db

if ($value){
    //adding to database sutff goes here
    echo 'Successfully added to the database';
}else{
    ec to put it at the start of y.php... somethng like:

Code: Select all

<?
echo 'Now being processed...';

//this is where we do our adding to the db

if ($value){
    //adding to database sutff goes here
    echo 'Successfully added to the database';
}else{
    echo '$value is blank';
}
?>
8]
<?
echo 'Now being processed...';

//this is where we do our adding to the db

if ($value){
//adding to database sutff goes here
echo 'Successfully added to the database';
}else{
echo '$value is blank';
}
?>
'Now being processed...';

//this is where we do our adding to the db

if ($value){
//adding to database sutff goes here
echo 'Successfully added to the database';
}else{
echo '$value is blank';
}
?&gt;
ethng like:

Code: Select all

<?
echo 'Now being processed...';

//this is where we do our adding to the db

if ($value){
    //adding to database sutff goes here
    echo 'Successfully added to the database';
}else{
    echo '$value is blank';
}
?>
ding to database sutff goes here
echo 'Successfully added to the database';
}else{
echo '$value is blank';
}
?>
the start of y.php... somethng like:

Code: Select all

<?
echo 'Now being processed...';

//this is where we do our adding to the db

if ($value){
    //adding to database sutff goes here
    echo 'Successfully added to the database';
}else{
    echo '$value is blank';
}
?>
d to the database';
}else{
echo '$value is blank';
}
?>
base sutff goes here
echo 'Successfully added to the database';
}else{
echo '$value is blank';
}
?>
{
echo '$value is blank';
}
?>
to put it at the start of y.php... somethng like:

Code: Select all

<?
echo 'Now being processed...';

//this is where we do our adding to the db

if ($value){
    //adding to database sutff goes here
    echo 'Successfully added to the database';
}else{
    echo '$value is blank';
}
?>
php... somethng like:

Code: Select all

<?
echo 'Now being processed...';

//this is where we do our adding to the db

if ($value){
    //adding to database sutff goes here
    echo 'Successfully added to the database';
}else{
    ec$value){
    //adding to database sutff goes here
    echo 'Successfully added to the database';
}else{
    echo '$value is blank';
}
?>
y.php... somethng like:

Code: Select all

<?
echo 'Now being processed...';

//this is where we do our adding to the db

if ($value){
    //adding to database sutff goes here
    echo 'Successfully added to the database';
}else{
    echo '$value is blank';
}
?>
echo 'Successfully added to the database';
}else{
echo '$value is blank';
}
?>
database sutff goes here
echo 'Successfully added to the database';
}else{
echo '$value is blank';
}
?>

echo 'Now being processed...';

//this is where we do our adding to the db

if ($value){
//adding to database sutff goes here
echo 'Successfully added to the database';
}else{
echo '$value is blank';
}
?>
he start of y.php... somethng like:

Code: Select all

<?
echo 'Now being processed...';

//this is where we do our adding to the db

if ($value){
    //adding to database sutff goes here
    echo 'Successfully added to the database';
}else{
    echo '$value is blank';
}
?>
to put it at the start of y.php... somethng like:

Code: Select all

<?
echo 'Now being processed...';

//this is where we do our adding to the db

if ($value){
    //adding to database sutff goes here
    echo 'Successfully added to the database';
 to database sutff goes here
    echo 'Successfully added to the database';
}else{
    echo '$value is blank';
}
?>

Code: Select all

<?
echo 'Now being processed...';

//this is where we do our adding to the db

if ($value){
    //adding to database sutff goes here
    echo 'Successfully added to the database';
}else{
    echo '$value is blank';
}
?>
[/php

if ($value){
    //adding to database sutff goes here
    echo 'Successfully added to the database';
}else{
    echo '$value is blank';
}
?&gt;
to put it at the start of y.php... somethng like:

Code: Select all

<?
echo 'Now being processed...';

//this is where we do our adding to the db

if ($value){
    //adding to database sutff goes here
    echo 'Successfully added to the database';
}else{
    echo '$value is blank';
}
?>
[lue){
    //adding to database sutff goes here
    echo 'Successfully added to the database';
}else{
    echo '$value is blank';
}
?>
o our adding to the db

if ($value){
//adding to database sutff goes here
echo 'Successfully added to the database';
}else{
echo '$value is blank';
}
?>
db

if ($value){
//adding to database sutff goes here
echo 'Successfully added to the database';
}else{
echo '$value is blank';
}
?>
to put it at the start of y.php... somethng like:

Code: Select all

<?
echo 'Now being processed...';

//this is where we do our adding to the db

if ($value){
    //adding to database sutff goes here
    echo 'Successfully added to the database';
}else{
    echo '$value is blank';
}
?&ampa37bcf68]
<?
echo 'Now being processed...';

//this is where we do our adding to the db

if ($value){
    //adding to database sutff goes here
    echo 'Successfully added to the database';
}else{
    echo '$value is blank';
}
?>
of y.php... somethng like:

Code: Select all

<?
echo 'Now being processed...';

//this is where we do our adding to the db

if ($value){
    //adding to database sutff goes here
    echo 'Successfully added to the database';
}else{
    echo '$value is blank';
}
?>
ing to the db

if ($value){
//adding to database sutff goes here
echo 'Successfully added to the database';
}else{
echocessed...';

//this is where we do our adding to the db

if ($value){
//adding to database sutff goes here
echo 'Successfully added to the database';
}else{
echo '$value is blank';
}
?>
php... somethng like:

Code: Select all

<?
echo 'Now being processed...';

//this is where we do our adding to the db

if ($value){
    //adding to database sutff goes here
    echo 'Successfully added to the database';
}else{
    echo '$value is blank';
}
?>
the db

if ($value){
//adding to database sutff goes here
echo 'Successfully added to the database';
}elseamp;lt;?
echo 'Now being processed...';

//this is where we do our adding to the db

if ($value){
//adding to database sutff goes here
echo 'Successfully added to the database';
}else{
echo '$value is blank';
}
?>

//this is where we do our adding to the db

if ($value){
//adding to database sutff goes here
echo 'Successfully added to the database';
}else{
echo '$value is blank';
}
?>
b

if ($value){
//adding to database sutff goes here
echo 'Successfully added to the database';
}else{
echo '$value is blank';
}
?&gt;

echo 'Now being processed...';

//this is where we do our adding to the db

if ($value){
//adding to database sutff goes here
e processed...';

//this is where we do our adding to the db

if ($value){
//adding to database sutff goes here
echo 'Successfully added to the database';
}else{
echo '$value is blank';
}
?>
]
<?
echo 'Now being processed...';

//this is where we do our adding to the db

if ($value){
//adding to database sutff goes here
echo 'Successfully added to the database';
}else{
echo '$value is blank';
}
?>
ng like:

Code: Select all

<?
echo 'Now being processed...';

//this is where we do our adding to the db

if ($value){
    //adding to database sutff goes here
    echo 'Successfully added to the database';
}else{
    echo '$value is blank';
}
?&amp?
echo 'Now being processed...';

//this is where we do our adding to the db

if ($value){
    //adding to database sutff goes here
    echo 'Successfully added to the database';
}else{
    echo '$value is blank';
}
?>
($value){
//adding to database sutff goes here
echo 'Successfully added to the database';
}else{
echo '$value is blank';
}
?>
]
<?
echo 'Now being processed...';

//this is where we do our adding to the db

if ($value){
//adding to database sutff goes here
echo 'Successfully added to the database';
}else{
echo '$value is blank';
}
?>
:

Code: Select all

<?
echo 'Now being processed...';

//this is where we do our adding to the db

if ($value){
    //adding to database sutff goes here
    echo 'Successfully added to the database';
}else{
    echo '$value is blank';
}
?>
k';
}
?>
start of y.php... somethng like:

Code: Select all

<?
echo 'Now being processed...';

//this is where we do our adding to the db

if ($value){
    //adding to database sutff goes here
    echo 'Successfully added to the database';
}else{
    echo '$value is blank';
}
?>
lly added to the database';
}else{
echo '$value is blank';
}
?>
somethng like:

Code: Select all

<?
echo 'Now being processed...';

//this is where we do our adding to the db

if ($value){
    //adding to database sutff goes here
    echo 'Successfully added to the database';
}else{
    echo '$value is blank';
}
?>
]
<?
echo 'Now being processed...';

//this is where we do our adding to the db

if ($value){
//adding to database sutff goes here
echo 'Successfully added to the database';
}else{
echo '$value is blank';
}
?>

echo 'Successfully added to the database';
}else{
echo '$value is blank';
}
?>
thng like:

Code: Select all

<?
echo 'Now being processed...';

//this is where we do our adding to the db

if ($value){
    //adding to database sutff goes here
    echo 'Successfully added to the database';
bcf68]
<?
echo 'Now being processed...';

//this is where we do our adding to the db

if ($value){
    //adding to database sutff goes here
    echo 'Successfully added to the database';
}else{
    echo '$value is blank';
}
?>
he db

if ($value){
//adding to database sutff goes here
echo 'Successfully added to the database';
}else{
echo '$value is blank';
}
?>
ur adding to the db

if ($value){
//adding to database sutff goes here
echo 'Successfully added to the database';
}else{
echo '$value is blank';
}
?>
php]e we do our adding to the db

if ($value){
//adding to database sutff goes here
echo 'Successfully added to the database';
}else{
echo '$value is blank';
}
?>

<?
echo 'Now being processed...';

//this is where we do our adding to the db

if ($value){
//adding to database sutff goes here
echo 'Successfully added to the database';
}else{
echo '$value is blank';
}
?>
dreamline
Forum Contributor
Posts: 158
Joined: Fri May 28, 2004 2:37 am

Post by dreamline »

Take a look at this: viewtopic.php?t=33880

I came with a similar question, but with a progressbar and it seems that there's only one way to go with that and that is CGI, it's the only script i found sofar that shows you a progress bar... If you are looking for a progress bar.
dakkonz
Forum Commoner
Posts: 69
Joined: Sat Dec 27, 2003 2:55 am
Location: Asia

Post by dakkonz »

oscar : I inserted the code into the start of Y.php but then nothing is displayed until the file transfer is done.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

echo something like "Your file is uploading to the server... please wait."
then take a look at the flush() function to print your message to the browser while the file is uploading.
Post Reply