428 Posted Topics
Re: I am not sure what the point of $x is in that function besides being a counter. But this should solve your recursion issue. [code] <?php //Path to starting point $path = '/your/path/goes/here'; //Create a recursive directory iterator $iterator = new RecursiveDirectoryIterator($path); echo "<ul>\n"; $x=0; //Foreach iteration do something. foreach … | |
Re: [code=javascript] <script type="text/javascript"> document.write('Clock'); </script> [/code] But, seriously, how about you do some searching, try to put something together and when you have problems you post what you have so far and we provide you with some assistance. | |
Re: Just be very careful when working with values passed in the GET & POST arrays . Its extremely easy for them to be modified by the user and you have to be fully aware of this. Probably the most common thing i've seen is the usage of $_GET and $_POST … | |
Re: The problem you're having is $_FILES['userfile']['tmp_name'] is an actual filename. your destination is a directory without a file name. its trying to create a file named "uploads", which is a valid filename on a linux system, in your dw folder. Try actually giving the file a filename in the destination … | |
Re: check out [URL="http://www.mysqlperformanceblog.com/"]http://www.mysqlperformanceblog.com/[/URL] you will have to do some looking and some reading but provide a lot of really good information for performance tuning and/or what you can expect from both engines. | |
Re: Why even bother with all of the sanitizing when the php5 DOM does this for you. Check out the following code...it is based on what you originally posted and creates the same XML. Its not a perfect representation of what your script does but i wanted to make sure it … | |
Re: I think I have achieved what you were describing. There is some consolidation that could occur as there is minor repetitive code. [code=html] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function() { function toggleReq() … | |
Re: [QUOTE=Atli;887480] P.S. You should ALWAYS store dates and times in the standard date/time format (YYYY-MM-DD HH:SS), and store them in date type fields, to avoid problems just like this one.[/QUOTE] This is such a common topic that can be debated in so many different ways. The fact is BOTH the … ![]() | |
Re: They are two different technologies: php is server-side and will be executed on the server with the results being displayed to the user. jquery is client-side and will be executed in the user's browser. the only code it can modify is the html code that is delivered by the server. … | |
Re: Google for [URL="http://tinyurl.com/qrg3qm"]Wildcard DNS[/URL] | |
Re: Actually in a purely PHP file, the closing tag ?> should be excluded. It is necessary when you are jumping in an out of php control structures that are mixed with html or some other kind of output. | |
Re: Then the problem is in the code prior to: [code=php] echo '<tr>'. '<td>'.$row['title'].'</td>'.'<td>'.$row['category'].'</td>'.'<td>'.$row['year'].'</td>'. '<td>'.'<font size="2"><a href="edit.php?autoid="'.$row['autoid'].'"> edit</a></font>'.'</td>'.'<td>'.'<font size="2"><a href="delete.php?autoid="'.$row['autoid'].'" >delete</a></font>'.'</td>'. '</tr>'; [/code] as it doesn't appear to actually be returning an autoid. | |
Re: php simply isn't meant for this kind of thing, regardless of its intention, albeit yours is a pretty useless one. On the basis of an 8 character password, where each letter can be 1 of 62 possibilities (a-zA-Z0-9) that is 9.807971461541689e+55 possibilities. Good luck with that. | |
Re: Store a [URL="http://en.wikipedia.org/wiki/Unix_time"]UNIX Timestamp[/URL] in that mysql column. [code=php] <?php $iCurrentTime = time(); [/code] $iCurrentTime would result in an integer like: 1236884436 Which is the number of seconds since the Unix Epoch. You can pass that integer into the php date() function and format it any way you want, and … | |
Re: Does all that javascript do is show and hide a DIV? | |
Re: [code=php]header( 'refresh: 5; url=http://www.example.com' );[/code] Can also be a url relative to your site, like: home.php etc. | |
Re: What is the actual error message you are getting, and what is the value of $_SESSION['uid'] in this part of your code? [code=php] if($_SESSION['uid']){ /** Add the following line **/ echo $_SESSION['uid']; $sql = "SELECT id,username FROM 'users' WHERE 'id'='".$_SESSION['uid']."'"; $res = mysql_query($sql) or die(mysql_error()); if(mysql_num_rows($res) == 0){ session_destroy(); /** … | |
Re: I'm not sure if there will be a reliable alternative for the time being. This is due to the Y2K38 problem. [url]http://en.wikipedia.org/wiki/Year_2038_problem[/url] | |
Re: For starters, Zend Guard is a product for encoding your php in opcode *I believe the term is opcode*, it has nothing to do with securing a form or validating logins. Second, I'm going to make a big assumption here, and say that you're using javascript validation to verify that … | |
Re: Depends on the use case. I always use a database for information that needs to be related together. I couldnt personally say 50/50 or 80/20 etc because my uses of flat files vs databases changes depending on the project i'm working on. However, writing a text file is not just … | |
Re: While you can't directly set a cookie for a remote site with php, at least not from what I could tell with some quick tests. You can emulate it by calling a script on a foreign site and passing some values to it in the url. For example. [code=php] <?php … | |
Re: Are there parameters and if so do they need passed via GET or POST requests? cURL will allow for GET and POST requests, but file_get_contents will only be able to open urls that can accept GET requests. Since you're parsing XML and 90% of the web services I see work … | |
Re: For starters the above code has absolutely nothing to do with troubleshooting a connection to your database server. gagan22: Is your site throwing any php errors and/or any mysql connection errors? if you're not getting any errors or are simply getting a blank page, I would create a separate file … | |
![]() | Re: Are you trying to set something up, where as you make changes throughout the day, at a certain point, say once a night the server goes and compiles the source into a nightly build? If this is more of your intentions and it doesn't need to be absolutely on demand … ![]() |
Re: Are they both database driven, and do you have access to both databases? | |
Re: [url]http://www.swiftmailer.org/wikidocs/v3/sending/bounce_address[/url] [url]http://www.swiftmailer.org/wikidocs/v3/misc/logging[/url] I believe both of those pertain to what you're looking for. | |
Re: I disagree with CAPTCHA on the login form. If a bot is trying to log into a site via a login form then that makes the assumption that the bot has already registered an accout or is attempting to brute force its way in. On the login side of things, … | |
Re: You could also create a new table for saved form data and then serialize your POST or GET array depending on how you're passing your form data. Then store the serialized data in the table and relate it to your form in a way that makes sense to your code. … | |
Re: [code=php] <?php $xYahooXML = ' <ysearchresponse responsecode="200"> <prevpage> /ysearch/web/v1/sunflower%20seeds?appid=e4j0dGfIkY0.VnPaj_m8JivWDmAdWAV50uTRuIaqvA--&format=xml&count=1&start=0 </prevpage> <nextpage> /ysearch/web/v1/sunflower%20seeds?appid=e4j0dGfIkY0.VnPaj_m8JivWDmAdWAV50uTRuIaqvA--&format=xml&count=1&start=2 </nextpage> <resultset_web count="1" start="1" totalhits="376055" deephits="11600000"> <result> <abstract> Home to the <b>seed</b> brand featuring products, nutrition facts, and more. </abstract> <clickurl> http://lrd.yahooapis.com/_ylc=X3oDMTRrYzhoc210BF9TAzIwMjMxNTI3MDIEYXBwaWQDZTRqMGRHZklrWTAuVm5QYWpfbThKaXZXRG1BZFdBVjUwdVRSdUlhcXZBLS0EcG9zAzEEc2VydmljZQNZU2VhcmNoV2ViBHNsawN0aXRsZQRzcmNwdmlkA2ZIUnh2RVBEQjJHQjIxOF9zZjhLc3dsa1RNTzJsa21qWS5FQUE2WkI-/SIG=10v00dabm/**http%3A//www.davidseeds.com/ </clickurl> <date>2008/12/12</date> <dispurl>www.<b>davidseeds.com</b></dispurl> <size>7122</size> <title>David <b>Sunflower</b> <b>Seeds</b></title> <url>http://www.davidseeds.com/</url> </result> </resultset_web> </ysearchresponse>'; $oSimpleXML = new SimpleXMLElement( $xYahooXML … | |
Re: This is one of the weaknesses of php. You can not use php to check the file size until AFTER the file/image has been SUCCESSFULLY uploaded to the server. You also can not use javascript to access the client side file system. This is an area where i see Adobe … | |
Re: That would be an AJAX auto complete/auto suggest feature. Have you even tried looking for [URL="http://lmgtfy.com/?q=ajax%2C+autocomplete%2C+php"]examples[/URL]? | |
Re: This almost looks like you're trying to work with a java or javascript object instead of php. In PHP it would be something like: [code=php] $rs = $sql->Execute('SELECT ... '); if( $rs->rowCount > 0 ) { return true; } else { header('Location: expired.php'); exit; } [/code] Are you getting any … | |
Re: Can i ask what your implementation of this is? Hoe are you using it, and why do you need to display a floating div in front of the page to tell the user it is loading? I'm not criticizing or anything, I just don't think i've ever seen something like … | |
Re: I would like a double cheese burger and a large shake, and yes, I do want fries with that... I will trade that for some code, do you take code? [code=javascript] for($i=1; $i>0; $i++) { alert( 'Here is some code'); } [/code] Alright since you didn't make any effort to … | |
Re: Why does the page value need to be passed in the url? Will it always be the same as the hidden field view? I ask because i see $_GET['page'] & $_POST['view'] being set to the same value. Here is a quick example of moving the value of "page" to a … | |
Re: The problem is not in the check_login.php file. The error is in your config.php file. You can NOT have ANY output from php prior to calling the header function. I assume you have something like the following in your config.php file: [code=php] <?php //Ignore the next line, it just reproduces … | |
Re: I believe you're talking about a "popup" that is more of a modal window then a true popup. This would mean creating a div that is positioned above the page and floats over everything else. Here's a quick example of how you could do this with jQuery and CSS. The … | |
Re: Here is a quick jQuery example, the alert shows the top and left position of the image. It also gives you a chance to actually see the javascript set the new position. Let me know if you need any more explanation. You can also check out the documentation for .position() … | |
Re: I see three options that you could pursue but since you posted this in the Javascript forum I'll assume you are not looking for a serverside solution using php etc., correct me if I'm wrong. With javascript you have two options, you could load the content for both pages into … | |
![]() | Re: If the server is configured to allow access from the outside world, then just use the ip of the machine to connect to it. At least in terms of cPanel you need to add external hosts to the permissions for connections outside of localhost. I *believe* DirectAdmin was/is the same … ![]() |
Re: After taking a quick look at their javascript it looks like they're simply overlaying a transparent image over the base map image when you hover a particular link. here is the link to the file that seems to be handling the overlay of the images. [url]http://www.findaproperty.com/fapmaps/js/0/0_1.js[/url] | |
Re: are you trying to toggle every check box on the page on and off? or just one checkbox? | |
Re: > Hi, > > Does anyone have a better idea of the ajax based login code, the one that does error checking etc, and also the member registration authentication. so far i have got an idea of the following!!! function doLoginAction() { $filter = new Zend_Filter_Input($_POST); if (!($login = $filter->testAlnum('login'))) … | |
Re: I built this on the jQuery library, its a very simple example with a lot of duplicated code that could be turned into a function or two. Hopefully some people with some older browsers can verify that it works, but it works in FF3, Opera 9.6, IE7 and Safari 3.2.1 … | |
Re: I would recommend [URL="http://phpmailer.codeworxtech.com/"]PHPMailer[/URL] or [URL="http://www.swiftmailer.org/"]SwiftMailer [/URL] for this task. Both handle attachments and html emails etc seamlessly, but both are also much more frequently udpated/patched etc. | |
Re: Try this example out. This uses jQuery to grab the css properties you want. Even on elements that do not have inline styles. This is what matters, it serves the jquery library from googles cdn, but this could be from a local copy too. [URL="http://docs.jquery.com/CSS/css#name"]jQuery CSS Documentation[/URL] Sends two alerts … | |
Re: how is your form setup? generally you would want a series of checkbox fields all called type[] with unique values. this way what you go to parse over the results in php, $_POST['type'] is an array of check values. [code=php] if(isset($_POST['type'])){ $type = $_POST['type']; echo 'You selected: ' . implode( … | |
Re: notepad++ zend studio, although i only prefer it over Eclipse PDT and Aptana because of its integration with PHPUnit. | |
Re: if you mean when typing in the textarea the text just continues on one long line, add wrap="physical" to the textarea markup. [inlinecode]<textarea name="" cols="" rows="" wrap="physical" class="" id=""></textarea>[/inlinecode] This will make the textarea wrap at word breaks [spaces] that are close to the end of the line. If it … |
The End.