363 Posted Topics
Re: Hi. You can set the [icode]onchange[/icode] event to trigger a function to calculate the new price. [code=html] <select name="MySelect" onchange="javascript: SetPrice(this);"> <option selected="selected">1</option> <option>2</option> <option>3</option> <option>4</option> </select> <p id="Price">$3.50</p> [/code] Which could look something like this: [code=javascript] function SetPrice(box) { elem = document.getElementById('Price'); newPrice = 3.5 * parseInt(box.value); elem.innerHTML = … | |
Re: I would look into something like [URL="http://www.google.com/sitesearch/"]Google's Site Search[/URL]. Much easier than creating a script to search all those static pages. | |
Re: Hi. The onload event and the AJAX code it executes looks like it's working fine. The problem is that the onload event is not triggered until everything on the page has been loaded and the JavaScript in your "layer18" <div> appears not to be working as it should. In IE … | |
Re: Hi. Are you sure that the path is correct? Personally, I would add files like that in the include path so I wouldn't have to worry about stuff like this. To find the include path, create a new PHP file with this code: [code=php] echo ini_get("include_path"); [/code] That should show … | |
Re: Not knowing exactly what your other functions do, you could try sending the values along as parameters to the callback function. Something like: [code=javascript] var ajaxObj; function AjaxFunction(par1, par2) { callback = function(){ AjaxCallback(par1, par2); }; ajaxObj = GetXmlHttpObject(callback); ajaxObj.open("GET", "http://example.com"); ajaxObj.send(null); } function AjaxCallback(par1, par2) { if(ajaxObj.readyState == 4) … | |
Re: Hi. Try changing the name of the submit button. The hidden field and the submit button have the same name, and because the button is later in the markup, it will probably override the hidden field when the form is submitted. | |
Re: That's a tall order! It would certainly require much more than just PHP. You would probably have to build a sort of "spider", like search engines use, which would go around scanning every host it can find. Or you could always simply try using [URL="http://php.net/curl"]Curl[/URL] to do a Google search … | |
Re: Hi. It shouldn't do that, no. You code works like expected on my server. Using the following code: [code=php] $comment = $_POST['comment']; if(get_magic_quotes_gpc()) $comment = stripslashes($comment); echo nl2br(strip_tags(mysql_real_escape_string(htmlentities($comment,ENT_QUOTES)))); [/code] The following string: [ICODE]He said: "What's up?"[/ICODE] Is converted into : [ICODE]He said: "What& #039;up?"[/ICODE] (Added a space in the single-quote … | |
Re: Hi. I'm not sure your view on PHP sockets is accurate. (Although I could be misunderstanding you.) They can of course be used in the manner you described, but I see no reason why they can not be used like you would use sockets in any other language. Take a … | |
Re: There is a lot in that code that doesn't make sense. (Not helped by the lack of [code] tags) First of all, the implode function is being called using a variable ($value) that doesn't exist. (At least nowhere in the code you posted.) And you are handling the check-boxes from … | |
Re: Aren't you using the wrong variable in your AJAX URL string? You assign the "search17" element to the "proc17" variable and then use that in your URL. Shouldn't the "search17" variable be in the URL? | |
Re: Hi. The is definitely possible with PHP. Take a look at the [URL="http://php.net/gd"]GD extension[/URL], specifically the [URL="http://php.net/imagecopyresampled"]imagecopyresampled[/URL] function. | |
Re: This can happen if your PHP is configured to ignore short tags, that is if the short_open_tag parameter in your php.ini is set to false, and you are using short tags (<? .. ?>). Make sure all PHP code is inside (<?php ... ?>) tags and not (<? .. ?>). |
The End.