Jump to content

JamesB

Members
  • Posts

    425
  • Joined

  • Last visited

About JamesB

  • Birthday 02/01/1992

Contact Methods

  • Website URL
    http://
  • ICQ
    0

JamesB's Achievements

Member

Member (2/7)

50

Reputation

  1. Change this,value to this.value in all these: <input type="button" name="no" value="1" onClick="NUMBERS(this,value)"> <input type="button" name="no" value="2" onClick="NUMBERS(this,value)"> <input type="button" name="no" value="3" onClick="NUMBERS(this,value)"> <input type="button" name="no" value="4" onClick="NUMBERS(this,value)"> <input type="button" name="no" value="5" onClick="NUMBERS(this,value)"> <input type="button" name="no" value="6" onClick="NUMBERS(this,value)"> <input type="button" name="no" value="7" onClick="NUMBERS(this,value)"> <input type="button" name="no" value="8" onClick="NUMBERS(this,value)"> <input type="button" name="no" value="9" onClick="NUMBERS(this,value)"> <input type="button" name="no" value="0" onClick="NUMBERS(this,value)"> And if txt variable is supposed to be a number, then change: txt = txt + num; to txt = parseInt(txt) + parseInt(num);
  2. You don't need to use LIKE for those int checks, just do a = comparison. This untested code goes beyond your spec requirements, eg. allowing text filter at same time as district_id filter Edit: Just realized this thread isn't in the PHP section lol.. <?php$hospitalName = 'abcde';$cityId = 0;$districtId = -1;$stateId = 0; $where_ands = array();if($cityId != -1){$where_ands[] = 'city_id = '.$cityId;}if($districtId != -1){$where_ands[] = 'district_id = '.$districtId;}if($stateId != -1){$where_ands[] = 'state_id = '.$stateId;}if($hospitalName != ''){$where_ands[] = 'name LIKE %'.escape_for_like($hospitalName).'%';} $query = 'SELECT * FROM hospitals'.(count($where_ands) > 0 ? ' WHERE '.implode(' AND ', $where_ands) : '');
  3. You still can use the html inline with php, but as Ingolme said you need the .php extension.
  4. A quick google search gave this: https://www.siteground.com/tutorials/magento/import-products.htm I haven't tried it but it talks about an export template or something, I guess you could use this method and convert all your product data to the template format.
  5. JamesB

    Let join issue

    This project tracker is hosted here for <?php htmlspecialchars($project->external_project_username); ?>. So the query was fine, turns out I'd forgotten the word echo lol.
  6. JamesB

    Let join issue

    Hey I can't seem to get this left join to work to retrieve the username from the users table. projects.external_project_user can be 0, with no users.user_id being 0. SELECTprojects.*,users.username AS external_project_username,(SELECT COUNT(*) FROM todo_entries WHERE todo_entries.project_id = projects.project_id AND status = 1) AS entry_count_open,(SELECT COUNT(*) FROM todo_entries WHERE todo_entries.project_id = projects.project_id AND status = 2) AS entry_count_pending_testing,(SELECT COUNT(*) FROM todo_entries WHERE todo_entries.project_id = projects.project_id AND status = 3) AS entry_count_resolved,(SELECT COUNT(*) FROM todo_entries WHERE todo_entries.project_id = projects.project_id AND status = 4) AS entry_count_skippedFROM projectsLEFT JOIN usersON users.user_id = projects.external_project_userWHERE projects.todo_listed = 1ORDER BY `order` DESC
  7. Fixed it. All I needed was Recaptcha.reload(); $('#register_form').ajaxForm({url: base_url+'member/register',type: 'post',success: function(responseText, statusText, xhr, form){$('#register_ajax_container').hide(0);$('#register_form_errors').html(responseText);$('.form_errors').show();Recaptcha.reload();}});
  8. So thanks to this link I now realize the captcha needs to be reloaded for a second attempt. http://stackoverflow.com/questions/21768129/recaptcha-always-failing-on-the-second-time I'm using AJAX for my form, so I've decided to create the script tag in JS and append it to the element upon ajax response, but it's not working. Here's my code: $('#register_form').ajaxForm({ url: base_url+'member/register', type: 'post', success: function(responseText, statusText, xhr, form){ $('#register_ajax_container').hide(0); $('#register_form_errors').html(responseText); $('.form_errors').show(); // reload the captcha $.get(base_url+'member/register_new_captcha', '', function(data){ // this URL retrieves the public key for the captcha var script=document.createElement('script'); script.type='text/javascript'; script.src='http://www.google.com/recaptcha/api/challenge?k='+data; $('#register_captcha_container').html(''); // clear existing captcha (<script> and <noscript>) $('#register_captcha_container').append(script); // add new captcha (<script>) todo: <noscript> too //$('#register_captcha_container').html(data); }); }}); I'm simply not seeing the captcha after a register attempt. Link: http://www.ukscifi.net/uks2/ If you click on Register at top right, then click Register at bottom, the captcha will disappear but not reappear.
  9. Hey I have a recaptcha on a site I'm making for a friend. If I enter the correct words first time, it works. If I enter incorrect words first time, then press reload via the captcha button, then enter correct words, it works. But if I enter incorrect words first time, then enter correct words after, it won't work. Any idea why this is? $privatekey = "my 40 byte private key is here";$resp = recaptcha_check_answer( $privatekey, $_SERVER["REMOTE_ADDR"], $this->input->post("recaptcha_challenge_field"), $this->input->post("recaptcha_response_field"));
  10. JamesB

    Ajax call

    Yeh in AJAX you can use asynchronous or synchronous. Asynchronous: <input type=button onclick='blah()'>function blah(){ sendAjaxRequest();}function onAjaxResponse(ajax){ document.getElementById("message").innerHTML = ajax.reponseText;} Synchronous: <input type=button onclick='blah()'>function blah(){ document.getElementById("message").innerHTML = getSynchronousAJAX().responseText;} It's better to use async than sync. You can also use jQuery to avoid ajax code. <input type=button id=somebutton>$(document).ready(function(){ $('#somebutton').click(function(){ $.get('someurl.php', function(data,status){ document.getElementById("message").innerHTML = data; }); });});
  11. Oh wow it's suddenly working lol. I think the fix came from adding C:php to my environment settings Path and restarting the computer. Thanks anyway
  12. Also, this file exists: C:PHPextphp_curl.dll And my extension_dir property is set correctly too. extension_dir = "C:PHPext" Other extensions seem to work like mysql, as phpmyadmin works.
  13. PHP 5.6.3 32 bit TS VC11 Apache 2.4.10 32 bit The OS is Windows 7 64 bit.
  14. Hey I'm trying to enable curl in PHP so that I can install Magento CMS which is what the company is using tomorrow at my interview So i'm hoping to install it by then and have a play around with it. I am modifying the correct PHP.ini, phpinfo() tells me C:PHPPHP.ini which is the one I am editing. I have removed the semi colon and saved the file: extension=php_curl.dll I have restarted the web server. I have put libeay32.dll and ssleay32.dll into my Windows/System32 and Windows/SysWOW64 folders and have restarted my computer. And still no luck with curl being enabled. I don't get the curl block in phpinfo() and Magento is still saying curl is required. Any ideas?
  15. JamesB

    Force float left

    Fixed the other server issue, it was actually a PHP property extension_dir I hadn't set correctly. Anyway back to CSS. I've attempt to set "min-width: 200px;" on .project_container but .project_column2 still goes beneath .project_column1 I will target the issue of this not being ideal for smaller screens by wrapping the text and moving .project_column2 more to the left later on.
×
×
  • Create New...