Jump to content


  • Posts

  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling
  • Location

Q695's Achievements

Advanced Member

Advanced Member (4/5)



  1. I tried assigning variable names first, but for some reason I was unable to get it process, so I decided to try with ? to get them to run. Can you provide a run-able example?
  2. Going from something like: $sql_update=''; $binders=''; if(isset($_POST['name']) && $_POST['name']!=''){ $name=$_POST['name']; $binders.=",$name"; $sql_update.="`name`=?"; } ... if(isset($_POST['phone']) && $_POST['phone']!=''){ $phone=$_POST['phone']; $binders.=",$phone"; $sql_update.="`phone`=?"; } $binders = trim($binders, ','); $sql_update = trim($sql_update, ','); if ($sql_update!='' && $binders!='') { $sql = "UPDATE ___table___ SET $sql_update WHERE id=$___id___"; $q = $conn->prepare($sql); // $q->execute(array($binders,$___id___)); } How would you send it to the PDO function? I spent the whole day trying to convert it from a mysql statement to a PDO statement, and feel like
  3. If I do that, I need a way to also search with JavaScript turned off.
  4. When I put the run_modal( href, url_data ) inside the jquery function() it says: Uncaught Reference Error: run_modal is not defined when outside It says: Uncaught Error: cannot call methods on dialog prior to initialization; attempted to call method 'open' when I remove the return false the hyperlink behaves as it always has. I'm just trying to be able to pass the function variables in through the "old method" to make the function more understandable (maybe I need to see a video on how exactly the jquery variable system works). vision: you have X possible modals that can be triggered you're trying to only trigger 1 modal that will use the variables it receives to run its ajax lookup.
  5. This would work, if I wasn't trying to run a modal instead of an alert for presentation reasons: https://jqueryui.com/dialog/#modal-form The error I'm getting is: Uncaught Error: cannot call methods on dialog prior to initialization; attempted to call method 'open'
  6. Here's what I'm starting with: javascript: $(function() { $( "#dialog" ).dialog({ autoOpen: false }); }); function run_modal( href, url_data ) { // $("#dialog").dialog("open"); $( "#dialog" ).dialog( "open" ); alert(href+"?"+url_data); } PHP: echo " <div id='dialog' title='Blog Post Viewer'></div> "; function modalize($link_txt, $href, $url_data){ //<a href='?$url_data' onmousedown='run_modal()' onclick='return false' >$link_txt</a> echo " <a href='? $url_data ' onclick='return false' onmousedown=' run_modal ( \" $href \" , \" $url_data \" );'> $link_txt </a> "; } I'm struggling to make the modal popup. From there I plan to plug in my own generic ajax loader to request the data to be populated in the modal.
  7. I'm struggling to produce results to the screen from the following code: HTML: <script src="http://code.jquery.com/jquery-2.1.4.js"></script> <script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script> <script src="../scripts/autocomplete.js"></script> <div> <input type='text' class='search_input' name='search' id='search' placeholder='search' autofocus onkeypress='search_func("http://webfarm.io/subs/homefront/list_articles.php" , "search_output")'> <div id='search_output' class='search_output'></div> </div> Javascript: function search_func( href , target){ var search = $("#search").val(); search = $.trim(search); if(search){ $.ajax({ method: "POST", url: href , data: { search: search } }) .done(function( msg ) { target.innerHTML = msg; // as above, data holds the result of the request, so all the data returned from your results.php file are in this param but please see below; console.log(msg); }); } else { target.innerHTML = ''; } } What am I doing wrong? Why won't it produce the desired results? Sorry if I'm looking like a help vamp, but I'm not trying to be.
  8. I'm trying to build a facebook login for part of my php page, and was wondering if you can help me get the session creation setup? When I go to the login view it doesn't allow you me to run it as anything, but don't see how to setup the login with session[] stuff.
  9. swapcontent() is a page content swapper like in frames, which are now dead.
  10. target is a variable, not a constant, so i can't put it in quotes.
  11. Yes, it works until I run swapContent(). No, just a single run, not whenever found on the page through soft refresh. I solved it temporarily with a hard refresh just for that page. I'm asking why it only triggers once on the page in the jquery forum: https://forum.jquery.com/topic/errors-between-ajax-and-accordian It could be a bigger problem than just accordion.
  12. this is my jquery imports: <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"> <script src="//code.jquery.com/jquery-1.10.2.js"></script> <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
  13. Here's the example of what I have for compliant code: <div id="accordion"> <h3></h3> <div> </div> <h3></h3> <div> </div> <h3></h3> <div> </div> <h3></h3> <div> </div> <h3></h3> <div> </div> </div>
  14. my function works, but they're suggesting improvements to it.
  • 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.