Forums

File upload - error message - exit; code

H13 30 May, 2008
Hi, is there another possibility how to show the error message after uploading file (e.g. file is to small). After this message I get blank page (caused by the exit in the code)...

Thank you, Jan
GreyHead 30 May, 2008
Hi Jan,

There should be an error message displayed. See line 245 of chronocontact.php

I suspect that the showErrorMessage function hasn't been updated for Joomal 1.5. I'll take a look tomorrow.

Bob
H13 30 May, 2008
Hi, the error is displayed in popup box (it is ok), but after clicking popup box ok, I get the blank page (because of exit), so I added before exit:

$mainframe->redirect(' ... form page ... ', ' ... error message ... ' )

so it works great for me now...

thank you for the reply...

Jan
GreyHead 30 May, 2008
Hi Jan,

For Joomla 1.5 it might be better to use something like
$mainframe->enqueueMessage( $message, 'error' );
showForm($_POST);
The showform() function is used for the Validation error return but not the Form uploads.

I'll pass the message on to Max.

Bob
H13 01 Jun, 2008
Hi, yes... I use this:


$mainframe->redirect(' ... form page ... ', ' ... error message ... ' )

because of going back to ChronoForms PLUGIN...(and it works for me)

Jan
GreyHead 02 Jun, 2008
Hi Jan,

That makes sense, I hadn't realised that you are using the PlugIn.

Bob
H13 02 Jun, 2008
:-), sorry for not complete information, sometimes the most important information stays in brain only and will be not written into the forum ...
Grizzled 04 Jun, 2008
Hi Jan & Bob,

Can you tell me exactly what line you put the code for plugin redirect?

Thanks, Chuck
H13 04 Jun, 2008
file: chronocontact.php
rows: 245 +
after error message and before exit:
$errorMsg = 'some error ...';
$mainframe->redirect($form_uri, $errorMsg);
into your form you must add the info about the form site:
hidden input with name 'form_uri' and paste there the site name

and in file:
chronocontact.php you must get this info:

rows: 190 +
if (!isset($_POST['form_uri'])) {
  $form_uri = 'index.php';
} else {
  $form_uri = $_POST['form_uri'];
}
The code is not copied from the site (I have no access for it now), so it can contain errors (;, (, ), ... )
This topic is locked and no more replies can be posted.