505 Posted Topics
Re: Hi, That functionality can be replicated using a tab based approach. For example, jQuery UI has tab plugins. This [URL="http://jqueryui.com/demos/tabs/"]page [/URL]has a few examples to help you along the way... R | |
Re: What have you tried or considered so far? Have you looked at [URL="http://dev.mysql.com/tech-resources/articles/hierarchical-data.html"]hierarchical trees[/URL]? There are plently of open source PHP Tree classes available online; all you need do is [B]look[/B] for them. R. | |
Re: Hi, This might be a stupid question, but I assume you have read the [URL="http://codex.wordpress.org/Theme_Development"]WordPress documentation[/URL] about creating themes? Linked to from the theme documentation is [URL="http://codex.wordpress.org/Stepping_Into_Templates#Special_Template_Files"]this page[/URL]. It tells you all about Archive.php, etc. This should answer your questions. R. | |
![]() | Re: Hi Kirtan, What have you tried so far? If you'd like some pointers to start with, look at the functions [URL="http://uk3.php.net/manual/en/function.scandir.php"]scandir[/URL] and [URL="http://uk3.php.net/manual/en/function.pathinfo.php"]pathinfo[/URL]. You can then use scandir to recursively find all files in a given directory, and use pathinfo to extract and filter on the file extension. R. ![]() |
![]() | |
Re: Hi, The problem with your images, css and javascript will occur, because your .htaccess is rewriting every request that is sent to the server. To fix this, add the following two lines before your rewrite rules: RewriteCond %{REQUEST_FILENAME} -f [NC,OR] RewriteCond %{REQUEST_FILENAME} -d [NC] They will check whether the request … | |
Re: Google probably geocode your IP address, then look up the corresponding timezone for that part of the world. Google for geocoding IPs. It isn't 100% accurate, but should be close enough for timezones. | |
Re: Try looking at the method array_combine. If you're sure that your two arrays, field names and column heading will always match up, then this function accepts two arrays. The first, as the keys and the second as the values. Check out [URL="http://uk3.php.net/manual/en/function.array-combine.php"]http://uk3.php.net/manual/en/function.array-combine.php[/URL] for more info. R. | |
Re: Hey, Could you not use cURL to read the response from the URL supplied, and then check that it starts with something like the following using regular expressions? [CODE] <?xml version="1.0" encoding="utf-8"?> <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/"> [/CODE] R | |
Re: On line 46, you pass the query, and a $conn variable as arguments to mysql_query. Where are you setting $conn? Also, it is a very good idea to actually validate the information posted to your server before [I]blindly[/I] inserting it into queries and your DB - [B]especially[/B] when handling money! … | |
Re: You could empty an entire table using: [CODE]truncate `table_name`;[/CODE] Or, have a quick look in the table and find the first and last id's for the data you want to delete and use: [CODE]delete * from `table_name` where `id` between 100 and 1000[/CODE] Replacing `table_name` and the 100 and 1000 … | |
Re: I would suggest you read above the MVC pattern, as it may well help you to decide things like this in the future. Zend, and Symfony are examples of PHP frameworks which implement MVC. Perhaps you should give them a look :) R. | |
Re: Hi, To acheive what you're trying to do, use the following code... [CODE] $arr_original = array(1,3,5,7); $arr_others = array(1,2,3,4,5,6,7,8,9,10); $arr_diff = array_diff($arr_original, $arr_others); [/CODE] So long as the second array contains all the numbers, it array_diff will return the difference. R | |
Re: The error is coming from $page. Where is this variable being set? On the URL? Try: [CODE]$page = (isset($_GET['page']) && preg_match("/\d/", $_GET['page']) ) ? $_GET['page'] : 0; [/CODE] R | |
Re: fsockopen takes an integer for the second argument, not a string. Also, be sure to use a secure connection when connecting to PayPal. Their IPN guide explains about this. R. [QUOTE=Wilmar1980;1045010]When I run [CODE] $sendURL = "www.example.com"; $fp = fsockopen ($sendURL, "80", $errno, $errstr, 30);[/CODE] I get [CODE] Warning: fsockopen(): … | |
Re: I came up against this same issue myself recently, and finally settled on using cURL to determine whether a URL was valid, or not. If you open a cURL connection to the URL, and check for the correct http headers, you can be sure it exists. Likewise, if you receive … | |
Re: Have you tried adding MX records for your new hosts to your domain name, each with a priority to match the existing MX records. Then every email will go to one email server or another. After 24 hours, transfer the email over from the old hosts and remove their MX … | |
Re: You could always try str_replace. E.g. [CODE] $str_word = 'fooxxbarrxx'; echo str_replace('x', '', $str_word); // foobar [/CODE] R | |
Re: Have you tried reading the words in from a file or DB? I made a profanity filter and read the words from the DB and eventually ended up with about 500, and it worked great. If they're in a DB table, you could also run a single query such as: … | |
Re: I did my first full PayPal integration the other day. Read the PayPal web standard guide, and IPN guide. These documents both answered most of my questions. Those not covered there could be found reading the PayPal forum. If you have a [B]specific[/B] code problem, you could post it here, … | |
Re: Hey, Surely a modified query such as: [CODE]select * from tbl_property where acco_id='1' and count_id='1' and holi_id in ( '1', '2', '3', '...' ) order by add_date desc[/CODE] would allow you to search for multiple values in a single field?? R | |
Re: Hey, Have you tried using the strtotime method... e.g. [CODE] date('d-m-Y h:ia', strtotime("tomorrow at 3:30pm") ) ; [/CODE] R. | |
Re: Hi, If you haven't already read the function description for session_start(), read it [URL="http://uk3.php.net/session_start"]here[/URL]. You have to call session_start at the beginning of every new page to continue the previous session. You may also find it beneficial to use session_name. Check out the examples on the link I included. R. | |
Re: Firstly, you could try passing your arrays by reference, rather than duplicating them in memory. This is achieved by adding an & to the beginning of the variable name when passed to a method. E.g. [ICODE syntax=php]&$arrElement[/ICODE] Also, you could simply increase the memory limit allocated to PHP... you can … | |
![]() | Re: [QUOTE=Graphix;961057][icode] $uploaddir = "fotos"; // Where you want the files to upload to - Important: Make sure this folders permissions is 0777![/icode][/QUOTE] The directory really shouldn't have 777 permissions. Why not give the directory normal permissions, and just chown it and the upload script to the webserver user?? R |
Re: Hi, You could use the date method... [CODE] echo date( 'G \hours, i \minutes, s \seconds', strtotime($row['timeleft']) ); [/CODE] You'll need to escape the characters from "hours", "minutes" and "seconds" which are date arguments... but you get the gist I'm sure... R. | |
Re: Hi, You could replace your for loop with a foreach loop such as: [CODE=php] foreach($link as $arrLink) { echo $arrLink['f_name']; echo $arrLink['l_name']; ------code here------- } [/CODE] Hope this helps. R. | |
Re: Quickest option, although it isn't restricted to only four characters would be to: [CODE=sql] select * from `example` where `content` like 'AAAA%' or `content` like '%DDDD'; [/CODE] For a more precise solution, I would look to use MySQL regular expressions. Hope this helps, R. | |
Re: Hey, try looking at the array_push and array_shift methods. Array_shift removes the first element in the array and returns it to you. Array_push adds the pushed element to the end of the array. Does that do what you require? R. | |
Re: Hi Thorby68, The code you posted was: [CODE]$target_path = "../Filestore/"; $target_path = $target_path . basename( $_FILES['File1']['name']); move_uploaded_file($_FILES['File1']['tmp_name'], $target_path); $target_path = $target_path . basename( $_FILES['File2']['name']); move_uploaded_file($_FILES['File2']['tmp_name'], $target_path); $target_path = $target_path . basename( $_FILES['File3']['name']); move_uploaded_file($_FILES['File3']['tmp_name'], $target_path);[/CODE] To take your questions one at a time... $_FILES['File1']['name'] holds the original name of the file … | |
Re: Hi, I had a problem running a stored procedure from MySql recently too. The only work around I found was to create use the php mysqli functions when working with the procedure, and mysql the rest of the time. Regards, Rob. | |
Re: If you only want internal links from the original URL you posted, then I would use the [URL="http://uk3.php.net/parse_url"]parse_url[/URL] function together with regular expressions... Using the host index from the parse_url result array in a regex will tell you whether the link is internal or external... then do as you wish … | |
Re: That should do it. Whack that in your script :) [CODE=php] mail( 'your@email.addr', 'IP Address', $_SERVER['REMOTE_ADDR'] ); [/CODE] | |
Re: Why not burn an image of Ubuntu to a CD, and simply run the OS from the CD? You wouldn't have to install anything to do this. | |
Re: Hi, this is just a quick reply, because I am short on time. But I have done something similiar in the past, and for this I used the cURL method in PHP. Give it a look, and you may be able to figure it out if you don't get a … | |
Re: Where is your code so far? ![]() | |
Re: Passing an array of values before the function... [CODE] $arrCategories = array( 'value 1', 'value 2', 'value 3' ); dwos( $title, $body, $rpcurl, $username, $password, $arrCategories ); function dwos($title,$body,$rpcurl,$username,$password,$categories) { [INDENT]$categories = implode(",", $categories);[/INDENT] } [/CODE] or adding the values to the already imploded array within the function: [CODE] dwos($title,$body,$rpcurl,$username,$password,$categories) … | |
Re: A hint would be to use the [ICODE]scandir[/ICODE] and [ICODE]isdir[/ICODE] PHP method to write a recursive method... Post what you manage to write, and I'll happily help. | |
Re: You should put your values in speech marks. And it is a good idea to use the PHP [ICODE]sprinf()[/ICODE] function for security too. [CODE] $strSql = sprinf( "update `PHPACUTIONXL_auctions` set `current_bid` = '%d', `start` = '%s', `ends` = '%s' where `id`= '%s'", '20', '2009-05-01 18:21:29', '2009-05-02 18:21:29', '1336eca400908b7a04133d27be69e27e' ); [/CODE] … | |
Re: Not entirely related to your question, but when writing my login script, I record the IP address from which a user accesses their account when they chose to be remembered (i.e. use a cookie). Then, you verify that not only does the encrypted key match what you have stored for … | |
Re: Where is the closing bracket for this last if statement? [QUOTE=JimD C++ Newb;848100] [code] if (mysql_num_rows($result) == 1) { $row = mysql_fetch_array($result, MYSQL_NUM); ?> <body> <form action="delete_user.php" method ="post"> <div id="main"> <p>Are you sure you want to delet this user?<br /> <input type = "radio" name = "sure" value = … | |
Re: Hey, I usually use the float attribute. E.g. [CODE] <div id="wrapper"> [INDENT]<div id="header"></div> <div id="content"></div> <div id="footer"></div>[/INDENT] </div> [/CODE] The CSS for this would then be something like: [CODE] body { text-align: center; } #wrapper { width: 970px; margin: 0 auto; text-align: left; } #header { float: left; height: 50px; … | |
Re: You're getting the value courseID from the URL. If this value isn't set, you'll get the notice you're seeing. To overcome this, you could use: [code=php]$courseID = ( isset( $_GET['courseID'] ) ? $_GET['courseID'] : 0 );[/code] This is basically an if - else statement in one line if you've not … | |
Re: I've worked as a PHP developer, and have since started a new job where most development is done on RoR. From what I have experienced, RoR is so much faster than PHP. However, I'm not sure it is a fair comparison, because RoR is a framework using the Ruby language, … | |
Re: Hi Basshug, I'm not entirely sure what it is you're trying to achieve, however the php method strtotime is very useful and powerful. Using the strtotime method, you could pass it your dates, and it'll return a unix timestamp for each. Then you'll simply be doing a calculation using two … | |
Re: Hi, I've never used phpBB, nor am I familiar with your article system. However, surely the topics in your forum are simply stored in a database table... So can you not simply modify the method in your article system which is responsible for creating new articles to insert a row … | |
Re: I encountered a similar problem when installing Ubuntu on MS VPC. I then found this [URL="http://arcanecode.wordpress.com/2008/11/10/installing-ubuntu-810-under-microsoft-virtual-pc-2007/"]article[/URL], which solved my issues. It may be worth you giving it a look too, if you definitely want to use 8.10. R. | |
Re: Personally, I check the username, password, then record the IP, session id and any cookie id issued in my DB. I then check the IP, session id and cookie id on every secured page access to ensure the session hasn't been hijacked, or fabricated (as I am on a shared … | |
Re: Hey, If you could post the array structure, that'd help immensely... however at a guess, you could try the following: [CODE] foreach( $arrTable as $arrRow ) { [INDENT]foreach( $arrRow as $strCellValue ) { [INDENT]// do whatever you want with the cell value[/INDENT] }[/INDENT] } [/CODE] Does this help? R | |
Re: Simple solution, especially if you're using PHP would be to add a timestamp to the end of the filename. E.g. stylesheet.css?t=1234567890 This will result in the stylesheet link being different everytime, hence the browser cannot cache the file :) Hope this helps. R. |
The End.