Page 1 of 1

Help needed in forms submission

Posted: Thu Jul 14, 2005 8:56 pm
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.

Posted: Thu Jul 14, 2005 9:13 pm
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';
}
?>

Posted: Thu Jul 14, 2005 9:18 pm
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.

Posted: Thu Jul 14, 2005 10:27 pm
by dakkonz
oscar : I inserted the code into the start of Y.php but then nothing is displayed until the file transfer is done.

Posted: Fri Jul 15, 2005 12:27 am
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.