Chrisj
Members-
Posts
551 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Chrisj
-
Can you please tell me what each of these lines means?
Chrisj replied to Chrisj's topic in PHP Coding Help
Thanks for all of your help and for your insight. I think I've got it now. Much thanks again -
Can you please tell me what each of these lines means?
Chrisj replied to Chrisj's topic in PHP Coding Help
Trying again: <?php include_once ('classes/config.php'); include_once ('classes/sessions.php'); include 'uploader_conlib.php'; $config['notification_error'] = $lang_error; $page_title = $lang_upload_video; if ($_SESSION['user_id'] == "") { header("Location: " . "$base_url/login.php"); die(); } $load_javascript = 1; $ahah = 1; $thickbox = 1; /////////////////////////////////////////////////////////////////////////////////////// // ADDED SPAMMER UPLOAD TRACKING LOGING // $member_uploading = $_SESSION['user_name']; $tracking_log_file = 'logs/uploader_log.txt'; $admin_email = $config['admin_notify_email']; $user_ip = mysql_escape_string($_SERVER['REMOTE_ADDR']); $referer = mysql_real_escape_string($_SERVER['HTTP_REFERER']); if ( $referer == '' ) die_spammer_alerts(); if ( !ereg ($_SERVER['SERVER_NAME'], $referer) ) die_spammer_alerts(); /////////////////////////////////////////////////////////////////////////////////////// //echo $debugmodex; //get channel data, create "select" form fields to load into form $sql = "SELECT channel_id, channel_name FROM channels"; $result1 = @mysql_query($sql); $count_cats = @mysql_num_rows($result1); $fields_all = ''; $sub_fields_all = ''; $show_fields = ''; $fields_all .= '<option value="99999">Select One</option>'; while ($result = @mysql_fetch_array($result1)) { $fields_all .= '<option value="'.$result['channel_id'].'">'.$result['channel_name'].'</option>'; } $sub_cat_choice = (int) mysql_real_escape_string( $_GET['sub_cat'] ); if ( $sub_cat_choice ) { if ( $sub_cat_choice == '99999' ) { $sub_fields_all .= '<select class="image_form" style="width:160px;" size="1" name="sub_cat">'; $sub_fields_all .= '<option value="99999">'.$lang_no_sub_categories.'</option>'; $sub_fields_all .= '</select> ('.$lang_select.')'; echo $sub_fields_all; die(); } else { $sql2 = "SELECT * from sub_channels WHERE parent_channel_id = $sub_cat_choice"; $query = @mysql_query($sql2); $sub_fields_all .= '<select class="image_form" style="width:160px;" size="1" name="sub_cat">'; while ($result2 = @mysql_fetch_array($query)) { $count_subs = @mysql_num_rows($query); $sub_fields_all .= '<option value="'.$result2['sub_channel_id'].'">'.$result2['sub_channel_name'].'</option>'; } if ( $count_subs == '' ) { $sub_fields_all .= '<option value="99999">'.$lang_no_sub_categories.'</option>'; } $sub_fields_all .= '</select> ('.$lang_select.')'; echo $sub_fields_all; die(); } } // grab values from form if any $form_submitted = $_POST['form_submitted']; $title = $_POST['title']; $description = $_POST['description']; $tags = $_POST['tags']; $thumbnail = $_POST['thumbnail']; $location_recorded = $_POST['location_recorded']; $allow_comments = $_POST['allow_comments']; $allow_embedding = $_POST['allow_embedding']; $public_private = $_POST['public_private']; $channel = $_POST['channel']; $sub_cat = $_POST['sub_cat']; $procede = true; /////////////////////////////////////// ///////////////////////////////////////// $allowedExts = array("gif", "jpeg", "jpg", "pdf", "png"); $temp = explode(".", $_FILES["file"]["name"]); $extension = strtolower( end($temp) ); // ADD CHECK FOR VALID FILE if (!in_array($extension,$allowedExts)) { echo ("Error - Invalid File Name"); //exit(); // or do whatever else you want here } $length = 20; $newfilename = $_SESSION['user_id'].$_FILES["file"]["name"]; // $thumbnail = $newfilename; // move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $thumbnail); // $sql = "INSERT INTO videos ( filename ) VALUES( '$thumbnail' )"; // mysql_query($sql); $file_location = '<a href="http://www.--.com/upload/' . $thumbnail . '">' . $thumbnail . '</a>'; /////////////////////////////////////// ///////////////////////////////////////// $row = mysql_query("SELECT channel_name FROM channels WHERE channel_id = '$channel'"); while( $result = mysql_fetch_assoc($row) ) $channel_name = $result['channel_name']; // validate form if ($form_submitted == 'yes') { if ($_SESSION['user_id'] == '') die(); $post_vid_upload_token = mysql_real_escape_string( $_POST['vid_upload_token'] ); if ( $post_vid_upload_token != $_SESSION['vid_upload_token'] ) die(); foreach ($_POST as $key => $value) { if ($key == 'title' || $key == 'description' || $key == 'tags' || $key == '$channel') { if (!isset($value) || ($value == '')) { $display_key = @str_replace('_', ' ', $key); $error_message = $config['notification_error']; $blk_notification = 1; $error_message = $error_message . " - " . $display_key . " - $lang_required "; $procede = false; } } } if ( $channel == '99999' ) { $error_message = $config['notification_error']; $blk_notification = 1; $error_message = $error_message . " - $lang_select_channel"; $procede = false; } } else { $procede = false; } // display page with form error if ($procede == false && $form_submitted == 'yes') { $template = "themes/$user_theme/templates/main_1.htm"; $inner_template1 = "themes/$user_theme/templates/inner_upload_video_form.htm"; $TBS = new clsTinyButStrong; $TBS->NoErr = true; $TBS->LoadTemplate("$template"); $TBS->Render = TBS_OUTPUT; $TBS->Show(); @mysql_close(); die(); } // disply clean page if (!isset($form_submitted) || ($form_submitted == "")) { $template = "themes/$user_theme/templates/main_1.htm"; $inner_template1 = "themes/$user_theme/templates/inner_upload_video_form.htm"; $TBS = new clsTinyButStrong; $TBS->NoErr = true; $TBS->LoadTemplate("$template"); $TBS->Render = TBS_OUTPUT; $TBS->Show(); @mysql_close(); die(); } if ($procede == true && $form_submitted == 'yes') { if ($_SESSION['user_id'] == "") die(); //=================================START OF UPLOAD================================= $THIS_VERSION = '2.0'; if (isset($_GET['cmd']) && $_GET['cmd'] == 'about') { kak("<u><b>UBER UPLOADER FILE UPLOAD</b></u><br>UBER UPLOADER VERSION = <b>" . $UBER_VERSION . "</b><br>UU_FILE_UPLOAD = <b>" . $THIS_VERSION . "<b><br>\n"); } $tmp_sid = md5(uniqid(mt_rand(), true)); /////////////////////////////////////////////////////////////////////// // This is where you might set your config file eg. // // if($_SESSION['user'] == "tom"){ $config_file = 'uu_tom_config'; } // /////////////////////////////////////////////////////////////////////// $config_file = $default_config_file; $path_to_upload_script .= '?tmp_sid=' . $tmp_sid; $path_to_ini_status_script .= '?tmp_sid=' . $tmp_sid; if ($MULTI_CONFIGS_ENABLED) { $path_to_upload_script .= "&config_file=$config_file"; $path_to_ini_status_script .= "&config_file=$config_file"; } //allow form to be refilled on error foreach($_POST as $key=>$value) { $$key = $value; } $template = "themes/$user_theme/templates/main_1.htm"; $inner_template1 = "themes/$user_theme/templates/inner_upload_video.htm"; $TBS = new clsTinyButStrong; $TBS->NoErr = true;// no more error message displayed. $TBS->LoadTemplate("$template"); $TBS->Render = TBS_OUTPUT; $TBS->Show(); @mysql_close(); die(); //===============================================================END OF UPLOADER================================================================ } function die_spammer_alerts() { global $member_uploading, $user_ip, $admin_email, $site_name; $subject = 'Possible Video Spamming !!'; $message = "The following member uploaded a possible spam video: => " . $member_uploading . "\n\n" . "The IP used: " . $user_ip . "\n"; $to = $admin_email; $from = $site_name; mail($to, $subject, $message, "From: $from"); // if config auto ban spammer is true - enter user name and ip to ban table /* include_once ('classes/config.php'); $sql = "DELETE FROM videos WHERE video_id = '$raw_video'"; $query = @mysql_query($sql); */ write_log($message); } function write_log($message) { global $tracking_log_file; if (@file_exists($tracking_log_file)) { $fo = @fopen($tracking_log_file, 'a'); @fwrite($fo, $message); @fclose($fo); } else { $fo = @fopen($tracking_log_file, 'w'); @fwrite($fo, $message); @fclose($fo); } exit(); } ?> -
Can you please tell me what each of these lines means?
Chrisj replied to Chrisj's topic in PHP Coding Help
Thanks for your reply. I believe this is what you're asking for - see attached file -
Can you please tell me what each of these lines means?
Chrisj replied to Chrisj's topic in PHP Coding Help
Thanks ginerjm for that. Much appreciated. Very helpful. Another question, please; Currently, the user id populates the Thumbnail field, of the Upload Form, upon the Form page opening. And after Submit, the (uploaded) file name is added to the user_id, in that field. How can I change it so the user_id doesn't populate the Thumbnail field upon opening the Form page, but is added to the (uploaded) file name, after Submit? Any help will be appreciated -
Can you please tell me what each of these lines means?
Chrisj replied to Chrisj's topic in PHP Coding Help
Thank you. Can you please tell me something about how $thumbnail? -
Can you please tell me what each of these lines means?
Chrisj replied to Chrisj's topic in PHP Coding Help
Thanks for your reply, but I don't understand what you're saying -
Can you please tell me what each of these lines means?
Chrisj replied to Chrisj's topic in PHP Coding Help
Thanks for the replies. Yes, how can I fix the extra extension please? Regarding "which line", can you please explain what this code is doing with $thumbnail and $newfilename? -
Can you please tell me what each of these lines of code means? $allowedExts = array("gif", "jpeg", "jpg", "png"); $temp = explode(".", $_FILES["file"]["name"]); $extension = strtolower( end($temp) ); $length = 20; $newfilename = $_SESSION['user_id'].$_FILES["file"]["name"]; $thumbnail = $newfilename . "." . $extension; move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $thumbnail); $sql = "INSERT INTO videos ( filename ) VALUES( $thumbnail )"; mysql_query($sql); $file_location = '<a href="http://www.--.com/upload/' . $thumbnail . '">' . $thumbnail . '</a>'; $description = $description . " \n " . $newfilename;
-
In an Upload Form that I'm using, it has this line: $newfilename = $SESSION['userid'].$_FILES["file"]["name"]; I need to "store the newfilename in a session variable" (in another php file) and use the session variable in this link, instead of newfilename: <a href="upload/<?php echo $newfilename?>"><?php echo $newfilename?></a> So, would this be correct? $newfilename = $_SESSION['newfilename'].$_FILES["newfilename"];
-
This change now gets the image uploaded, however this code takes me to the next page. I'd like to figure out how to stay on the same page after upload. Any help will be appreciated. <form enctype="multipart/form-data" action="" method="POST"> <input type="file" name="file" id="file"> <input class="upload-input" type="hidden" name="form_submitted" value="yes" /> <input type="submit" value="submit" /> </form>
-
I don't know why this image upload code isn't uploading the image file to the uploads/ folder. Any help will be appreciated. $allowedExts = array("gif", "jpeg", "jpg", "png"); $temp = explode(".", $_FILES["file"]["name"]); $extension = strtolower( end($temp) ); if ( $_FILES["file"]["size"] < 2000000 && in_array($extension, $allowedExts) ) { if ($_FILES["file"]["error"]!= 0) { echo "Return Code: " . $_FILES["file"]["error"] . "<br>"; } else { $length = 20; $randomString = substr(str_shuffle(md5(time())),0,$length); $newfilename = $randomString . "." . $extension; move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $newfilename ); $file_location = '<a href="http://www.--.com/upload/' . $newfilename . '">http://www.--.com/upload/' . $newfilename . '</a>'; } } else { echo "Invalid upload file"; } <form enctype="multipart/form-data" action="uploader.php"> <input type="file" name="file" id="file"> <input type="submit" name="submitted" value="Submit"> </form>
-
Help making the uploaded image-path be displayed on the page
Chrisj replied to Chrisj's topic in PHP Coding Help
Thanks -
Help making the uploaded image-path be displayed on the page
Chrisj replied to Chrisj's topic in PHP Coding Help
Thanks for that, however this code (below) doesn't successfully display the path of the chosen file, on the html page, like so: ../upload/test.png Any help/improvements will be appreciated. <html> <head> <title>PHP Test</title> </head> <body> <?php if ($form_submitted == 'yes') { $allowedExts = array("gif", "jpeg", "jpg", "png"); $temp = explode(".", $_FILES["file"]["name"]); $extension = strtolower( end($temp) ); $newfilename = md5($_FILES['tmp']['name'] . time()) . '.' . $extension; if ( $_FILES["file"]["size"] < 200000 && in_array($extension, $allowedExts) ) { if ($_FILES["file"]["error"]!= 0) { echo "Return Code: " . $_FILES["file"]["error"] . "<br>"; } else { $length = 20; move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $newfilename ); $file_location = '<a href="http://www.--.com/upload/' . $newfilename . '">' . $newfilename . '</a>'; } } else { echo "Invalid upload file"; } $description = $description . "\n http://www.--.com/upload/" . $newfilename; } ?> <label for="file">Filename:</label> <input type="file" name="file" id="file"> </body> </html> -
Help making the uploaded image-path be displayed on the page
Chrisj replied to Chrisj's topic in PHP Coding Help
Thanks for your reply. Much appreciated. Can you give me an example of how I can define $newfilename, please? -
I need help making the uploaded image file name, that's chosen to be uploaded, be displayed on the html page with the path /upload/ added to the beginning of the displayed file name like so: ../upload/test.png Any help/improvements will be appreciated. <html> <head> <title>PHP Test</title> </head> <body> <?php if ($form_submitted == 'yes') { $allowedExts = array("gif", "jpeg", "jpg", "png"); $temp = explode(".", $_FILES["file"]["name"]); $extension = strtolower( end($temp) ); if ( $_FILES["file"]["size"] < 200000 && in_array($extension, $allowedExts) ) { if ($_FILES["file"]["error"]!= 0) { echo "Return Code: " . $_FILES["file"]["error"] . "<br>"; } else { $length = 20; move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $newfilename ); $file_location = '<a href="http://../upload/' . $newfilename . '">' . $newfilename . '</a>'; } } else { echo "Invalid upload file"; } ?> <label for="file">Filename:</label> <input type="file" name="file" id="file"> </body> </html>
-
I've added this code (below) to a file called uploader.php (attached). When I simply open the corresponding html page, I see "Invalid upload file" in the top left corner of the page. When I remove this code from uploader.php the "Invalid upload file" disappears. Any ideas on how to resolve this will be appreciated. $allowedExts = array("gif", "jpeg", "jpg", "png"); $temp = explode(".", $_FILES["file"]["name"]); $extension = strtolower( end($temp) ); // in case user named file ".JPG" etc.!!! if ( $_FILES["file"]["size"] < 200000 && in_array($extension, $allowedExts) ) { if ($_FILES["file"]["error"] > 0) { echo "Return Code: " . $_FILES["file"]["error"] . "<br>"; } else { $length = 20; $randomString = substr(str_shuffle(md5(time())),0,$length); $newfilename = $randomString . "." . $extension; move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $newfilename); $file_location = '<a href="http://www.-----.com/upload/' . $newfilename . '">' . $newfilename . '</a>'; } } else { echo "Invalid upload file"; } $description = $description . " \n " . $newfilename;
-
How to make the Log-In Form disappear after succeeding
Chrisj replied to Chrisj's topic in PHP Coding Help
Thanks for your reply, but I'm sorry I don't know how/where I can use that. -
How to make the Log-In Form disappear after succeeding
Chrisj replied to Chrisj's topic in PHP Coding Help
Thanks for your reply. The re-direct now goes to index.php, thanks. However, the Login Form (and sub menu) still reappears on the home page once it succeeds. Any help I can get to have the log-in form disappear and only reappear upon log out, will be appreciated. -
How to make the Log-In Form disappear after succeeding
Chrisj replied to Chrisj's topic in PHP Coding Help
thanks for your reply. I plugged in your code that you "switched around a little" and after logging in I was re-directed to the /myaccount.php page. Although i appreciate your help, that isn't what i was hoping for. The code that shows in my initial post, logs-in successfully (from the home page) and then shows the sub-menu things on the home page. (But it also shows the log-in Form still on the homepage). I'd like to stay on the home page (with the sub menu stuff)and not be re-directed (but just have the log-in form disappear after succeeding). Any additional help will be appreciated. -
When I asked how to make this Log In Form disappear once it performs it's function: <form action="../login.php" method="post" accept-charset="UTF-8" class="middletext" onsubmit="javascript:this.style.display='none';"> <p> <input type="text" size="20" name="user_name_login" id="user_name_login" value="ENTER USERNAME" style="color:#D9D9D9" style="vertical-align:middle"; onfocus="if (this.value=='ENTER USERNAME') {this.value=''; this.style.color='#696969';}" > <input type="text" size="20" name="password_login" id="password_login" value="ENTER PASSWORD" style="color:#D9D9D9" style="vertical-align:middle"; onfocus="if (this.value=='ENTER PASSWORD') {this.value=''; this.style.color='#696969';}" > <input type="hidden" name="cookie_time" value="10080" /> <img src="../themes/default/images/arrow-red.png" alt="" /><input type="submit" style="outline:grey" font-size="5px" value="[var.lang_login_now]" class="button-form2" /> <input type="hidden" name="submitted" value="yes" /> <input type="hidden" name="remember_me" value="remember_me" /> </p> </form> </div> <!--Begin Sub-Navigation. This only appears when a user is logged in.--> <div class="container1"> <div class="menu1"> <div class="sub-nav"><a href="../index.php"></a> <img src="../themes/default/images/arrow-red.jpg" style="vertical-align:middle" alt="" /><a href="../members/[var.user_name]"> my account</a><img src="../themes/default/images/arrow- red.jpg" style="vertical-align:middle" alt="" /> <a href="../credits.php">[var.lang_my_credits]: [var.member_credits]</font></a><img src="../themes/default/images/arrow-red.jpg" style="vertical-align:middle"><a href="../logout.php">[var.login_out]</a> <!--[onload;block=div;when [var.loggedin]=1;comm]--> </div> I was given this line of code: if($_SESSION['loggedin'] == true){ //dont show form } else { //show form } But I don't know how/where to integrate it into the Form. Any help will be appreciated.
-
I'm using an Upload Script, and I've been working on trying to style the 'Choose File Button' (input file button) which was a challenge to be styled for multiple browsers, but finally works with Google, IE and FF. However, now that I've successfully styled the input file button, when a file is now chosen, the chosen file name no longer appears, prior to Submit. I've attached an image of the code changes I made, plus some CSS styling, and this addition: label input[type="file"] { position: fixed; top: -1000px; Any suggestions/ideas/remedy on how to get the chosen file to show (or something to show an action has taken place) will be appreciated
-
This Upload Form works well in Google, but not IE or FF
Chrisj replied to Chrisj's topic in PHP Coding Help
Thanks for your reply. I tried to quickly shorten the list of file formats, when copying it here, just so there would be less to read in this posting. So, that last quote issue, isn't in the actual code. And I was aware of the header in two places. Which I've corrected. Not sure about your MySQL comment. Would that affect the browser issue? Here's the revised code with no "last quote" and only one "header". Any additional help will be greatly appreciated. <?php session_start(); require_once 'phps3integration_lib.php'; $message = ""; if (@$_POST['submit'] != "") { $allowed_ext = array("gif", "jpeg", "jpg", "png", "pdf", "doc", "docs", "zip" , "mov", "flv", "mp4", "3gp"); $extension = end(explode(".", $_FILES["fileBrowser"]["name"])); if (($_FILES["fileBrowser"]["size"] < 10485760) && in_array($extension, $allowed_ext)) { if ($_FILES["fileBrowser"]["error"] > 0) { //$message.="There is some error in upload, see: " . $_FILES["fileBrowser"]["error"] . "<br>";//Enable this to see actual error $message.="There is some error in upload. Please try after some time."; } else { $uploaded_file = uploaded_file_to_s3($_FILES["fileBrowser"], "uploads", true); if ($uploaded_file != FALSE) { $user_name = @$_POST['user_name'] != "" ? @$_POST['user_name'] : "Anonymous"; $form_data = array( 'file' => $uploaded_file, 'user_name' => $user_name, 'type' => 'file' ); mysql_query("INSERT INTO `phps3files` (`id`, `file`, `user_name`, `type`) VALUES (NULL, '" . $uploaded_file . "', '" . $user_name . "', 'file')") or die(mysql_error()); $message.= "File Successfully Uploaded."; } else { $message.="There is some error in upload. Please try after some time."; } } } else { $message.= "Upload Unsuccessful. Please Contact Administrator"; } } ?> <html> <head><br /><br /><br /> <font size="6" color="#c53800"><b>Upload:</b></font><br /><br /> </head> <style> button { background: #bi4e4e; color: red; } </style> <body> <?php require_once 'header.php'; ?> <!--<fieldset>--> <form action="upload_file.php" method="post" enctype="multipart/form-data"> <div class="control-group"> <label for="file" class="control-label"><font size="6" color="#454545"><b>Choose a file to upload:</b></font></label> <button type="button" onclick="getFilePathFromDialog();">ChooseFile</button> <input type="text" id="filePath" name="filePath"/><br /> <input type="file" id="fileBrowser" name="fileBrowser"style="visibility:hidden; display:none;" /> <?php //echo form_error('file'); ?> </div> <script> function getFilePathFromDialog() { document.getElementById('fileBrowser').click(); document.getElementById('filePath').value = document.getElementById('fileBrowser').value; } </script> </html> <div class="control-group"> <label></label> <div class='controls'> <input type="image" src="/images/upload.png" name="submit" value="Upload"> </div> </div> </form> <?php if ($message != "" || @$_SESSION['message'] != "") { ?> <div class="alert alert-success"> <?php echo $message; ?> <?php echo @$_SESSION['message']; @$_SESSION['message'] = ''; ?> </div> <?php } ?> <div> </div> <?php require_once 'footer.php'; ?> -
The upload script I'm using performs successfully in Google, but not in IE or FF. In Google, it doesn't fill the box with the path(see image), but it shows a message of successful upload. In IE, it fills the box with the path, but the path begins with C:\fakepath\... and doesn't upload or show unsuccessful upload message. In FF, my computer shows something's uploading, but it doesn't appear in AmazonS3 nor does it fill the box, or show any message. I'm not interested in starting over with a different script, I'd just like to get some suggestions/ideas/remedy for this one, please. Thanks for any help <?php session_start(); require_once 'phps3integration_lib.php'; $message = ""; if (@$_POST['submit'] != "") { $allowed_ext = array("gif", "jpeg", "jpg", "png", "pdf", "doc", "docs", "zip" , "mov", "flv", "mp4", "3gp", "); $extension = end(explode(".", $_FILES["fileBrowser"]["name"])); if (($_FILES["fileBrowser"]["size"] < 10485760) && in_array($extension, $allowed_ext)) { if ($_FILES["fileBrowser"]["error"] > 0) { //$message.="There is some error in upload, see: " . $_FILES["fileBrowser"]["error"] . "<br>";//Enable this to see actual error $message.="There is some error in upload. Please try after some time."; } else { $uploaded_file = uploaded_file_to_s3($_FILES["fileBrowser"], "uploads", true); if ($uploaded_file != FALSE) { $user_name = @$_POST['user_name'] != "" ? @$_POST['user_name'] : "Anonymous"; $form_data = array( 'file' => $uploaded_file, 'user_name' => $user_name, 'type' => 'file' ); mysql_query("INSERT INTO `phps3files` (`id`, `file`, `user_name`, `type`) VALUES (NULL, '" . $uploaded_file . "', '" . $user_name . "', 'file')") or die(mysql_error()); $message.= "File Successfully Uploaded."; } else { $message.="There is some error in upload. Please try after some time."; } } } else { $message.= "Upload Unsuccessful. Please Contact Administrator"; } } ?> <?php require_once 'header.php'; ?> <html> <head><br /><br /><br /> <font size="6" color="#c53800"><b>Upload:</b></font><br /><br /> </head> <style> button { background: #bi4e4e; color: red; } </style> <body> <?php require_once 'header.php'; ?> <!--<fieldset>--> <form action="upload_file.php" method="post" enctype="multipart/form-data"> <div class="control-group"> <label for="file" class="control-label"><font size="6" color="#454545"><b>Choose a file to upload:</b></font></label> <button type="button" onclick="getFilePathFromDialog();">ChooseFile</button> <input type="text" id="filePath" name="filePath"/><br /> <input type="file" id="fileBrowser" name="fileBrowser"style="visibility:hidden; display:none;" /> <?php //echo form_error('file'); ?> </div> <script> function getFilePathFromDialog() { document.getElementById('fileBrowser').click(); document.getElementById('filePath').value = document.getElementById('fileBrowser').value; } </script> </html> <div class="control-group"> <label></label> <div class='controls'> <input type="image" src="/images/upload.png" name="submit" value="Upload"> </div> </div> </form> <?php if ($message != "" || @$_SESSION['message'] != "") { ?> <div class="alert alert-success"> <?php echo $message; ?> <?php echo @$_SESSION['message']; @$_SESSION['message'] = ''; ?> </div> <?php } ?> <div> </div> <?php require_once 'footer.php'; ?>
-
Thank you for your reply. Do I have to name your code something in CSS?