i need add a file uploader section. does anyone know how to do this. I need my client to be able to upload their art work.
i need add a file uploader section. does anyone know how to do this. I need my client to be able to upload their art work.
File uploads are already integrated into zencart
i.e.
http://www.zen-cart.com/forum/showth...hlight=uploads
Hi, I am looking for the correct code to execute the following pseudocode:
If [Customer Logged In] then
<Display File Upload Form>
Else
<echo 'You must log in first to upload files to us'>
<echo 'Please log in or register for a new account'>
End if
I can fill in the code for the form, but if someone can help me with the conditional if statement in PHP I would appreciate it.
Second part:
In the PHP I want to write the entries in the form for which I will execute the "POST_" statement. How do I query the database since the customer is already logged in? Sample statement would be helpful. Basically what I want to do is post name of file, file size, file description, customer ID, date posted to a table I am going to create in the database.
I want admin notification as soon as new files are uploaded, so how would I execute a sendmail to notify me with information as shown above?
Doug Mewis
https://cheyennestbaldricks.com
The value for:
$_SESSION['customer_id']
will be greater than 0 ...
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
Now where do I get the example of how to use that?
Looking for a more complete answer. Trying to figure out how to get it to work on define_page_7.php edited through Notepad++. Don't mean to say that I don't appreciate that, but I keep getting incomplete answers and can't find it in the manual I purchased.
Basically, my project is an upload page that you have to be logged in to see.
Doug Mewis
https://cheyennestbaldricks.com
I am not sure what all you need for what you are doing, but the basic format of the IF would be:
Code:if ($_SESSION['customer_id'] == 0) { // login stuff here } else { // do something here }
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
What I am trying to do, is implement my Page_7 as a file uploader where:
If customer is logged in then:
DISPLAY UPLOADER FORM HTML
Else
ECHO "You must be logged in to upload files."
Endif
Still having a hard time figuring out the syntax when you have mixed PHP and XHTML script going.
Doug Mewis
https://cheyennestbaldricks.com
There is a better way ...
If you add to your header_php.php file for the:
/includes/modules/pages/page_7.php
It will force the customer to be logged in or take them to the login pages and then return to page_7 when done ...Code:if (!$_SESSION['customer_id']) { $_SESSION['navigation']->set_snapshot(); zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL')); }
Look at how the:
/includes/modules/pages/account/header_php.php
is doing this, as an example, and how it behaves when logged in or not ...
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
This works. Now, I can't figure out the form action parameter. Below is the line of code I am referring to. How do I get it to refer to the current page without running into the permissions error?
Code:<form action="/define_page_7.php" enctype="multipart/form-data" id="upload" method="post">
Doug Mewis
https://cheyennestbaldricks.com