Jump to content

Chrisj

Members
  • Posts

    547
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Chrisj

  1. Thank you for your reply/help. Yes,I'm looking at uploader.php. Here are lines 19 thru 81 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: $login_out_link");; 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(); /////////////////////////////////////////////////////////////////////////////////////// if(isset($_SESSION['channel_id'])) { echo '<input type="hidden" name="channel" value="$_SESSION['channel_id']">'; } else { echo '<select class="upload-video-form-input" name="channel" onchange="javascript:ahahscript.ahah('[var.base_url]/uploader.php?sub_cat='+ document.form_upload.channel.value, 'sub_change', '', 'GET', '', this);"> [var.fields_all;htmlconv=no]</select>'; } Any additional help will be appreciated.
  2. Thanks you for your replies. I corrected the echo close, Much appreciated. However, I still see this error: Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/public_html/uploader.php on line 39 and line 39 is blank. Any additional help will be appreciated.
  3. Thanks for your message. "Parse error: syntax error, unexpected T_CLASS, expecting ',' or ';' in /home/public_html/uploader.php on line 48" line 48 is blank. The error only appears when I add: if(isset($_SESSION['channel_id'])) { echo '<input type="hidden" name="channel" value="1"> } else { echo '<select class="upload-video-form-input" name="channel" onchange="javascript:ahahscript.ahah('[var.base_url]/uploader.php?sub_cat='+ document.form_upload.channel.value, 'sub_change', '', 'GET', '', this);"> [var.fields_all;htmlconv=no]</select> '; } to line 83 Any additional help will be greatly appreciated.
  4. Thanks for your reply. I'm not seeing what you mean. I see: '; } isn't that correct?
  5. In a php video-web-script I'm using, in the (video)Upload Form I tried hiding the select-a-channel drop-down choices, essentially like this: <li><input type="hidden" name="channel" value="1"/></li> (so, that the Channel is pre-determined for the uploader/user). But, when the Channel is hidden like that, the next field box(sub-categories) in the Form, shows no choices. Apparently, in this Upload Form a Channel choice is required in order to see the sub-category choices. So, I'm trying to figure out a way to hide the channel, but somehow let the Form know that Channel has been chosen, so that the sub-category drop-down choices are available for choosing, and proceeding. Here's the code without the hidden Channel: <li style="width:240px; text-align:right;"><strong>[var.lang_select_channel]:</strong></li> <li style="width:400px; text-align:left;"> <select class="upload-video-form-input" style="width:160px;" size="1" name="channel" onchange="javascript:ahahscript.ahah('[var.base_url]/uploader.php?sub_cat='+ document.form_upload.channel.value, 'sub_change', '', 'GET', '', this);"> [var.fields_all;htmlconv=no]</select> ([var.lang_select_one])</li> <li style="width:240px; text-align:right"> </li> <li style="width:380px" class="font5_14"><strong>[var.lang_sub_categories]</strong></li> <li style="width:240px; text-align:right"><strong>[var.lang_sub_cat]: </strong></li> <li style="width:400px; text-align:left;" id="sub_change"><select class="upload-video-form-input" style="width:160px;" size="1" name="sub_cat"></select> ([var.lang_optional])</li> So, then I tried adding this to the uploader.php file: if(isset($_SESSION['channel_id'])) { echo '<input type="hidden" name="channel" value="1"> } else { echo '<select class="upload-video-form-input" name="channel" onchange="javascript:ahahscript.ahah('[var.base_url]/uploader.php?sub_cat='+ document.form_upload.channel.value, 'sub_change', '', 'GET', '', this);"> [var.fields_all;htmlconv=no]</select> '; } but got a syntax error. Any ideas regarding "hide the channel, but somehow let the Form know that Channel has been chosen, so that the sub-category drop-down choices are available for choosing" will be greatly appreciated.
  6. I'm trying to add a Member Credit modification to a php file, that works successfully on another site. I'm trying to figure it out as I go, When I add some of the lines of code into the search.php file I see a HTTP Error 500. But when I commented-out these lines: //CREDITS MOD //--BEGIN-- $video_price = videoPrice(); $total_price = $video_price * $total_records; $member_credits = get_member_credits($user_id); // --END-- the file proceeds successfully. So, obviously I'm missing something. Can you tell me what the function of these lines might be? And maybe what might be needed? Or tell me what these lines might mean? Any help will be appreciated.
  7. In the PHP/SQL script I'm using the search query is only done on one table at a time, currently. I'd like help creating combined search results "All" from the videos table and images table when similar "tags" are searched. Can a Union be used to display just specific, similar columns from each table? Currently, the separate 'search results' are displayed the same way. The 'image search results' display an image, title, description, in a results column on the page. The 'video search results' display a thumbnail image, title, description, in a results column on the page. I've attached a shot of the 'images' table and a shot of the 'videos' table. Any guidance will be appreciated.
  8. Thanks for your help. Much apppreciated
  9. Thanks for your reply. In the browser, it stays the same ../upload_avatar.php When I right-click the blank page to 'view source' I see this: "Confirm Form Resubmission This webpage requires data that you entered earlier in order to be properly displayed. You can send this data again, but by doing so you will repeat any action this page previously performed. Press the reload button to resubmit the data needed to load the page. ERR_CACHE_MIS" Yes, I copied the template and .php file. I know have two places in the script with this Form. The original shows the errors properly, and the new Form only shows "Request has been completed", but a blank page for wrong file size or wrong file type. So, I'm not clear on what to do next, regarding the missing relative path, or a work around. Any additional help will be appreciated.
  10. Sorry about my unintelligent reply. The failure is not showing in the log file, but I am getting admin notices by email of the failure
  11. Thanks for your reply. My answer is I don't know Can you help me determine that?
  12. In the script I'm using, I moved 'upload_avatar.php' and 'inner_upload_avatar.htm' from a Folder into the public_html and public_html/templates folder respectively. They work successfully there. The only thing I changed on 'upload_avatar.php' was this: include_once ('..classes/config.php'); include_once ('..classes/sessions.php'); to this: include_once ('classes/config.php'); include_once ('classes/sessions.php'); But, the only thing that doesn't work is the unsuccessful messages. When an image uploads successfully "Request has been completed" appears. But when I upload a non-image file type, or file too large, I see nothing. The script before I moved it shows" File dimensions error", or "File type not allowed". I'm stumped as to why those messages don't appear. I've attached upload_avatar.php. If you could help me figure out why this is the case, or suggest a simple work around, I'd greatly appreciate it. (Also, I know this code is old). Thanks. upload_avatar.php
  13. Thanks for your reply. So, it is possible. Can you please provide an example of "set some session vars and do a header to the other script"?
  14. With a basic image Upload Form, like the one in the script I'm using: <form method="POST" enctype="multipart/form-data" action="upload_avatar.php"> <input type="hidden" name="security_token" value="[var.security_token]" /> <p align="center"><font face="Arial"><input type="file" name="img_file" size="20"></font></p> <p align="center"><font face="Arial"><input type="submit" value="Submit" name="upload"> <input type="reset" value="Reset" name="B2"></font></p> </form> If I add a 'Title' field, 'Description' field/box, and when the fields are populated and the image is chosen (from the pc), and then the 'Submit' button is selected, can the image get processed by one .php file, and the 'Title', 'Description" text get processed by another .php file, from a single 'Submit' button? Is that possible?
  15. Thank you for your reply. Much appreciated. Can you please give me more of an example of what you mean? Thanks
  16. I'm using a PHP script which has this Search Form: <form method="get" action="search.php" autocomplete="off" name="form_search"> <select size="1" name="type" /> <option value="videos">[var.lang_word_videos]</option> <option value="images">[var.lang_word_images]<!--[onload;block=option;when [var.enable_images]=1;comm]--></option> </select> <input autocomplete="off" id="keyword" name="keyword" value="Search [var.site_name]" onclick="clickclear(this, 'Search [var.site_name]')" onblur="clickrecall(this,'Search [var.site_name]')" /> <input type="submit" value="Search" /> </form> How can I add an "All" option, so it can search both images and videos? Is it simply this? <option value="all">All</option> And then I would need to sync that in the search.php file? Can someone help with that part too?
  17. Thank you for your reply. I changed the duplicated lines to this: <li style="width:240px; text-align:right;"><strong>[var.lang_tags]2:</strong></li> <li style="width:400px; text-align:left;"><input name="tags2" type="text" class="upload-video-form-input" value="[var.tags]" size="38" /> Buy I can't find what is entered into Tags2 field when I search. The mysql has a column named 'tags', so do you think I'd be on the right track if I added a column named 'tags2' in that db, and then add 'tags2' to this line in the search.php file: $type_query_rows = 'indexer, video_id, title, title_seo, date_uploaded, user_id, video_length, approved, public_private, description, tags, number_of_views'; I look forward to any guidance. Much thanks
  18. I'm using the phpMotion script and trying to add a 2nd "tag" field to the Upload Video Form. (The 'tag' field is for entering tags or search words, so the video can be found when searching). <li style="width:240px; text-align:right;"><strong>[var.lang_tags]:</strong></li> <li style="width:400px; text-align:left;"><input name="tags" type="text" class="upload-video-form-input" value="[var.tags]" size="38" /> </li> I copied and duplicated that code, like so: <li style="width:240px; text-align:right;"><strong>[var.lang_tags]:</strong></li> <li style="width:400px; text-align:left;"><input name="tags" type="text" class="upload-video-form-input" value="[var.tags]" size="38" /> </li> <li style="width:240px; text-align:right;"><strong>[var.lang_tags]2:</strong></li> <li style="width:400px; text-align:left;"><input name="tags" type="text" class="upload-video-form-input" value="[var.tags]" size="38" /> </li> But upon submitting the Form, Tags2: (the duplicated line) was required to proceed, not the original Tag field. Can you tell me what else I need to do to create a second (required) Tag field?
  19. After installing a PHP script, I see this // after the domain name in browser bar, for example www.awebsite.com//index.php How can I fix this?
  20. Thanks for your reply. Is this "the list of columns"? $sql = "INSERT into member_profile (email_address, user_name, password, passwordSalt, first_name, last_name, zip_code, country, user_ip, birthday, account_status, account_type, date_created, random_code)
  21. Can you help me figure out why I'm getting this: "Column count doesn't match value count at row 1"? thanks <?php error_reporting (0); include_once ('classes/config.php'); include_once ('includes/reserved_names.php'); $user_ip = mysql_escape_string($_SERVER['REMOTE_ADDR']); if ( $enable_forum == 1 ) header("Location: " . $smf_bridge_register); $send_confirm_email = $config['enabled_features_confirmation_email'] ; // define access for loading non display php files define('access',true); $ahah = 1; $show_register = ''; $load_ajax = ''; $form_submitted = ''; $action = ''; $new_user_name = ''; $account_type = ''; $first_name = ''; $last_name = ''; $email_address = ''; $email_address2 = ''; $user_name = ''; $password = ''; $confirm_password = ''; $country_list = ''; $dob_month = ''; $dob_day = ''; $dob_year = ''; $zip_code = ''; $birthday = ''; $error_message = ''; $checked = ''; $show_register = 1; $load_ajax = 1; $procede = true; $action = mysql_real_escape_string( $_GET['action'] ); $new_user_name = mysql_real_escape_string( $_GET['new_user_name'] ); $site_name = mysql_real_escape_string($config['site_name']); $form_submitted = mysql_real_escape_string( $_POST['form_submitted'] ); $max_len_username = (int)$config['max_username_length']; if ( $action == 'check_user' ) { $new_user_name = trim(strtolower($new_user_name)); if ( $new_user_name == '' ) { echo "<font color=\"#EE0000\" size=\"2\"><b>".$config['fill_all_fields']."</b></font>"; die(); } if ( strlen($new_user_name) < 4 ) { echo "<font color=\"#EE0000\" size=\"2\"><b>".$config['username_4_chars']."</b></font>"; die(); } if ( strlen($new_user_name) > $max_len_username ) { echo "<font color=\"#EE0000\" size=\"2\"><b>".$config['username_to_long']."</b></font>"; die(); } // check against reserved names e.g. -> admin etc... or adult words ban if ( in_array( $new_user_name, $reserved_names ) ) { echo "<font color=\"#EE0000\" size=\"2\"><b>".$config['username_not_allowed'] .""; die(); } $sql = "SELECT user_name FROM member_profile WHERE user_name = '$new_user_name'"; $query = @mysql_query($sql); $count = @mysql_num_rows($query); if ( $count > 0 ) { echo "<font size=\"2\"><b>$new_user_name</b></font><font color=\"#EE0000\" size=\"2\"> <b>=> $lang_not_available</b></font>"; } else { echo "<font size=\"2\"><b>$new_user_name</b></font><font color=\"#00DD00\" size=\"2\"> <b>=> $lang_available </b></font>"; } @mysql_free_result($result); @mysql_close(); die(); } if ( $action == 'show_country' ) { $country_fields_all = ''; $show_fields = ''; $country_list = file('includes/country.list'); foreach ( $country_list as $country_select ) { $country_fields_all = $country_fields_all . $country_select; } $show_fields = '<div style="margin-left:30px; float:left;"><b>'.$lang_country.':</b></div>'; $show_fields .= '<div style="margin-left:95px; float:left;" id="country_list">'; $show_fields .= '<select class="FormSpecialInput_1" id="country_list" name="country_list" style="font-size: 9pt; width:128px; height:20px; font-weight:bold; color:#444444; letter-spacing: 1; border: 1px solid #DFDCDC; background-color: #FDFDFD">'; $show_fields .= $country_fields_all; $show_fields .= '</select></div>'; echo $show_fields; die(); } if ( $procede == true ) { $account_type = 'Standard'; $first_name = trim(mysql_real_escape_string( $_POST['first_name'] )); $last_name = trim(mysql_real_escape_string( $_POST['last_name'] )); $email_address = trim(mysql_real_escape_string( $_POST['email_address'] )); $email_address2 = trim(mysql_real_escape_string( $_POST['email_address2'] )); $user_name = trim(mysql_real_escape_string( $_POST['user_name'] )); $password = trim(mysql_real_escape_string( $_POST['password'] )); $confirm_password = trim(mysql_real_escape_string( $_POST['confirm_password'] )); $country_list = trim(mysql_real_escape_string( $_POST['country_list'] )); $dob_month = (int) mysql_real_escape_string( $_POST['dob_month'] ); $dob_day = (int) mysql_real_escape_string( $_POST['dob_day'] ); $dob_year = (int) mysql_real_escape_string( $_POST['dob_year'] ); $zip_code = (int) mysql_real_escape_string( $_POST['zip_code'] ); if ( $_POST['terms'] == 'yes' ) { $checked = 'checked=\"checked\"'; $procede = true; } else { $procede = false; $error_message = $config['agree_to_terms']; } if ( strlen($user_name) < 4 ) { $error_message = $config['username_4_chars']; $procede = false; } if ( strlen($user_name) > $max_len_username ) { $error_message = $config['username_to_long']; $procede = false; } // check against reserved names e.g. -> admin etc... or adult words ban if ( in_array( $user_name, $reserved_names ) ) { $error_message = $config['username_not_allowed']; $procede = false; } // dDB birthday must be this format =>2008-09-17 $birthday = $dob_year .'-'. $dob_month .'-'. $dob_day; foreach ($_POST as $key => $value) { if (!isset($value) || ($value == '')) { $display_key = @str_replace('_', ' ', $key); if ( $display_key == 'zip code' && $value == '' ) { $value = 'none'; } else { $error_message = $error_message . ' - ' . $display_key . ' '.$lang_required.' '; $procede = false; } } else { if ( $key == 'email_address2' ) $key = 'email_address'; if ( $key !== 'email_address' && (!eregi("^[ _a-zA-Z0-9-]*$", $value)) ) { $display_key = @str_replace('_', ' ', $key); $error_message = $error_message . ' - ' . $display_key . ' '.$config['invalid_email_text'].' '; $procede = false; } if ( $key == 'email_address' && !eregi("^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*(\.[a-z]{2,3})$", $value) ) { $display_key = @str_replace('_', ' ', $key); $error_message = $error_message . ' - ' . $display_key . ' '.$config['invalid_email_format'].' '; $procede = false; } if ( $key == 'user_name' ) { // check against reserved names e.g. -> admin etc... or adult words ban if ( in_array( $user_name, $reserved_names ) ) { $display_key = @str_replace('_', ' ', $key); $error_message = $error_message . ' ' .$config['username_not_allowed'] . ' !'; $procede = false; } } } } } // checking if emails match if ( $procede == true ) { if ( $email_address !== $email_address2 ) { $error_message = ' '.$config['emails_do_not_match']; $procede = false; } } // checking if passwords match if ( $procede == true ) { if ($confirm_password !== $password) { $error_message = ' '.$config['password_do_not_match']; $procede = false; } } // checking if username and email is unique if ( $procede == true ) { $sql = "SELECT user_name, email_address FROM member_profile"; $query = @mysql_query($sql); while ($result = (@mysql_fetch_array($query))) { if ( !empty($result['user_name']) || !empty($result['email_address']) ) { // case insensitive login and registration $reg_user_name = strtolower($user_name); $db_user_name = strtolower($result['user_name']); if ($db_user_name == $reg_user_name) { $error_message = ' '.$config['username_is taken']; $procede = false; } if ( $result['email_address'] == $email_address ) { $error_message = $error_message . ' -'.$config['email_already_exists']; $procede = false; } } } } // if any errors display error message => [var.message_type] - [var.error_message] if ($procede == false && $form_submitted == 'yes') { $message_type = $lang_error; $blk_notification = 1; $show_signup = 1; $template = "themes/$user_theme/templates/main_1.htm"; $inner_template1 = "themes/$user_theme/templates/inner_signup_form.htm"; $TBS = new clsTinyButStrong; $TBS->NoErr = true; $TBS->LoadTemplate("$template"); $TBS->Render = TBS_OUTPUT; $TBS->Show(); @mysql_close(); die(); } // START => load page with form if ( !isset($form_submitted) || ($form_submitted == '') ) { $show_signup = 1; $template = "themes/$user_theme/templates/main_1.htm"; $inner_template1 = "themes/$user_theme/templates/inner_signup_form.htm"; $TBS = new clsTinyButStrong; $TBS->NoErr = true; $TBS->LoadTemplate("$template"); $TBS->Render = TBS_OUTPUT; $TBS->Show(); die(); } // if no errors register user and load welcome page if ($procede == true) { if ( strtolower($_POST['captext']) != strtolower($_SESSION['security_code']) ) { // POSSIBLE BOT ATTACK => TODO: ADD SECURITY LOG ACTIONS ETC.... // LOADING TEMPLATE IS MAYBE USELESS SINCE THIS WOULD COME FROM A SCRIPT POST // MAYBE SHOULD JUST DO A DIE HERE! $message_type = $lang_error; $blk_notification = 1; $show_signup = 0; $template = "themes/$user_theme/templates/main_1.htm"; $inner_template1 = "themes/$user_theme/templates/inner_signup_form.htm"; $TBS = new clsTinyButStrong; $TBS->NoErr = true; $TBS->LoadTemplate("$template"); $TBS->Render = TBS_OUTPUT; $TBS->Show(); @mysql_close(); die(); } else { $random_code = randomcode(); $password_email = $password; $password = md5($password); $passwordSalt = substr(md5(rand()), 0, 4); if ( $zip_code > '' ) $country_list = 'USA'; if ( $send_confirm_email == 'yes' ) { // insert new user record $sql = "INSERT into member_profile (email_address, user_name, password, passwordSalt, first_name, last_name, zip_code, country, user_ip, birthday, account_status, account_type, date_created, random_code) VALUES ('$email_address', '$user_name', '$password', '$passwordSalt', '$first_name', '$last_name', '$zip_code', '$country_list', '$user_ip', '$birthday', 'new', 'standard', NOW(), '$random_code')"; @mysql_query($sql) or die($config['error_26']);//error // get new user_id $sql = "SELECT user_id, email_address, random_code FROM member_profile WHERE random_code = '$random_code' AND email_address = '$email_address'"; $query = @mysql_query($sql); while ($result = @mysql_fetch_array($query)) $user_id = $result['user_id']; // set new user default privacy settings $sql = "INSERT INTO privacy (videocomments, profilecomments, privatemessage, friendsinvite, newsletter, user_id, publicfavorites, publicplaylists) VALUES ('yes', 'yes', 'yes', 'yes', 'yes', '$user_id', 'yes', 'yes')"; $query = @mysql_query($sql); @mysql_close(); // send email $email_template = 'email_templates/newmember.htm'; $subject = $config['email_welcome']; $to = $email_address; $from = $config['notifications_from_email']; //send email template to TBS for rendering of variable inside $template = $email_template; $TBS = new clsTinyButStrong; $TBS->NoErr = true; $TBS->LoadTemplate("$template"); $TBS->tbs_show(TBS_NOTHING); $message = $TBS->Source; //load postage.php define('access',true); include ('includes/postage.php'); // show success $notification_type = $config['notification_success']; $message = $config['registration_success']; $blk_notification = 0; $template = "themes/$user_theme/templates/main_1.htm"; $inner_template1 = "themes/$user_theme/templates/inner_notification.htm"; $TBS = new clsTinyButStrong; $TBS->NoErr = true; $TBS->LoadTemplate("$template"); $TBS->Render = TBS_OUTPUT; $TBS->Show(); @mysql_close(); die(); // else send confirmation email is off so we complete the regisration process and show sign in message } else { // insert new user record $sql = "INSERT into member_profile (email_address, user_name, password, passwordSalt, first_name, last_name, zip_code, country, birthday, account_status, account_type, date_created, random_code) VALUES ('$email_address', '$user_name', '$password', '$passwordSalt', '$first_name', '$last_name', '$zip_code', '$country_list', '$birthday', 'active', 'standard', NOW(), '$random_code')"; @mysql_query($sql) or die($config['error_26']);//error // get new user_id $sql = "SELECT user_id, email_address, random_code FROM member_profile WHERE random_code = '$random_code' AND email_address = '$email_address'"; $query = @mysql_query($sql); while ($result = @mysql_fetch_array($query)) $user_id = $result['user_id']; // set new user default privacy settings $sql = "INSERT INTO privacy (videocomments, profilecomments, privatemessage, friendsinvite, newsletter, user_id, publicfavorites, publicplaylists) VALUES ('yes', 'yes', 'yes', 'yes', 'yes', '$user_id', 'yes', 'yes')"; $query = @mysql_query($sql); @mysql_close(); $show_signup = 0; $show_login = 1; $show_action_msg = 1; $message_type = $config['notification_success']; $error_message = $config['reg_confirm_complete']; $action_msg = $message_type . " - " . $error_message; $template = "themes/$user_theme/templates/main_1.htm"; $inner_template1 = "themes/$user_theme/templates/inner_signup_form.htm"; $TBS = new clsTinyButStrong; $TBS->NoErr = true; $TBS->LoadTemplate("$template"); $TBS->Render = TBS_OUTPUT; $TBS->Show(); @mysql_close(); die(); } }// end captcha check if } ?>
  22. I've looked around the php script that I'm using and I can't figure out why my drop-down box border and background is blue when selected (see attached image). Can you help me with a suggestion on how to over-ride wherever that blue is? The css code I'm using to style the drop-down box is: input.common-input, select.dropdown_box { width:112px; height: 40px; padding: 4px 0px 0px 2px; margin: 0px; color:#cccccc; background: #ffffff; }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.