Jump to content

antonyfal

Members
  • Posts

    172
  • Joined

  • Last visited

Everything posted by antonyfal

  1. I haven't had a response :'( Here are some script to get the value that i found on the net: How/which can i apply to my request above? //one version of the cookie script: function ReadCookie(cookiename) { var numOfCookies = document.cookie.length; var nameOfCookie = cookiename + "="; var cookieLen = nameOfCookie.length; var x = 0; while (x <= numOfCookies) { var y = (x + cookieLen); if (document.cookie.substring(x, y) == nameOfCookie) return (extractCookieValue(y)); x = document.cookie.indexOf(" ", x) + 1; if (x == 0){ break; } } return (null); } //another version: <script type="text/javascript"> function getCookie(c_name) { var i,x,y,ARRcookies=document.cookie.split(";"); for (i=0;i<ARRcookies.length;i++) { x=ARRcookies.substr(0,ARRcookies.indexOf("=")); y=ARRcookies.substr(ARRcookies.indexOf("=")+1); x=x.replace(/^\s+|\s+$/g,""); if (x==c_name) { return unescape(y); } } } // and another version>.. comes with own explanations but i dont understand them.. // this fixes an issue with the old method, ambiguous values // with this test document.cookie.indexOf( name + "=" ); function Get_Cookie( check_name ) { // first we'll split this cookie up into name/value pairs // note: document.cookie only returns name=value, not the other components var a_all_cookies = document.cookie.split( ';' ); var a_temp_cookie = ''; var cookie_name = ''; var cookie_value = ''; var b_cookie_found = false; // set boolean t/f default f for ( i = 0; i < a_all_cookies.length; i++ ) { // now we'll split apart each name=value pair a_temp_cookie = a_all_cookies.split( '=' ); // and trim left/right whitespace while we're at it cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, ''); // if the extracted name matches passed check_name if ( cookie_name == check_name ) { b_cookie_found = true; // we need to handle case where cookie has no value but exists (no = sign, that is): if ( a_temp_cookie.length > 1 ) { cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') ); } // note that in cases where cookie is initialized but no value, null is returned return cookie_value; break; } a_temp_cookie = null; cookie_name = ''; } if ( !b_cookie_found ) { return null; } }
  2. Hi, I know there are hundreds of examples on the net, but im just not grasping it!! all the examples i come across have expiring time, and a whole lot of other insignificant to me stuff (at the moment).. im trying to pull the value from this cookie that i set. //for this example lets say: //{THEEMAILNAME} = johndoe; //{THEEMAILDOMAIN} = doesnet.com; //so the email im trying to pull is: johndoe@doesnet.com from the following cookie. //PS: this is all done on a .html file. <script type="text/javascript"> document.cookie ="mailaddress={THEEMAILNAME}@{THEEMAILDOMAIN}; path=/"; </script> Please can some one show me how to do this from this example? with a simple explanation.. Best regards Antony
  3. agg this is working perfectly xyph. It wasn't as hard to create the list as i thought, a little CTRL+H magic and all was 2 minutes worth .. I do like the page you sent me though... lots of interesting stuff there.. Thanks again Best regards Antony..
  4. Thanks for the reply. is it that simple?? im going to give it a go.. i was hoping i could use the already made function somehow as there are 100+ specifics i need to get, i wanted to avoid all that writing AGAIN!.. i also have other queries like this one.. In the meantime i will try it this way.. thanks xyph
  5. to much reading to do will this help you? i use this to creat the dynamic dropdowns then the user selects what they want and populate the text box.. they can add from the list or type-- you can also tweak it to only add from the list i use this code with the droplists-- http://code.google.com/p/dropdown-check-list/ and then here is an example without the code above: //php // here you dynamically create your droplist. $query = "SELECT example FROM #__exampletable WHERE xxx $examplelist=doSelectSql($query); $somelist ="<select name="whatever" onchange=\"setexampleTextbox(this.options)\">"; foreach ($examplelist as $something) { output/echo somelist //html use this function at the top of your html page where you output/echo your droplist function setexampleTextbox(o){ var t =''; for(var i=0;i<o.length;i++) t+=(o[i].selected==true)?' '+o[i].value:''; document.yourFormname.example.value=t; } //this is an example of the select box where you impliment the droplist to populate the text box <input class="inputbox" type="text" size="20" name="example" value="xxx" /><br>{somelist} past this i cant help im afraid
  6. Hi, Im battling here to get "only" certain values from a "akey" and "value" query.. I have a list of items around 200 id's strong, i only want to pull cirtain values from the list, the table structure is like so: id, akey, value // i don't know the values of the specific akey's or their id's but i do know the akey value. what i am trying to do is only pull the values that are in the "getConfigTitle's" list below (this list is only a sample the actual list is around 100 strong) here is my code sample: $query="SELECT akey,value FROM settings WHERE LOWER(akey) LIKE getConfigTitles();"; $settingsList=doSelectSql($query); foreach ($settingsList as $set) { $r=array(); $r['CONFIGTITLE']=getConfigTitles(); $r['KEY'] = $set->akey; $r['SETTING'] = $set->value; $rows[]=$r; } function getConfigTitles() { $titles=array(); $titles['search']= "search" ; $titles['viewprofile']= "viewprofile" ; $titles['editprofile']= "editprofile" ; $titles['dashboard']= "dashboard" ; $titles['preview']= "preview" ; return $titles; }
  7. Hi, thanks for replying... I did find a work around to my problem eventually, but i could never solve this this one!? if i removed the check, then the THAT! file cannot pull information from all the other files that it requires.. In the end i was experimenting with include and require_once i think they would have worked... but in the end I did away with the iframe all together, spent several hours re-stucturing my urls and worked it out.. (my problem/reason).. thanks again.. If anyone does find the correct answer post it here.. I might need it in the future.. regards Antony
  8. Hi, I am struggling to find an answer here.. If for example my iframe source, file.php has a initcheck/direct access block, how can i still have access to it in an iframe? <center><iframe name="frame1" id="frame1" style="width: 100%; height: 120px; z-index: 0; " scrolling="0" src="file.php" frameborder="0"></iframe></center> //then the file.php has an initcheck and itself includes multiple other files so i cant remove the initcheck.. //header of file.php // ################################################################ defined( '_MYAPP_INITCHECK' ) or die( '' ); // ################################################################
  9. I have got a couple of forms already on my site using post and ajax return, but this form is slightly different.. I did some more research... i think what i need here is a way to post the first form to a second form on the same page?? and possibly without page refresh needed.. IE: // this echoed form is on the search.php page, which $output's to the search .html page echo '<form id="pre-search" name="pre-search" action="????" method="post"> <input type="hidden" name="postintegratedsearch" value="1" > </form>'; // this form is on the search.html page.. but gets its values from the search.php page <form id="search" name="search"> if ($_POST['postintegratedsearch'] == '1') { some code here } </form> I need the pre-search form to remove and add cirtain criteria to the main search.php so that it outputs only what is requested to the search.html.. It all works well but i cannot use the url-- i also have sef on my system.. So basically i need // im thinking// to get the values sent from one form to the next form without page-reload.. in this way the main search should show with the pre-selected criteria.. the url used will still remain available for its module and i can go have some beers since its friday.. how should the setup of the two forms look?
  10. If anyone knows this, please assist me. its quite urgent now, as my site is nearly complete, save for this and 2 other small tweaks needed.. but i know how to resolve them.. more or less.. please! regards Antony
  11. Hi, I think this should be easy for someone who knows how... where in a joomla 1.53... phpMyadmin database would i find the switch which indicates the user is logged in or out? im guessing there must be a "0" if logged out and a "1" if logged in.. qhich table would i find that 1/0 ? regards Antony
  12. Howsit?. I have a search function, it works well, but i have it setup, so that i have a Pre-Search form built into my search form.. Here the user selects gender, and several other criteria.. On submit, the search form shows with dropdowns and language files specific to the users pre-selected criteria.. The problem i have is the url that it posts to -- also belongs to another module i have in my system, and i cant change that.. What i need to do is: post to a page.php, and then have the information parsed back to the search - (javascript, or ajax) or php .. How would i setup the page.php to show the "postintegratedsearch" here?? if you look at the code bellow: the"postintegratedsearch" is a hidden field, when the user submits, the same form picks up the post and the search is revealed.. i need to do this with a page.php and without page re-load.. i hope this is the correct forum.. <?php some php code here ?> <br><form method="post" action="???"> <center><table width="50%" style="border:1px solid #444444"> <tbody><tr><td colspan="1">Gender:</td><td colspan="1"><select name="searchgender" id="searchgender" class="inputbox"> <option value="Male">Male</option> <option value="Female">Female</option> </select></td></tr><tr><td colspan="2" style="text-align:right"><input type="image" value="Submit" name="Submit" alt="Submit" src="http://www.link_to_image.png"> <input type="hidden" value="1" name="postintegratedsearch"></td></tr> </tbody></table></center> </form> <?php init_javascript(); if ($calledBySearchModule == "" && isset($_REQUEST['calledBySearchModule']) ) { $calledBySearchModule=myappGetParam( $_REQUEST, 'calledBySearchModule',"" ); } if ($calledBySearchModule == "" && !isset($_REQUEST['next']) ) { if ($_POST['postintegratedsearch'] == '1' && $jrConfig['integratedSearch_enable'] =='1') { $calledBySearchModule="mod_appsearch_a0"; } } more php here -- here i have all the database dropdowns ?>
  13. Sorry for the late reply... i did some further checking... and read your article... I get it now!! posts last as long as a session.. so if i posted someting i would have to get it in the same session, otherwise i would have to re-post it.. I also understood you re-post explanation to move it accross forms.. I was trying to pass user information across the site but didnt want to use cookies, as the user may be in a internet cafe, and this would be a security risk.. So now i understand that i can use posting.. but on every page that contains the information, i can just repost the info, that way when the user has gone through the entire site, the information will spread to the correct places.. Why this way, you may ask? is because the original form that is filled in, is only viewed once in the entire workings of the site, and a part of the information is not stored in a database.... so the user would idealy have to be redirected to all the pages seeking the information one after the other in a single session (or so i thought).. But now i figured it out. Thanks again for the advise and help Best regards Antony Falencikowski
  14. Thanks for the reply.. Ok, so what you saying is: If i wanted to post the route's as i showed above (example).. After i post from the form.php, my form.php's redirect would have to go to the next route where the index.php is? otherwise i would loose the post? is this correct? if so then would you say the next best method is cookies? or is there another method? what i want to do is spread the form's information across several different folder's with index.php . but not necessary in one session.. (session would be out of this equation) // ( just continuing the example above with index.php..)
  15. Hi, I just wanted to know how posting works?. i know how to sort of post and get info.. What i want to know is: is it possible to post something from a folder structure like so: http://wwww.xxx.com/postfolder1/postfolder2/postfolder3/postfolder4/form.php // this is the file that posts.. lets say! a username. to http://www.xxx.com/notpostfolder1/notpostfolder2/notpostfolder3/notpostfolder4/index.php // the file that gets the post : The username.. or is a php database the only answer to transfer the information? i also just discovered that in cookies if i ad path/ the cookie is valid through out the site.. is ther something like this for Post and get??
  16. Thanks for replying. So basically its the hard way for me now :'( , but I do understand from your explanation... Thanks again Rgs Antony
  17. Hello, Is this a sound explanation of require and include.. Lets say i have "X" application with an index.php file. in a folder on my domain like so: www.xxx.com/Application X folder/index.php. // the index.php calls to multiple files with-in the "Application X folder" and database. What if i move the index.php to another location all together like so: http://www.xxx.com/notXsubfolder1/notXsubfolder2/notXsubfolder3/index.php //the X application index file.. and then edit the require and include links in the index.php file to paths like this (just example might not be accurate): require_once '../../../../application X Folder/include/required_file.php'; My question:?? What i want to know is: if the required_file.php has includes of its own, will it take the includes that it requires from its original folder where the Required_file.php is located? or will its paths change the the new index.php location?? .
  18. thanks for the good trick.. this is what i get: Array ( [0] => [1] => somewordhere [2] => somewordhere [3] => somewordhere [4] => theemailhere [5] => test.php ) I retried the code, it just started working.. I wrote the echo like so: From: <br><input type="text" name="email" size="44" value="<?php echo $themail; ?>" readonly><br> thanks again.
  19. Hi, Im trying to pull an email from an url, and then echo the email as value into a email form-- under the "from" heading. The echo is not working i get blanks. here is the code: <?php $thisurl='$_SERVER['REQUEST_URI']'; $thepart = explode('/', $thisurl); $themail='$thepart[2]'; ?> <form method="post" action="sendit.php"> To: <br><input type="text" name="to" size="44" value="<?php for($i=1; $i<=$lines; $i=$i+1) { $names[$i] = str_replace("<br>", "", $names[$i]); $names[$i] = str_replace("\n", "", $names[$i]); echo $names[$i].';'; } ?>"><br> From: <br><input type="text" name="email" size="44" value="<?php echo '$themail'; ?>" readonly><br> Subject: <br><input type="text" name="subject" size="44" /><br><br>
  20. Thanks nogray. Your code is better works with the "#" and the "javascript:void(0);" ill use your code much easier to implement. best regards Antony
  21. Thanks for the replying: i also got it to work also with this code: onclick=window.opener.document.location.href='http://www.xxx.com/';>Click</a>"; but i will try your code looks simpler and post back
  22. OK!! sorry not solved. This code only works on some links.. Is there a better way to have: onclick="openUrl('http://xxx.com/subfolder/index.php/?someoption.html'); i just basically want to move the href link into the onclick and the href must = javascript:void(0); Can anyone do this is please?
  23. Ok i got it to work like this: <a href="javascript:void(0);" onClick="javascript:q=(document.location.href);void(open('http://www.xxxxx.com/subfolder/somefile.php/?someoption&somethingelse?url='+escape(q),'_self',''));">click</a> if anyone knows a better way? please post here. also it seems that the "q" can remain "q" regardles of the amount of links on a page.. It doesnt have to change to q for one link, z for another b for another etc etc etc..
  24. I'm changing all the links on my site from: //example current link is: <a href="http://www.xxxxx.com/subfolder/somefile.php/?someoption&somethingelse">click</a> //If you put the mouse over the link it is displayed in the address bar. i don't want site users to see this links. //i want to make something like this: <a href="javascript:void(0);" onClick="openUrl(\"http://www.xxxxx.com/subfolder/somefile.php/?someoption&somethingelse\",_self);">click</a> // so now the user only see the javasript:void(0); and not the link. but my code is not working, and i have to many links and pages to make a javascript function for redirecting the url onclick for every link. is there a universal function to achieve the goal that i want?
  25. Hi, I am using joomla 1.5.23 i just upgraded from 1.5.22. Now in my urls i have ?lang=en. I want to remove this for my main component. I never had it before but now i can get rid of it.. Where can i find the file to edit? //some background: i have sh404sef installed but my component uses a router file. the file has always worked with 1.5.22. Now it seems that the url's is correct if i view the sh404sef url's manager. I can even remove the ?lang=en from the address bar and i can view the correct pages. it almost seems as if the ?lang=en is added as a after thought. example non sef url in sh404sef: index.php?option=com_component&Itemid=1&profile_uid=1&task=viewprofile&lang=en sef url in sh404sef: viewprofile/profilename/1.html actual site url: http.....com/subfolder/viewprofile/profilename/1.html?lang=en i tried enabling and dissabling the sef with mod rewrite in joomla main config... If i have to hard code the fix, i will do it. can some one tell me where to fix this problem? second question: more simple. When a user logs in to joomla, before they are redirected, where can i put the code to place a cookie? i want to place a cookie, so that only logged in users can view other specific files on my site, other wise they are redirected to main login register page. the files in question are not part of joomla code.
×
×
  • 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.