-
Posts
5,717 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Adam
-
Popup Form for each result from mysql database
Adam replied to visualazza's topic in PHP Coding Help
I'd reccommend selecting the buttons using a class name, as apposed to the ID (you shouldn't have multiple elements with the same ID anyway). That way you can then store the unique ID in question as the ID of the element, and then pass that to the loadPopup() function: $(".popupButton").click(function(){ //load popup loadPopup(this.id); }); Then declare the ID parameter in your function: function loadPopup(the_id){ // with a more fitting name of course Now you have the unique ID available within the function. Just select the hidden input and update it's value.. This method may be a little fallible just plainly storing the ID like that, so you may want to prepend it with "result:" or something and strip that part out in the function.. your call. -
Combining a Search textbox with multiple dropdowns
Adam replied to swatisonee's topic in PHP Coding Help
Sorry I'm a little confused, what exactly is your question? -
Popup Form for each result from mysql database
Adam replied to visualazza's topic in PHP Coding Help
You'll probably just need to amend the function to pass the current ID. Could you show the function and how you call it? -
Yes. When you call the function, pass the current element object to it using the "this" keyword: onclick="gothink_function(this);" It looks like your function is already expecting the element as a parameter, so instead of using: document.getElementById('myDiv') To create the element object, you can just use the object you passed to the function: function gothink_function(element) { if ( gothink == 0 ) { element.style.backgroundColor = '#D4DBE7'; gothink = gothink + 1; // alert(gothink) } else if ( gothink == 1 ) { element.style.backgroundColor = '#D49997'; gothink = gothink - 1; // alert(gothink) } } If you want you can also extend this further, to pass the colour you want use; but with the logic you have in place at the moment you'd probably need to pass 2 colours, 1 for gothink=1 and then the other for when gothink=0.
-
Popup Form for each result from mysql database
Adam replied to visualazza's topic in PHP Coding Help
You mean generate a link/button for each result of a query, that will then open a pop-up box containing a form with the hidden ID input? -
Firebug is only ever temporary. ignace was just suggesting to use it as a way to view the styles applied to the output text (i.e. to check if the colour is white on white background). If you provide a screen shot with the text selected with the 'inspect element' tool we should be able to tell you what's wrong; or even better a URL to a version available on the internet.
-
Ah, of course in your example you could just use: $stringData = "'$idselect'";
-
I believe he was having troubles trying to achieve the second output; with single quotes closing the string.. Basically using a single quote within single-quoted string. If I've confused you, this should work for you kiksy: $stringData = '$dbresult = mysql_query("SELECT * FROM PhotoUsers WHERE id = \'$idselect\'");'; fwrite($fh, $stringData);
-
Well then I don't think what you're asking is possible, in that with a single request there is only 1 response received. Why do you need to post the data back separately though? Why don't you just return all the data you need at once and parse it accordingly? curl_multi_exec may be of use to you, but that's only executing two cURL sessions / requests at once.
-
Would this be from the same cURL execution or 2 separate requests?
-
Escape the single quotes with a backslash. For example.. $str = 'it\'s';
-
20 minutes required a bump? What do you define as a "postback" exactly?
-
To be perfectly honest, reading the OP's first post I got the impression he wanted to pass a dynamic number of keywords from multiple inputs -- or something along those lines. In that case an array would have been the best solution... You don't like arrays?
-
By more specific, I meant relating to a particular piece of code or problem. You're pretty much asking someone to do the work for you right now though; which as I said would be better suited to the freelance forum.
-
I'd suggest posting this one in the freelance section, or make your questions a little more specific.
-
Perhaps seeing a little more of your code would help?
-
Combining a Search textbox with multiple dropdowns
Adam replied to swatisonee's topic in PHP Coding Help
..? -
Need an algorithm that can scan fulltext from MySQL database.
Adam replied to dawg00's topic in PHP Coding Help
You haven't actually said why you don't want to use boolean search. Why do you need another way of doing it when the MySQL manual is clearly stating that's the way to do it? -
What data type is your `message_date` field?
-
There's way too much going on, my eyes don't know where to look. Consider using a solid colour for the content area, this'll make the text easier to read and suppress the green leaves to the background...
-
Don't forget MrAdam Ha, thank you ignace.
-
Well then I'd go through the function, and within each construct checking it's reaching that point with an alert() - that way you'll find the exact break point.
-
http://www.php.net/manual/en/refs.crypto.php
-
You cannot send a header once you've outputted content to the page: $home='http://'.$SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']).'/editpart.php'; header('Location: '.$home); Why not process the form before you output any HTML?
-
Then how will the user read it later?