
Chrisj
Members-
Posts
551 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Chrisj
-
Thanks for that, much appreciated, very helpful. Now, if you don't mind, I'd like be grateful for some assistance with putting the search words field into the new container, please. As you can see from the attached image, the search field is below the container. I'm stumped on what I need to do there. Any help will be appreciated. Here's that code: <td> <h3>2. ENTER SEARCH WORDS</h3> <select name="channel" class="dropdown_box"> <input type="text" autocomplete="off" id="keyword" name="keyword" value="SEARCH WORDS" onfocus="if (this.value=='SEARCH WORDS') {this.value=''; this.style.color='#696969';}" onclick="clickclear(this, 'Search [var.site_name]')" onblur="clickrecall(this,'Search [var.site_name]')" value="" /> </select> </td>
-
I have this Search Form that works successfully: <form method="get" action="../search.php" name="myForm" /> <select size="1" name="channel" class="dropdown_box" /> <option value="All">All</option> <option value="4">Channel-2</option> <option value="6">Channel-4</option> </select> <select size="1" name="sub_category" class="dropdown_box" /> <option value="All">Sub Category</option> </select> <input type="text" autocomplete="off" id="keyword" name="keyword" value="SEARCH WORDS" onfocus="if (this.value=='SEARCH WORDS') {this.value=''; this.style.color='#696969';}" onclick="clickclear(this, 'Search [var.site_name]')" onblur="clickrecall(this,'Search [var.site_name]')" value="" /> <input type="submit" value="SUBMIT"/> </form> I wanted it to look better, so I installed this JQuery drop-down menu plug-in: http://www.jqueryscript.net/form/Custom-Select-Dropdown-List-Plugin-For-jQuery-jQuery-UI.html1 And I'm trying to combine them. Here's essentially the jQuery code: <form action="" method="get"> <table> <tr> <td> <h3>1. SELECT CATEGORY</h3> <select name="drop1" class="ui-select"> <option value="">Choose One</option> <option value="2">ALL</option> <option value="4">Channel-2</option> <option value="6">Channel-4</option> </select> </td> <td> <h3>2. ENTER SEARCH WORDS</h3> <select name="drop2" class="ui-select"> </select> </td> <td> <h3>2. CHOOSE CATEGORY</h3> <select name="drop2" class="ui-select"> </select> </td> </tr> </form> <script> $(document).ready(function(){ $(".ui-select").selectWidget({ change : function (changes) { return changes; }, effect : "slide", keyControl : true, speed : 200, scrollHeight : 250 }); }); </script> I believe it's changing <select> line that I can't get correct. I look forward to any assistance.
-
Thank you for all of your replies. I've cured the syntax error and added this to uploader.php: 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>"; } However, I could use some assistance, please, with how to tie it into the Form code: <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> Any guidance with how to ultimately adjust the Form so the named the channel "1", can allow the sub-categories to populate the Form, will be greatly appreciated.
-
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 name the channel, and 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> Someone who looked at the files had this to say (it's a bit over my head): "the javascript executes uploader.php?sub_cat=1. The uploader.php returns the list of subcategories in html and the ahah script moves it to the correct section on the inner_uploader.htm Move the javascript off the onchange to just do it anyway and pass the channel value of 1 directly into uploader. I just think maybe the javascript isn't being executed for whatever reason" Here's that javascript file: // ========================================================================== // @function Complete AHAH function // @author Daniele Florio // @site www.gizax.it // @version 1.1.3 experimental // @thanksTo Andrea Paiola,Walter Wlodarski,Scott Chapman // @updated 1.1.3 ( execJS function ) @thanks to Giovanni Zona // (c) 2006 Daniele Florio <daniele@gizax.it> // ========================================================================== /* USAGE: 1) Posting data to form: <form id="myform" action="javascript:ahahscript.likeSubmit('helloworld.php', 'post', 'myform', 'mytarget');"> ('comments_ajax.php', 'commentajax', '', 'GET', '', this) 2) Getting simple url <a href="#" onclick="javascript:ahahscript.ahah('test.htm', 'mytaget', '', 'GET', '', this);">click me</a> */ var ahahscript = { //loading : 'loading...', loading : "<br /><img src=javascripts/loading.gif", ahah : function (url, target, delay, method, parameters) { if ( ( method == undefined ) || ( method == "GET" ) || ( method == "get" ) ){ this.creaDIV(target, this.loading); if (window.XMLHttpRequest) { req = new XMLHttpRequest(); } else if (window.ActiveXObject) { req = new ActiveXObject("Microsoft.XMLHTTP"); } if (req) { req.onreadystatechange = function() { ahahscript.ahahDone(url, target, delay, method, parameters); }; req.open(method, url, true); req.send(""); } } if ( (method == "POST") || (method == "post") ){ this.creaDIV(target, this.loading); if (window.XMLHttpRequest) { req = new XMLHttpRequest(); } else if (window.ActiveXObject) { req = new ActiveXObject("Microsoft.XMLHTTP"); } if (req) { req.onreadystatechange = function() { ahahscript.ahahDone(url, target, delay, method, parameters); }; req.open(method, url, true); req.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); req.send(parameters); } } }, creaDIV : function (target, html){ if (document.body.innerHTML) { document.getElementById(target).innerHTML = html; } else if (document.getElementById){ var element = document.getElementById(target); var range = document.createRange(); range.selectNodeContents(element); range.deleteContents(); element.appendChild(range.createContextualFragment(html)); } }, execJS : function (node) { var st = node.getElementsByTagName('SCRIPT'); var strExec; var bSaf = (navigator.userAgent.indexOf('Safari') != -1); var bOpera = (navigator.userAgent.indexOf('Opera') != -1); var bMoz = (navigator.appName == 'Netscape'); for(var i=0;i<st.length; i++) { if (bSaf) { strExec = st[i].innerHTML; } else if (bOpera) { strExec = st[i].text; } else if (bMoz) { strExec = st[i].textContent; } else { strExec = st[i].text; } try { eval(strExec); } catch(e) { alert(e); } } }, ahahDone : function (url, target, delay, method, parameters) { if (req.readyState == 4) { element = document.getElementById(target); if (req.status == 200) { //this.creaDIV(target, req.responseText); output = req.responseText; document.getElementById(target).innerHTML = output; var j = document.createElement("div"); j.innerHTML = "_" + output + "_"; this.execJS(j); } else { this.creaDIV(target, "ahah error:\n"+req.statusText); } } }, /* @@ parameters : fileName = name of your cgi or other method = GET or POST, default is GET formName = name of your form dynamicTarget = name of your dynamic Target DIV or other @@ usage : */ likeSubmit : function ( file, method, formName, target ) { var the_form = document.getElementById(formName); var num = the_form.elements.length; var url = ""; var radio_buttons = new Array(); var nome_buttons = new Array(); var check_buttons = new Array(); var nome_buttons = new Array(); // submit radio values var j = 0; var a = 0; for(var i=0; i<the_form.length; i++){ var temp = the_form.elements[i].type; if ( (temp == "radio") && ( the_form.elements[i].checked) ) { nome_buttons[a] = the_form.elements[i].name; radio_buttons[j] = the_form.elements[i].value; j++; a++; } } for(var k = 0; k < radio_buttons.length; k++) { url += nome_buttons[k] + "=" + radio_buttons[k] + "&"; } // submit checkbox values var j = 0; var a = 0; for(var i=0; i<the_form.length; i++){ var temp = the_form.elements[i].type; if ( (temp == "checkbox") && ( the_form.elements[i].checked) ) { nome_buttons[a] = the_form.elements[i].name; check_buttons[j] = the_form.elements[i].value; j++; a++; } } for(var k = 0; k < check_buttons.length; k++) { url += nome_buttons[k] + "=" + check_buttons[k] + "&"; } // submit all kind of input for (var i = 0; i < num; i++){ var chiave = the_form.elements[i].name; var valore = the_form.elements[i].value; var tipo = the_form.elements[i].type; //var valore_2 = valore.replace(/ /,"OK Space")); //alert(valore_2); if ( (tipo == "submit") || (tipo == "radio") || (tipo == "checkbox") ){} else { url += chiave + "=" + valore + "&"; } } //alert(url); var ajax_space_fix = url; var intIndexOfExtraSpace = ajax_space_fix.indexOf( " " ); while (intIndexOfExtraSpace != -1) { ajax_space_fix = ajax_space_fix.replace( " ", " " ) intIndexOfExtraSpace = ajax_space_fix.indexOf( " " ); } //alert( ajax_space_fix ); var parameters = ajax_space_fix; //url; url = file + "?" + url; if (method == undefined) { method = "GET"; } if (method == "GET") { this.ahah(url, target, '', method, ''); } else { this.ahah(file, target, '', method, parameters); } } }; Any ideas regarding naming the channel, and 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.
-
Thank you
-
Thanks for your reply and for sharing that example. Regarding the 'thingie', I couldn't tell you what that is, I'm using this web script, and trying to modify it,I'm not the author. I'll be grateful for any additional ideas on the syntax error, thanks again
-
Thanks for your replies. The text editor is text-pad, and I'm not doing that, I'm just copying it from text-pad. Regarding "you have to break up the string in to pieces or else use escape chars to avoid unintended breaks to your content", any example you like to share will be appreciated.
-
Thank you for looking that over. I appreciate it. I removed the one of the TWO SEMIS, thanks. Yes, I need some guidance with: "THINK YOU NEED TO WORK ON THIS" "THIS LINE IS DEFINITELY BROKEN. TOO MANY ' AND " CHARS HERE!" and with the syntax error. Any guidance you'd like to share will be welcomed.
-
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.
-
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.
-
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.
-
Thanks for your reply. I'm not seeing what you mean. I see: '; } isn't that correct?
-
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.
-
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.
-
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.
-
I'm sending a PM
-
Upon an Upload Form's "Submit" serve two functions?
Chrisj replied to Chrisj's topic in PHP Coding Help
Asking for an example, helps me learn -
Thanks for your help. Much apppreciated
-
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.
-
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
-
Thanks for your reply. My answer is I don't know Can you help me determine that?
-
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
-
Upon an Upload Form's "Submit" serve two functions?
Chrisj replied to Chrisj's topic in PHP Coding Help
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"? -
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?
-
Thank you for your reply. Much appreciated. Can you please give me more of an example of what you mean? Thanks