- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 19
- Posts with Upvotes
- 18
- Upvoting Members
- 11
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
150 Posted Topics
Re: Show some code, we need to know how you're trying to approach the problem. We need more details. | |
Hi there, My question isn't strictly about programming, it's primarily a question of how to approach my problem with the tools I have. I am building a website where a user can sign up and create their own profile/portfolio so to speak. Let's say this is `mysite.com`. Say Joe Bloggs … | |
Hi again everyone, Im running into big trouble with my compiler Dev-C++, every time i compile any project, whether it is 1 im working on, or a completely fresh 1 I get the same error every single time, I have been on the bloodshed forums and IRC channel but Im … | |
Hi all, I have a 3-tier menu system in that there are 3 levels such that each top-level menu item has X mid-level items and each mid-level item has Y bottom-level items. For each top-level item I need to split the mid-level and bottom-level items into 3 columns as equally … | |
Re: Why not CRON jobs etc? PHP isn't really meant for this kind of task. Executing something regularly would normally be done using something like a CRON job or something like an application running in the background. | |
Hi, I'm running into a strange issue on my iPage hosted version of my website. When logging into my system, `$_SESSION["id"]` contains the User ID of the logged in user. Somewhere else on my site I am doing something like this to retrieve the ID of a page: if (isset($_GET["id"])) … | |
Re: You're trying to use the variable `$data` before it's been declared. Try doing: while ($data = fgetcsv($handle,1000,",","'")) { if ($data[0]) { // Code here } } | |
Re: You'll need to query your "following" table to see if there's a record that matches the current user id and follower id. | |
I've been having tonnes of issues with Mod Security. I am busy writing a CMS for a project at work and while developing a page to edit a certain database record I kept getting 403 errors. After hours of banging my head against my desk, adjusting bits of code I … | |
Re: Is it that your email isn't reaching it's destination or that you're not getting your "Thanks" message? | |
Re: It might be worth posting your database queries etc, since that seems to be what is causing the problem. | |
Re: When you call `date('Ymd_hmi')` it's getting the current execution date and time. What I would recommend doing is getting the most recent file by listing the contents of the directory, finding out the most recent file (In this case simply ordering by filename and taking the last one in the … ![]() | |
Re: Give it a try and post your code. Also your question is very vague, no one can really help with the information you've provided. | |
Hi My issue is that I want to either call 2 AJAX functions one after the other OR call just the second one. Let me put this into context.. I am writing a "store locator" application. By default all the results are loaded in alphabetical order. A user is able … | |
Hi there, Earlier this year I had a problem with my computer. When I was using it to play games and perform other quite CPU intensive tasks it would become sluggish and laggy. Usually a restart would fix it for a while. The problem got worse and worse until it … | |
Re: There's no "best" framework. Depends on the context of your question. It's very vague, give more information. | |
Hey, I've been having tonnes of issues with Mod Security. I am busy writing a CMS for a project at work and while developing a page to edit a certain database record I kept getting 403 errors. After hours of banging my head against my desk, adjusting bits of code … | |
Re: http://php.net/manual/en/function.file-get-contents.php This should work for remote files. You can then parse out what you need using regular expressions i.e. http://php.net/manual/en/function.preg-match.php As mentioned above by JorgeM, doing something like that isn't really the most ethical depending on what you're trying to achieve | |
Hi there, This question relates to data structures, performance and approach to a problem. It is best explained with example so bear with me. For the record, I will be using a combination of PHP, MySQL and Apache server on a dedicated Linux server. The problem is how we would … | |
Re: I'm not sure if I am thinking too simply, but to keep an image's aspect ratio you can just resize either the height OR width but not both. The other should be left as auto. Working out the orientation of the image i.e. portrait or landscape might help you decide … | |
Re: Instead of doing a single query at the end, do a query inside the innermost loop where you are iterating through each application-array object. I'd recommend just having the account number and application date as separate fields though. You can then create a composite key on these to uniquely identify … | |
Re: The concept is that your form posts the data (When `method=post`) within the form to the file specified in "`action=file.php`". The file that is to recieve the data (file.php in the case of this example) should be able to recieve the data through the `$_POST` superglobal. Each piece of data … | |
Re: Make sure that IIS (Which often comes on Windows systems) is not conflicting with apache. http://support.microsoft.com/kb/321141 | |
Re: jQuery UI has an autocomplete widget which might be what you're looking for: http://jqueryui.com/autocomplete/ The data source it uses can be hard coded in Javascript or returned from some server side script via AJAX | |
Re: The idea is to use jQuery/javascript to create a form with the row you want to edit and push the changes to a server side script via AJAX when the form is submitted. | |
Re: In line 4, I think the %1 should be $1. | |
Re: This won't be a problem with your browser at all. It will likely either be the way in which you are running your file or a server configuration problem. Let me ask: Are you running this file on your machine directly by opening your file or are you running it … | |
Howdy, I'm a relatively experienced PHP developer looking to start building websites in Wordpress. I have previously built my own simple theme consisting of an index page that contains a bunch of posts and a template that is used for single posts with comments etc. I wouldn't say I'm very … | |
Re: http://php.net/manual/en/function.session-start.php session_start() should be called before doing anything with sessions. It should ideally be called before any output to the browser. You will get headers already sent errors if you try to use it after any kind of output. | |
Re: You should call `session_destroy()` to log out. From your latest piece of code it doesn't look as if you are including your PHP script on the page. As the guys above have been saying, put it at the very top before any HTML or anything. `session_start()` along with other functions … | |
Re: It's just a matter of programming your issue into the script. Build the query dynamically by checking variables and deciding whether or not to include them in your query. For example: <?php $var = "abc"; $query = "SELECT * FROM `table`"; $queryWhere = array(); // Make sure $var is set … | |
Re: I'd suggest writing a class that creates a connection to your database and then each method/function within your class can access the database connection. | |
Re: Basically, you are not telling it to print something out. `print_r`, `var_dump`, `echo` etc. are used to output something to the browser. Change the last line to `echo $obj->getProperty();` and that should print something out. | |
Re: If you have CSS stored in your database, then you will be able to load it like you would with anything. If you want the CSS to be in a different CSS file and not your HTML you could configure your .css files to be parsed with PHP. | |
Re: You will have to post both files you have problems in. From the above chunk of code I can't see where your error is (And I can't be bothered to read the whole thing to see where you are using mysql_num_rows()). Post them in different sets of code tags. | |
Re: This is probably the result of the browser showing you a cached copy of the previous (Profile) page and not actually resending the request to the server. Let me ask, ony our profile page, are you definitely checking if a user is logged in (By checking the session) and then … | |
Re: What's your question then? How do you upload bigger files? You can change the settings in your PHP ini file. You'll need to look for `upload_max_filesize` and `post_max_size` | |
Hi guys, I'm have a right mess about trying to figure out how to do something that would initially seem trivial with HTML and CSS. I am looking to have a centered heading that has a horizontal line stretching from each side of the text to the beginning and end … | |
Hi I would like to create a function that appends a character to a character array.. this is what I have got so far.. [code=c] char * appendCharToCharArray(char * array, char a) { char * ret = (char*)malloc(sizeof(array) + 1 + 1); strcpy(ret,array); ret[strlen(ret)] = a; ret[sizeof(ret)] = '\0'; return … | |
Re: Have you tried debugging it by putting echos or var_dumps etc inside your deletePersonDish function? Personally I would echo out the query to see if it what you are expecting, i.e. your are recieving the expected values through the parameters: function deletePersonDish($personID, $dishID){ $query = 'DELETE FROM persondish WHERE personid='.$personID.' … | |
Re: Little confused as to what you're trying to achieve. Do you want to get the user's IP address using Javascript or PHP/Other serverside language? Pritaeas' solution should work on the PHP end. | |
Re: $result = mysql_query("SELECT COUNT(`idads`) FROM `adsmgt`;"); $row = mysql_fetch_array($result); echo $row[0]; mysql_fetch_array() does not return an associative array, it returns a numeric indexed array. If you want to get something by it's field name i.e. return an associative array use mysql_fetch_assoc(). I would recommend using `SELECT COUNT(idads) AS countidads FROM … ![]() | |
Re: I'm assuming you're using a session to track the login. Within the session just keep a "last activity" timestamp that gets checked and updated every time a different page is loaded. When a page is loaded, check the "last activity" against the current time: if more than your timeout time … | |
Re: No one is going to do it for you. Attempt it yourself, post some code when you get stuck. | |
| |
Re: This would be a much simpler task if you had another table that joins your products to categories i.e. productstocategories productid categoryid 1 2 1 4 1 5 1 6 2 1 2 4 2 3 4 3 4 5 | |
Re: You should get used to using constants that are defined by PHP for things like directory separators which should make your code more portable. If anywhere in your code you have used anything that is Windows specific i.e. directory separators, running it on linux will fail. In this case use … | |
Re: On line 44, you have `global $word;` but have not actually defined `$word` globally. Also, checkFiles() is never being called. I noticed you have on line 17 `onclick="checkfiles()"` which is an attempt to call a Javascript function checkFiles(), NOT the PHP function. |
The End.