1,038 Posted Topics
Re: You have the statement correct but you don't need those extra parenthesis [code=php] if ($Series == "D" && $ModelYear == "2"){ echo "Skylark"; } else { echo "This is not a valid Series"; } [/code] That should work just fine, I'm not entirely sure what the problem is. | |
Re: It's not a Firefox bug its that you're only coding for IE. Use this to get your request object [code=javascript] var XMLHttpFactories = [ function () {return new XMLHttpRequest()}, function () {return new ActiveXObject("Msxml2.XMLHTTP")}, function () {return new ActiveXObject("Msxml3.XMLHTTP")}, function () {return new ActiveXObject("Microsoft.XMLHTTP")} ]; function createXMLHTTPObject() { var xmlhttp … | |
Re: \s is the control character for whitespace (tabs, spaces, and newlines) so just add that to your regex which is also not working as you think it should given that you aren't escaping regex control characters. It should be something along the lines of [code=php]$something = preg_replace('/[^\w~!@#\$%&\*\(\)\-=\+'\|:;",\./\?\s]/','',$something_else);[/code] | |
Re: [QUOTE=sDJh;619206]Of course you can. Basically everthing ist possible with PHP, even complicated stuff when you extend it with system-specific functions. Things that generally cannot be solved in PHP: - JAVA (Chat, Games) - Flash (Animations, Games) - JavaScript (Eventhandling and Website-manipulation)[/QUOTE] That's not entirely true, PHP has functionality to import … | |
Re: Query strings are used when you need to send data through the URL. [code=html]<a href="somePage.php?first_name=Foo&last_name=Barr">Barr, Foo</a>[/code] When a user clicks on that link it will send them to the page [icode]somePage.php[/icode] with the following data. [code]first_name = Foo last_name = Barr[/code] The first variable is appended to the url with … | |
Re: I believe JQuery can take a class as a parameter something like $('.classname') rather than $('#id') | |
Re: I'm pretty sure it has to be surrounded with quotes, ie., [code=sql]SELECT first,last, number from friend WHERE id IN ('1','2','3','4')[/code] | |
Re: You set the form's action to [icode]<?php echo $_SERVER['PHP_SELF'] ?>[/icode]. The page will post back to itself. | |
Re: It's called [url=http://www.google.com/search?q=php+pagination]pagination[/url] | |
Small script to pull information from [url=http://trac.edgewall.com/]Trac[/url]. Note that this will [b]only[/b] work if you set up your trac environment to use a MySQL database (It is pretty simple to switch from SQLite to MySQL though). It uses template format just to make it easy to customize. I originally had … | |
Re: Given that Visual C++ 6 is 10 years old I would bet the farm that it's compatibility. I would highly suggest you upgrade to a version newer than a decade old. | |
Re: That is called a favicon, it's pretty easy to implement just toss this in your [icode]<head></head>[/icode] section. [code=html]<link rel="shortcut icon" href="location of your image here" type="image/type here" />[/code] So if I had an image called myFavicon.jpg I would use. [code=html]<link rel="shortcut icon" href="myFavicon.jpg" type="image/jpeg" />[/code] | |
Re: Any particular reason why you're disabling cookie functionality, that would solve your problem right there. | |
Re: You don't use [icode]endl;[/icode] after [icode]cin[/icode] you use it after [icode]cout[/icode]. [icode]cin[/icode] is used for input. Please use code tags as well | |
Re: Depending on what languages the scripts are in, PHP, Perl, etc. you have to make sure that your hosting provider supports and/or can enable support for the languages. | |
Re: The same holds true for PHP for both variables and functions. [code=php] class SomeClass{ private $test1; public $test2; private getTest1(){return $this->test1;} public getTest2(){return $this->test2;} }[/code] Then if you try to access them [code=php]$blah = new SomeClass(); $test1 = $blah->getTest1(); //error $test2 = $blah->getTest2(); //works[/code] | |
Re: [code]<input type="hidden" value="<?=$rand ?>" name="rand" /> [/code] The [icode]method[/icode] only applies to the form tag. | |
Re: You don't need a database to use Ajax. Ajax's purpose is to allow you to send asynchronous requests to a separate page and handle that request (hence the name). You can, if you want, make a request to a page which interacts with the database but Ajax itself shouldn't really … | |
Re: [code=html] <input type='checkbox' name='someArray[]' value='1' /> <input type='checkbox' name='someArray[]' value='2' /> <input type='checkbox' name='someArray[]' value='3' />[/code] Then in PHP [code=php] $someArray = $_REQUEST['someArray']; foreach($someArray as $key=>$someElem){ $query = "DELETE FROM someTable WHERE id = ".$someElem; } [/code] | |
Re: The div should look like this if you want it to be hidden in the first place. [code=html]<div id="testDiv" style='visibility:hidden'>[/code] | |
Re: Have an empty div with an online attribute ie., [code=html]<div style='height:100px;width:100px;position:absolute;top:0px;left:50px;z-index:9' onclick='window.location="www.google.com";'> </div>[/code] With that, if someone clicks anywhere in that 100x100 box 50 pixels from the left edge they will go to Google. | |
Re: OK, there is another post that deals with almost the exact same topic. You can't use relative links in emails. The recipient's email client doesn't know what or where resetPassword.php is, nor does it know where 'images/emailNotGone.png' is. You have to use [b]absolute[/b] links, ie., [url]http://www.example.com/resetPassword.php[/url] | |
Re: You would test the form field with a regex like this. (10, 2) in database means 10 numbers, 2 decimal places. so 12345678.90 is valid. [code=javascript]var testRegEx = /[0-9]{1,8}\.?[0-9]{0,2}/ var isValidNumber = form.formField.value.match(testRegEx);[/code] | |
Re: Arrays are always dynamic in PHP as pritaeas pointed out. As in most of the dynamic data structures in C++, you can also use array_pop and array_push in PHP. | |
Re: As per pretty much every other reply on the forum to posts like yours, and as per the rules: Please show some effort before asking for homework help. | |
Re: That is because 'hand' is deprecated in lieu of 'pointer'. 'hand' only works in Internet Explorer. | |
Re: OK, exactly what part isn't working. Please describe your problem | |
Re: Firstly I would have to significantly disagree with the lack of good PHP books. The reason there are "good" books for Perl/Python is because the users of those languages are fanboys/fangirls and would hate to decry their precious language. PHP is so widely spread at this point it is absurd … | |
Re: ... Don't close the child page before the requests are completed? | |
Re: Well it can't be done with a normal select box, you have to pretty much hack a bunch of divs and/or spans together to act like a select box. It's been done with a few AJAX autocomplete scripts that you can tear apart. | |
Re: In syntax "markup" anything in angle brackets, < >, is a required field, anything inside brackets [ ], is optional. So [icode]DELETE FROM <table>[/icode] means that you [b]must[/b] have something where it says <table>, ie., [icode]DELETE FROM someTable[/icode]. That said the query format is [code=SQL]DELETE FROM <table > [, table … | |
Re: Make sure you go over to [url]http://www.php.net/releases/[/url] and check the changelogs for compatibility and major upgrades that can break code. Checking changelogs is always good practice when making an upgrade to prevent things like this. | |
Re: The images aren't working because you are using relative paths. You have to use absolute paths(with the domain included) to be viewable outside of the host domain. | |
Re: Well [url=http://www.daniweb.com/forums/post577446-2.html]this post here[/url] describes how to use modal divs, switching visibility of elements is all over the site so use the search box up in the right corner there. | |
Is it just me or have serif fonts become the new go-to font of Web 2.0 sites. Out the window with you old, boring sans-serif Verdana. Who needs you Arial? We have Georgia, glorious Georgia, or even *gasp* Garamond. Has the serif laid it's pointy edge into the blunt broadside … | |
Re: [code=php]if (isset($_COOKIE['$Username'])) $visits = $_COOKIE['$Username'];[/code] Never works because variables in single quotes ', aren't parsed. You need double quotes, ie., [code=php]if (isset($_COOKIE["$Username"])) $visits = $_COOKIE["$Username"];[/code] You have to do that for all of those variables in there. | |
Re: selectbox.options is an array. The add() function is a member of the Element family ie., [icode]selectbox.add(<elem>);[/icode] not [icode]selectbox.options.add(<elem>);[/icode] | |
Re: Any particular reason why you are escaping these variables in this section? [code=php] \$row1=mysql_fetch_array(\$content1); \$display_content1 = \$row1['content1']; print \$display_content1; print "<BR><BR>"; \$row2=mysql_fetch_array(\$content2); \$display_content2 = \$row2['content2']; print \$display_content2; print "<BR><BR>"; \$row3=mysql_fetch_array(\$content3); \$display_content3 = \$row3['content3']; print \$display_content3; print "<BR><BR>"; [/code] Aside from that, the unexpected $end error comes from a missing or … | |
Re: Use the onclick attribute with a function along the lines of [code=Pseudocode] Function EnableRadioButtons ( array Elements ) For each Element in Elements Set Element Enabled [/code] | |
Re: Well it really depends on how you want to build, I don't really have a lot of experience in CF and don't really care to but one of the main things that drew me to PHP was just how [b]much[/b] information there is out there for it, mainly due to … | |
Re: Well making the background dark is pretty easy with CSS (Modal CSS), however, the fading part requires some javascript. However, it is possible. to get CSS/DHTML to be completely cross-browser compliant even if it does require a bit of work. [url=www.quirksmode.org]QuirksMode[/url] has an excellent list of browser compatibility for CSS … | |
Re: If it's not containing the necessary variables then your "getvar" function isn't working correctly, which you don't have posted here. | |
Re: This is a little function I wrote to verify form fields, all you need is an div with the id "error" to take the output. [code=javascript] /** * Make sure required fields are set on a form * * @param elements Array of required field IDs * @param parentForm ID … | |
Re: Well the only thing you need for a modal window is two divs, and outer div to make the page modal and an inner div to hold the modal content. For example [code=html] <html> <head> <title>Blah</title> <style type='text/css'> .modal { z-index:998; height:100%;width:100%; position:absolute; left:0px;top:0px; } .modalContent{ z-index:999; } </style> </head> … | |
Re: You're never passing an argument to the findValue function. findValue requires an argument but it is never receiving one. | |
Re: Why would you create multiple instances of the same image with DOM manipulation instead of just setting the background image on the div with css which will automatically tile the image? | |
Re: While there is no browser integration that determines whether a specified window is open or not you could set a session bit once someone has visited the page then display the 'error' message if they visit it again with the bit set. | |
Re: Well if you're basing the creation on AJAX calls then you'd probably want to use a bit of DHTML instead of manipulating the innerHTML property, ie., [code=javascript] function addRadio(parentID, radioID,radioName,innertext,color) { parent = document.getElementById(parentID); newRadio = document.createElement('input'); newRadio.type = 'radio'; newRadio.id = radioID; newRadio.name = radioName; parent.appendChild(newRadio); newtext = document.createElement('span'); … | |
Re: As per the rules, Suomedia, it's good to keep things on the site. Solving problems through PMs, email and sending attachments makes things cumbersome and difficult to search through if someone else is sharing the problem. |
The End.