1,038 Posted Topics
Re: Well if you want to implode the values and store it in the cookie then you'd explode it to retrieve it as an array. [code=php] $array = array('orange', 'green', 'blue'); $string = implode(',', $array); // 'orange,green,blue' $second_array = explode(',', $string); // array('orange', 'green', 'blue'); [/code] | |
Re: There might be something in includes/footer.php that's doing it. As a side note a meta refresh tag goes in the head section, not the body. Post the entirety of the code so I can at least run it through phplint to see if there are syntax errors :) | |
Re: Is it a requirement that you code all of the AJAX library by hand. If not you might want to take a look at [url=http://www.jquery.com]jQuery[/url]. Otherwise, what is the error you're getting. | |
Re: What do you mean? rows/cols attributes work the same as far as I know | |
Re: Well what line is the debugger telling you the error is on? | |
Re: There's no such thing as a conditional insert, it just appends to the end of the table. Do your conditional in PHP. | |
Re: That's just about as vague a question one could ask. What about mail servers? | |
Re: Well, firstly, for all that is good in the world, please, please stop using @. Secondly, you already have pid, why assign it again? | |
Re: There aren't any drag&drop IDEs for PHP that I know of since PHP itself never touches the front end. [url=http://www.zend.com/en/products/studio/]Zend Studio[/url] is probably one of the best out there (You can download a free version though there is a paid version), there's also the [url=www.eclipse.org/pdt/]PDT project[/url] which is a extension … | |
Re: Firstly, your loop should be a while, not a do-while. (A do-while will always run at least once even if your condition fails which you don't want). Secondly, would you post your code that's handling the POST. All we see now is your form. | |
Re: Firstly [code=php]$query = "select * from `music` WHERE `music`.`catid` = '" . $catid . "'";[/code] can be simplified to [code=php]$query = "SELECT * FROM `music` WHERE `catid` = '$catid'";[/code] To order you would have [code=php]$query = "SELECT * FROM `music` WHERE `catid` = '$catid' ORDER BY `artist`";[/code] Typically pagination is … | |
Re: It's as if what doesn't handle it at all. define doesn't return anything accept true/false whether it successfully declared the constant or not. What exactly are you trying to do? | |
Re: The query is failing, post the query and we might be able to fix it. | |
Re: You don't need a switch statement [code=php] <?php $day = intval($_GET['day']); if($day >0 && $day <8) { include('day' . $day . '.php'); } else { echo 'Invalid page'; } ?> [/code] | |
Re: ORMs exist to make the life of a developer easier, so you aren't manually dealing with physical resultsets from mysql_fetch_array all the time. Also, having an ORM allows you to attach functions to certain objects ie., you want to be able to perform drawCircle on every Circle saved to the … | |
Re: Yeah, try that giant SITE SEARCH on the right that takes about 30% of the top of the site. | |
Re: There is no way to force a user to automatically open a file. If there was it would be a huge security risk. | |
Re: Well, looking through a few of them they could use some improvement, most notably the hex to rgb function, hexdec is your friend. [code=php] function torgb($string) { $string = str_replace("#","",$string); $r = substr($string, 0, 2); $g = substr($string, 2, 2); $b = substr($string, 4, 2); return array(hexdec($r), hexdec($g), hexdec($b)); } … | |
Re: well cURL is actually a program in and of itself which can send http requests along with a large number of different protocols. Usually an "HttpRequest" is a Javascript object used to make AJAX calls. | |
Re: Your best bet would be to read the Drupal tutorials on their homepage | |
Re: Why is it you can't use AUTOINC for your primary key? I don't really get your explanation of why you can't. | |
Re: Exactly, that's why most people here probably wont and shouldn't help you with this. | |
Re: It's called AJAX, once you know the term you'll have more articles then you'll know what to do with. Have fun. | |
Re: Do you understand what these lines do? [code=c++]*(boardSkin +(row * columns) + column)[/code] You're setting a memory address to a value, that above line is the same thing as saying [icode]boardSkin[((rows*columns)+column)][/icode]. (I think, its been a LONG, LONG time since I've used [icode]*(array + offset)[/icode] notation, probably because it unnecessarily … | |
Re: [code=php] $keywords = array('value2','value1','value'); $replace = '<a href="webpage.php?view&id=\1">\1</a>'; $search = '/('.join('|',$keywords).')/'; preg_replace($search, $replace, $source); [/code] I've reversed the keywords because the grouping will be non-greedy so if you place 'value' first it will never find value1 or value2 | |
Re: Actually, the php.net page does have an installation guide. [url]http://us3.php.net/manual/en/svn.installation.php[/url] | |
Re: [url=http://www.getfirebug.com]Firebug[/url] | |
![]() | Re: replace test.html with the name of your file [code=bash] sed -r "s/<Url>([^<]+)<\/Url>/\nURL: \1\n/g" test.html | grep ^URL: | sed -r "s/^URL: //g" [/code] This will give you a newline delimited list of the URLs Also, in the future you can use the following command to clean the XML (requires Tidy) … ![]() |
Re: there is no such thing as a double in hex. Use [icode]hexdec[/icode] to convert to an integer then explicitly cast the return to a double. [code=php] $someHEx = "0x01A"; $someDouble = (double)hexdec($someHex); [/code] | |
Re: Also, you don't need a ; at the end of a while and mysql_fetch_assoc is the same as mysql_fetch_array($resultset, MYSQL_ASSOC) | |
Re: C++ does not have anonymous functions. However, C++0x standard does using the following syntax (using a std::for_each as an example) [code=c++] std::map<int, int> someMap; // ... ... std::for_each(someMap.begin(), someMap.end(), []( std::pair<int, int> map_entry ) { // ... lambda body }); [/code] The initial [] leading the arguments defined what should … | |
Re: [url]http://php.net[/url] is an amazing resource if you're using PHP its a good idea to get very familiar with it. | |
Re: Make sure you don't have IIS installed or running or that any other program you have running is starting a web server. | |
Re: Depends on your needs. If you only need GET parameters then file_get_contents should be fine. cURL on the other hand allows for much more customization in headers sent. | |
Re: You'd actually want to use Apache itself to do the load balancing, not PHP. Using things like [url=http://httpd.apache.org/docs/2.2/mod/mod_proxy_balancer.html]mod_proxy_balancer[/url] This is assuming you're using Apache | |
Re: Remove the space, the url variable is still a variable, never put spaces in variables. | |
Re: [QUOTE=ahmksssv;818927]Hi frnds... I need to integrate php variable with vedio scripting file..... i fetch my vedio file path from database...here i need to replace the file=[B]videos/movieimgae.swf[/B] ....with $vedio.. [/QUOTE] [CODE=php] <?php $video="vedios/aaa.php"; ?> <script type="text/javascript"> var s1 = new SWFObject('player.swf','player','400','300','9'); s1.addParam('allowfullscreen','true'); s1.addParam('allowscriptaccess','always'); s1.addParam('flashvars','file=[B]<?php echo $video ?>[/B]'); s1.write('preview'); </script>[/CODE] | |
Re: You could just use form method POST | |
Re: It might not be the error that's causing your problem but remove the semicolon after the second if statement | |
Re: [icode]^(.+?):(.+?)$[/icode] That's pretty much it. That's a pretty simple regex, you might want to study them for yourself [url]http://www.regular-expressions.info/[/url], it's a pretty decent resource. | |
Re: Firstly, this should be in the HTML forum, secondly [code=html]<img height="32" width="32" src="blah.jpg />[/code] ... ... | |
Re: 1) You're missing an ending ) on the first line of your JS 2) "Gray" isn't a safe CSS color, use #ccc | |
Re: There's no need to use a regular expression for that [code=php] $string = 'Name: Bob, Age: 20, Details: Likes chocolate'; $properties = explode(",", $string); $result = array(); foreach($properties as $property) { $split = explode(":", $property); $result[$split[0]] = $split[1]; } print_r($result); /* Array ( [Name] => ' Bob', [Age] => ' … | |
Re: It's just me but I'm pretty sure you would contact Paypal about that sort of thing. | |
Re: A) Don't iterate through POST variables if you're doing any sort of key/value assignment. I (as a user) can put anything I want into POST and given that you're [icode]eval[/icode]ing the code you immediately just opened yourself up to every attack under the sun B) Why the heck are you … | |
Re: The problem with that almostbob is that if you have a switch-case with 1000 lines of code you're a horrible programmer to which the "goto" is only the stamp on your forehead to label(no pun intended) you as such. | |
Re: [LIST=1] [*]Build Website [*]Advertise [*]... [*]Profit [/LIST] |
The End.