Jump to content

gongpex

Members
  • Content Count

    349
  • Joined

  • Last visited

Everything posted by gongpex

  1. gongpex

    Create own domain name extension

    Hello everyone, Just ask, usually we use : www.example.com, .net, .cc, .info and etc. Q : How to create domain name extension like www.example.aa, www.example.gong or etc and own it ? please answer Thanks
  2. gongpex

    php use and namespace class not found

    Hello everyone First of all : Happy New Year 2019 hope y'all successful to achieve y'all's target in this year. I created code to test namespace and use in php like this : <?php namespace Base; class Section{ function test(){ echo 'aaa'; } } ?> file on above is Section.php <?php namespace Base2; class Base2 extends Base\Section { function test(){ $class = new Section(); $class->aaa(); } } $ans = new Base2(); $ans->test(); ?> this file is : Base2.php when I run Base2.php it always Fatal error: Class 'Base2\Base\Section' not found in C:\Apache24\htdocs\branch\learn\Base2.php on line 4 Q : Is there something wrong with my code? please help Thanks
  3. Hello everyone, it's possible or not to use 'GET' method to send data from ajax multipart form data like this : var formData = new FormData( $("#fm")[0]); $.ajax({ type : "GET", cache: false, contentType: false, processData: false, url : "<?php echo base_url('index.php/update/do_update');?>", dataType : "json", data : formData, success : function(response){ alert('posted'); } }); Currently I used method 'POST' to send data, but it cause pending / stalled on XHR so all the process aborted. Q1 : if the method must be 'POST' only , could you tell me the solution to avoid pending on ajax request? Q2 : does the hosting provider have potential to influence the process? (currently I use free hosting to hosting my website) Please help me, because I can't upload anything if the process still pending / stalled. Thanks
  4. gongpex

    php ajax multipart form data using method get

    Hello Thanks for reply. Today when I asked my hosting provider about why my ajax upload process is pending / staled they answered me : "are you using script to sending data? it's probably blocked by free hosting BOT blocked" Q : is this possible the main cause why my ajax process pending / stalled ? because when I run my code (used post method) on localhost it able to sent as well. please reply Thanks
  5. Hello everyone, Alright, I think it's hard to write my trouble here, so, please visit : https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_element_iframe And then just replace those code with these : <!DOCTYPE html> <html> <body> <iframe id="myFrame" src="/default.asp" style="height:380px;width:100%"></iframe> <p>Click the on the iframe to change w3schools background color</p> <script> document.getElementById("myFrame").contentWindow.onclick = test; function test() { var iframe = document.getElementById("myFrame"); var elmnt = iframe.contentWindow; elmnt.document.body.style.backgroundColor = "yellow"; } </script> </body> </html> These code runs well when I clicked on iframe once, but after I clicked another link page eg : Learn HTML these code didn't work. it looks if iframe / browser unable to caught event (onclick). Q : How to fix so that event still able to catch by contentWidth , though user click another link page? please help me. Thanks
  6. Hello, thanks for reply again unless they tell it to load the URL in the parent page Q : Which URL? did u mean URL from page inside iframe? how about if put some script inside the iframe like this : <iframe id="myFrame" src="/default.asp" style="height:380px;width:100%"> <script> document.getElementById("myFrame").contentWindow.onclick = test; function test() { var iframe = document.getElementById("myFrame"); var elmnt = iframe.contentWindow; elmnt.document.body.style.backgroundColor = "yellow"; } </script> </iframe> please help Thanks
  7. Hello, thanks for reply, Q : so in other word when client / user clicked on link and then jump to other page, it cause element inside the iframe changed also? actually my purpose is to make it able to fire the event, although inside iframe. please help me how to fix this Thanks
  8. gongpex

    free domain / subdomain name

    Hello everyone, Currently I looking for free domain / subdomain name and then I found http://aa.am/ , Q : does it spam ? if so, could you recommend me another free domain name provider? Note : please do not recommend me freenom, I had register so many domain name there, and I unable to register on it anymore. please help Thanks
  9. gongpex

    php put inside css file security

    Hello everyone, It safe or not put php code on css file like this : <?php header("Content-type: text/css; charset: UTF-8"); $db = new mysqli("host", "username", "password", "database"); if ($db->connect_error) { die("Connection failed: " . $db->connect_error); } ?> /* css code */ Q : if not safe please tell me how to use php inside css. Thanks
  10. gongpex

    mysql shutdown

    Hello everyone, In past I had experience like this : I have two tables on mysql db and these : shops shop_details the shops table contains orders from users like : order_id order_number id_item the shop_details table contains detail orders from users like : order_detail_id order_id item_price And to insert it I used some php code like this (this code just for mapping not actual code) : <?php if($validation == true){ /* THIS JUST LOGIC MAPPING NOT ACTUAL CODE */ $sql = new mysql(host,user,passw,db); $query = $sql->query("insert into shop"); /* LOGIC MAPPING FOR DETAIL */ if($query){ $sql->query("insert into shop_detail"); } } ?> All user's orders were able to inserted on table shop, but not all user's detail orders were inserted to table shop_detail. so in other word not all data inserted on table shop_detail due mysql shutdown (maybe i don't know) Note : I used bot to insert all data for test Q : how to avoid mysql shutdown if much users do order? please help me Thanks
  11. gongpex

    iframe custom scrollbar

    Hello everyone, I've search on google about iframe custom scrollbar tutorial but I didn't find it. Thing that I found only 'custom scrollbar tutorial' NOT iframe custom scrollbar. please see this link : https://stackoverflow.com/questions/22618452/custom-scrollbar-using-jquery-for-iframe-with-customer-url Q : Maybe y'all know where is the tutorial about custom iframe scrollbar? please tell me Thanks
  12. gongpex

    iframe custom scrollbar

    Hello, thanks for reply, I just tried but the result still same : <style> .scroll-pane { width: 100%; height: 200px; overflow-x: hidden; overflow-y: auto; } </style> <body> <!-- iframe --> <iframe class="scroll-pane" src="iframe_content1.html" frameborder="0"> <p>Your browser does not support iframes.</p> </iframe> <script> $(document).ready(function(){ $('.scroll-pane').jScrollPane({ contentWidth : 0 }); }); </script> </body> please help Thanks
  13. gongpex

    iframe custom scrollbar

    Hello, Thanks for reply, Today I used jscrollpane to made custom scrollbar on iframe, it's worked but unable to remove horizontal bar (always displayed both), this is my code : <style> .scroll-pane { width: 100%; height: 200px; overflow: auto; } </style> <body> <!-- iframe --> <iframe class="scroll-pane" src="iframe_content1.html" frameborder="0"> <p>Your browser does not support iframes.</p> </iframe> <script> $(document).ready(function(){ $('.scroll-pane').jScrollPane({ contentWidth: '0px' }); }); </script> </body> contentWidth was according on : https://stackoverflow.com/questions/4404944/how-do-i-disable-horizontal-scrollbar-in-jscrollpane-jquery I've tried horizontalDragMaxWidth: 0 also, but the result was same. please help me Thanks
  14. gongpex

    create own place holder

    Hello everyone, On modern browser commonly we put : <input type="text" placeholder="Your Value" /> To display placeholder's value. But how about in old browser such IE7? I've tried to made own code used jquery and these my code : HTML : <input type="text" class="form-control placeholder" watermark="Your Name" id="name" /> JQUERY function placeholder(){ var holder = $(".placeholder"); var content_holder = holder.attr("watermark"); holder.val(content_holder); holder.focus(function(){ $(this).selectRange(0,0); }); holder.keyup(function(){ if(holder.val().length == 0){ holder.val(content_holder); $(this).selectRange(0,0); } }); holder.keypress(function(){ if(holder.val() == content_holder) { holder.val(""); } }); } $.fn.selectRange = function(start, end) { if(!end) end = start; return this.each(function() { if (this.setSelectionRange) { this.focus(); this.setSelectionRange(start, end); } else if (this.createTextRange) { var range = this.createTextRange(); range.collapse(true); range.moveEnd('character', end); range.moveStart('character', start); range.select(); } }); }; my codes as far runs well but still have flaw (not like as properly placeholder). if you clicked on input, the cursor position still able go to last character from ("your name"), not at position 0,0 (first character). Q : how to make so that the cursor position at range 0,0 (first character) / same as properly placeholder? please help me Thanks
  15. gongpex

    unknown jquery code model

    Hello everyone, I found a piece of cake jquery code such this : $.Animation( this, { x: x, y: y }, { duration: speed }).progress( function( e ) { this.css( "background-position", e.tweens[0].now + "px " + e.tweens[1].now + "px" ); }); When I looked for $.Animation and progress reference on google I didn't find it. Q : Could y'all help me to find this reference? Many Thanks
  16. gongpex

    unknown jquery code model

    Hello thanks for reply, How about $.Animation ? I didn't find it on google, could u give me documentation link please? Thanks
  17. gongpex

    unknown jquery code model

    Alright I will give you the full of code, tell me where is the method of JQuery according code on below : (function( $ ) { $.fn.animateBgPosition = function( x, y, speed ) { var pos = this.css( "background-position" ).split( " " ); this.x = parseInt( pos[0], 10 ) || 0; this.y = parseInt( pos[1], 10 ) || 0; $.Animation( this, { x: x, y: y }, { duration: speed }).progress( function( e ) { this.css( "background-position", e.tweens[0].now + "px " + e.tweens[1].now + "px" ); }); return this; }; })( jQuery ); please explain to me about : tweens and now Thanks
  18. gongpex

    About font awesome

    Hello everyone, What happened with font-awesome actually? every times when I opened this site it always "server not found". I'm unable to access this site since last week. Q : maybe there is someone who knows what happened with fa (font-awesome)? please tell me. Thanks
  19. Hello everyone, I did upload my piece of cake code here : ajaxsite When I opened and run, this code worked well on PC. But when I opened it on my smartphone it didn't give responds entirely. Here my code : Controller Test.php public function index() { $this->load->view('form-test'); } public function signin() { header('Content-Type: application/json'); $l_username = $this->input->post('l_username'); $l_password = $this->input->post('l_password'); if(empty($l_username) || empty($l_password)){ $data['success'] = false; } else { $data['success'] = true; } echo json_encode($data); exit; } and this form-test.php : <body> <form id="fm" role="form"> <div class="f_wrapper"> <div align="center" class="number warn"><!-- WARN --></div> <div align="center" class="number notify"><!-- WARN --></div> <div class="admin_panel">Backoffice Template Media</div> <div>&nbsp;</div> <div class="f_col">Admin Username</div><div class="f_col"><input name="l_username" type="text" class="inbox form-control"></div> <div class="f_col_w"><span class="number user"></span></div> <div class="f_col">Password</div><div class="f_col"><input name="l_password" type="password" class="inbox form-control"></div> <div class="f_col_w"><span class="number pass"></span></div> <div class="f_col">&nbsp;</div><div class="f_col"><button class="btn btn-default loading" id="signin">SignIn</button></div> <div class="f_col_w" style="height:10px;">&nbsp;</div> </div> </form> </body> <script> $(document).ready(function() { test_login(); }); function test_login(){ $("#fm").on('submit',function(e){ var formData = $(this).serialize(); $(".loading").html('<div class="loader"></div>'); $.ajax({ type : "POST", url : "<?php echo base_url('index.php/test/signin');?>", data : formData, dataType : "json" }).done(function(response){ $(".loading").html(''); if((response.success) == false){ alert('error'); } else { alert('correct'); } $(".loading").html('SignIn'); } ) e.preventDefault(); }); }; </script> if you want to try these code please use smartphone. I did test this code on LG K8 with chrome browser. Q : Is there any errors of my code? Note I create my application on Codeigniter 3 framework, please help me Thanks
  20. gongpex

    PHP ajax able to response on PC but not in mobile

    Yes, I didn't see alert on android device entirely .This why I asked you to test my code via smartphone (android device). I had debug (inspect element) it via network xhr in PC, everything were fine, Q : do you know how to debug on android device? please help Thanks
  21. gongpex

    PHP ajax able to response on PC but not in mobile

    @justsomeguy Hello thanks for reply, Well, in PC it would be display alert, but in mobile alert won't displayed. if you leave both of forms blank or either, it will shown alert with message "error", but if you fill both (whatever) it will shown "correct". My actual problem / block is only why it didn't work on android mobile browser. please help Thanks
  22. gongpex

    PHP ajax able to response on PC but not in mobile

    @justsomeguy Thanks for reply before, here the rest of code : <!DOCTYPE HTML> <head> <title>Form Test</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <?php include('inc/link.php');?> <script src="<?php echo base_url('assets/admin/js/jquery-1.10.2.js');?>"></script> <style> body{ font-family:arial; font-size:13px; } .admin_panel { background-color:#B70531; width:auto; color:#FFF; text-align:center; padding:10px 0px; } .f_wrapper {min-width:270px; width:25%; margin:10% auto; padding:5px 5px 0px 5px;border:1px solid #C9C9C9;background:white} .f_col {padding:3px;float:left;width:40%} .f_col_w {width:auto; margin:0px; padding:0px 2px 0px 50%;clear:left;} .number, .number p {color:#E4292F;} .inbox{ width : 135%; height: 30px; } @media (max-width: 1242px){ body{ font-size:11px; } } </style> </head> <body> <form id="fm" role="form"> <div class="f_wrapper"> <div align="center" class="number warn"><!-- WARN --></div> <div align="center" class="number notify"><!-- WARN --></div> <div class="admin_panel">Backoffice Template Media</div> <div>&nbsp;</div> <div class="f_col">Admin Username</div><div class="f_col"><input name="l_username" type="text" class="inbox form-control"></div> <div class="f_col_w"><span class="number user"></span></div> <div class="f_col">Password</div><div class="f_col"><input name="l_password" type="password" class="inbox form-control"></div> <div class="f_col_w"><span class="number pass"></span></div> <div class="f_col">&nbsp;</div><div class="f_col"><button class="btn btn-default loading" id="signin">SignIn</button></div> <div class="f_col_w" style="height:10px;">&nbsp;</div> </div> </form> </body> <script> $(document).ready(function() { test_login(); }); function test_login(){ $("#fm").on('submit',function(e){ var formData = $(this).serialize(); $(".loading").html('<div class="loader"></div>'); $.ajax({ type : "POST", url : "<?php echo base_url('index.php/test/signin');?>", data : formData, dataType : "json" }).done(function(response){ $(".loading").html(''); if((response.success) == false){ alert('error'); } else { alert('correct'); } $(".loading").html('SignIn'); } ) e.preventDefault(); }); }; </script> <!-- BOOTSTRAP SCRIPTS --> <script src="<?php echo base_url('assets/admin/js/bootstrap.min.js');?>"></script> <!-- METISMENU SCRIPTS --> <script src="<?php echo base_url('assets/admin/js/jquery.metisMenu.js');?>"></script> <!-- CUSTOM SCRIPTS --> <script src="<?php echo base_url('assets/admin/js/custom.js');?>"></script> <script src="<?php echo base_url('assets/admin/js/mix.js');?>"></script> <!-- DATA TABLES --> <script src="<?php echo base_url('assets/admin/js/dataTables/jquery.dataTables.js');?>"></script> <script src="<?php echo base_url('assets/admin/js/dataTables/dataTables.bootstrap.js');?>"></script> <!-- LIGHTBOX --> <script src="<?php echo base_url('assets/js/lightbox/jquery.popupoverlay.js');?>"></script> </html> Please help me Thanks
  23. Hello everyone, I had tried number of times to install laravel on my shared hosting , my hosting is byethost, but it's unsuccessful the result always error http 500 . please open my site : http://testtemplatemedia.byethost12.com/public What I tried are : check php extension on my server hosting, all had set correctly change folder permission from 755 to 777 on folder 'storage' recursively check php version, currently I used laravel 5.25 and my php version on hosting is php 5.6.0 If you need my error log please check my attachment Please help me Thanks laravel.log
  24. gongpex

    Unable to install laravel on shared hosting

    Hello, thanks for reply, if so, can you recommend me another php framework that powerful maybe. I really appreciate it Thanks.
  25. gongpex

    Unable to install laravel on shared hosting

    Hello, thanks for your reply, according on your links I had tried to change app key on my local computer using : php artisan generate:key on command prompt, and I had reupload used it but it's unsuccessful... btw, because I used free hosting, then they didn't gave me access using SSH (secure shell) so I can't run composer. please help me here, I attach my .env file Thanks .env
×