![](https://forums.phpfreaks.com/uploads/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
Ninjakreborn
Members-
Posts
3,922 -
Joined
-
Last visited
Everything posted by Ninjakreborn
-
Could have something to do with your browser. You may be setting a new cookie each time instead of a new one. It could be a large number of things.
-
Need help with a Text MMORPG (Nearly done)
Ninjakreborn replied to rofl90's topic in PHP Coding Help
Try the freelancing forum. There is a board, if you go back to the main board index, and scroll down you will see "Freelance Forum" post that there. -
Sorry to pop in here on a solved topic, but you want to make sure your careful about passing functions through variables that user's have control over. That is something you want to be very careful of.
-
well only use mysql_real_escape_strings if magic quotes is disabled (You have to run phpinfo() to find that out) If you ever think they are going to be "output" to a browser, you need to run them through something that will clean javascript, php, and/or xhtml text. Since it is just a username and password, you might want to clean it for specific characters, (like mysql wildcards).
-
No, ob start straight away doesn't work, if your code is down in a page, what I showed you won't help. As far as ob flush, just calling that one function won't do anything. http://us2.php.net/flush ready that through, and some of the user comments.
-
Sometimes session start can be very picky, even with text below it. Try putting it in it's own code island, at the VERY, VERY top of the page. <?php session_start(); ?> <?php // whatever else here. ?>
-
If you ever have to take 1 word, and match it up against multiple things then it 1. Saves space 2. Saves resources (it's faster) 3. Looks neater 4. It's easier to block up sections of it, to do something specific with each thing Compare 350 lines of if (here) { }elseif (here1) { }elseif (here2) { }elseif (here3) { }elseif (here4) { } 200 lines of that compared to switch "here" case "here1": // do stuff case "here2": // do stuff I don't feel like typing anymore, but hopefully you get the point. I have heard before some slight security issues with the "way" switch statements are used. There are a few situations in which they can be exploited when used, I saw some posts on here about that awhile back, but I don't remember what it was.
-
Clean the variables.
-
I have created a system (replication of old project), that I am using as the base of something that needs to be done for a client. There are projects, and there are clients. Some clients have permissions to whatever projects they have permissions to, and can't use the one's they don't have permission to. I created a table for permissions, which takes the project id and name, the clients id and name. It inserts them into a "permissions table". I had an idea, and when I sought to implement it, it did not work. I have 2 areas to change permissions. If you are a client, you have an area called project permissions. The idea is to pull the name's, of ALL the projects, and show there names on the screen with check boxes beside them. If they are allowed to use that project, it's checked, if not it's unchecked. They can alter the check boxes as needed, then they submit, and it does all the necessary "alterations" to the permissions table. If you are in the project view, you have an area called "Client Permissions". The idea is the pull the name's, of ALL the clients, and show there names on the screen with check boxes beside them. If they are allowed to view that project they are checked, if not they are unchecked. They can alter the check boxes as needed, then they submit and it does all the necessary "alterations" to the permissions table. When I first created the idea behind the check boxes, I thought about it and presented the idea, and rough sketches to the client. He was happy about the idea, and wanted me to implement it. I went ahead and sat down to do it, and my mind when blank, I really have no idea "how" to implement the idea. I went ahead and started with the projects. I have a link that says "Client Permissions". They click on that and are taken to clientpermissions.php which is the page that holds the script for showing the check box list of names of clients. However, I ran into a problem. If I go ahead and pull all the data from the "clients" table, and show there names on the screen, each one with a check box beside it, that check box name will be the id number of the client to be able to identify which client it is. Then the value is either allowed or disallowed. The problem now comes that I can't figure out how to check the permissions table with EACH client name, to see if they have a permission record for that project. I will run into the same problem when I try to update all of the client lists. I could look through it, the one's that are enabled automatically get a database record for permissions, with the information. However the issue is when the system get's the results. I have a list of those who they want enabled, and the one's they want disabled. I have to somehow figure out how to set it up. I am thinking for that I could delete all project permissions related to that one project, then just re-enter the ones that are enabled, ignoring the ones that are disabled. That will give the permissions for that project reset each time. That part I can come to a solution for. In the end I have a current problem. As I mentioned above, I can get the names of the clients out on the screen with check boxes. I can also make the name the id number, and the value either allowed, or disallowed. That is fine, and I can definitely work that out. What can I do to check the client to see if they are enabled or disabled. I am afraid of resources for one reason. For instance. I could have 1. hit the clients table and get all the data 2. Display all there names with check boxes. 3. For each check box hit the permissions table to see if there is a record, if there is mark the x, if there isn't don't. Sounds pretty simple to me, but then I am worried about it making that many database calls. If there are (for example), 50 clients. When they load that page it's going to make a total of 51 calls on that one page (1 call to the clients table, 50 calls to the permissions table). This same issue is going to be encountered when I begin to deal with the clients, and try to allow them project permissions from that console. I will be able to solve that problem however I solve this one, but I need some advice on solving this one. Any advice is greatly appreciated?
-
good point, thanks.
-
Yes, I actually see the accounts inside the database, do I just create anothe ruser, from the user. I don't even know what encryption method they are using for the password.
-
When I ran the command line client. I ended up feeding it the database information, it successfully created all the databases. All of that went fine. From there, I went ahead and configured an admin user, using his email address as the username, and the password, as the password. When I try to login it's not working, I tried every combination even the username/password for the database. Nothing is letting me login.
-
Ok, mailenable is setup. Hordemail has also been setup on the server, and hte login area for hordemail can be accessed via the browse. Right now, I am trying to login using his email address name, and password I picked for it. It says login failed, is there a step I am missing somewhere, I am unaware of.
-
I just said screw it, and accessed it via the command line, thanks.
-
No, I found it. From windows command line you get into the path folder of the script. Then you enter c:\path\to\php.exe file.php Then it will command line parse the php files. I just found that out, thanks.
-
I am familiar with setting up PHP on both a Windows or Linux system. Right no I have a XXampp installation. I need to figure out how to get a command line version of PHP installed (where it can run PHP files through the command line), how do I do that.
-
Ok, I figured out most of it. I installed and setup mailenable, a program I found that seemed to work well. I also found hordemaill, and uploaded all of that upto my directory. However when I visit www.domainname.com/webmail (the folder I put it in) it tells me to run the setup script. I tried going www.domainname.com/webmail/scripts/setup.php which is the exact one, and it tells me forbidden. (it's windows so there are no permissions), and my ftp server is setup to allow all permissions. It also doesn't work at www.domainname.com/webmail/scripts it doesn't let me into anything there either, what do I need to do to get access to that setup script.
-
I am using XXAMPP (sorry spelling). I am using there mercury mail system to try to setup the mail server, then setup apache to point to a webmail version using www.domainname.com/mail Is this possible using xxampp and just mercury mail. Is there any instructions on how to actual setup mercury mail, or is that not possible for that web mail? I just want to setup the mail server, and in the end him be able to visit www.website.com/mail and it comes up to a login for his mail, and he can check it, send them, or whatever else there. If he has like 8 inboxes, I want him to be able to get into all of them from the same login area, or something similar. Or maybe login and then be able to pick the account, does anyone have advice on this?
-
Perfect, thanks.
-
I am using tinyMCE, and the client keeps asking me about spell checking. He wasn't happy with ESpell because it was only Internet explorer. I am looking into tinyMCE and saw PSpell support. I checked my info page, and PSpell is enabled. How do I actually just "test" to see if it is actually working, and functioning properly BEFORE trying to get it to work with the tinyMCE plugin.
-
Yes, but the reason I was asking in this manner. Logically speaking I could look at this tutorial and get an idea (I looked over it and already have the idea in my head), which would mean I would have to rewrite all 4-5 occurrences of the system. My pagination system is completely different from that one, so it would require me to rewrite the whole thing, queries and all. In the end I was wondering if there might be a way to simply modify what I had which would add in the extra feature (page numbers), then replicate the modification throughout the rest of the system as needed. Instead of rewriting each system individually.
-
I have had a system I have been re-using for pagination for a long time. I originally created it, and was rather happy with how well it worked. Basically: <p>Click thumbnail for larger view.</p> <?php if ($_GET['rownumberprev']) { $rownumber = mysql_real_escape_string($_GET['rownumberprev']); }elseif ($_GET['rownumbernext']) { $rownumber = mysql_real_escape_string($_GET['rownumbernext']); }else { $rownumber = 0; } $limit = 20; // get total amount of rows in database $year = date("Y"); $month = date("n"); $selecttemp = "SELECT * FROM specialimagesystem;"; $querytemp = mysql_query($selecttemp); $total_rows = mysql_num_rows($querytemp); // get current year and date, for use with query $select1 = "SELECT * FROM specialimagesystem LIMIT $rownumber, $limit;"; $query1 = mysql_query($select1); while ($row1 = mysql_fetch_array($query1)) { echo "<div class=\"specialimagesystem\">\n"; $target = "/specialimages/"; $width = "100px"; $height = "100px"; echo "<a href=\"{$target}{$row1[name]}\" class=\"thickbox\" title=\"{$row1[description]}\" rel=\"gallery1\"><img src=\"{$target}{$row1[name]}\" width=\"{$width}\" height=\"{$height}\" alt=\"{$row1[name]}\" /></a>"; echo "<span style=\"float:left;\">"; // starts span for price and id echo $row1['description']; echo "<br />"; if ($row1['price'] != "") { // if price is set, then show it echo "Price: $" . $row1['price']; echo "<br />"; }// either way show the id echo "ID: " . $row1['id']; echo "</span>"; echo "<br /></div>\n"; } ?> </div> <div class="pag"> <?php // pagination script part down here if ($rownumber != 0) { $rownumberprev = $rownumber - $limit; echo "<a href=\"totalinventorypictures.php?rownumberprev={$rownumberprev}\">Previous Page</a>"; echo "<br />"; } if ($rownumber <= ($total_rows - $limit)) { $rownumbernext = $rownumber + $limit; echo "<a href=\"totalinventorypictures.php?rownumbernext={$rownumbernext}\">Next Page</a>"; } ?> </div> Ok that same system I have replicated for a very long time. Sometimes it has needed more modification than others. Like some situations where I needed to integrate a more powerful system or instead of showing results it might have been showing htem through a search query, or multiple search queries. Each time is added an extra layer of difficulty, but I was able to modify the same one into something that worked for each situation. Now I am faced with a question from a client. He wants numbered pages 1-2-3-4-5-6-7-8 One number for each page, so they can just click ont he page number, Is there a way I can modify my existing script into a basic script for that kind of funtionality, then I could modify it from there. I am going to have to replicate it into more advanced forms for the other pages with search queries, and everything else. That is the problem, I am having trouble making a base modification into this format. Is it even possible with the current way I am setting up the pagination.?
-
I don't see a problem with it. My client is claiming that he has auto-inc fields that are not working right. He says they auto inc properly, but if he deletes one, and adds another one, it doesn't make note of the missing numbers. For example. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 - Whoops, here he deletes 15 entered another new one 15 16 17 instead it was suppose to be from that point to go 16 17 18 See what I mean. It's basically the way he explained it, when they delete one, and add a new one, it replaces the number that was just deleted. This is against the inherent nature of auto-inc, either he is misunderstanding the way it operates, or something is wrong with mysql. Is this suppose to happen, or is it his imagination.
-
Ok, so as for 1and1.com. There email service is just as good as there hosting. If I go ahead and start using them or gmail then I shouldn't have to worry about it again?
-
Right now I am in hot mail plus, the paid account. I want to change to something that. 1. 100% always receives emails sent to it 2. 100% always delivers emails to there location, unless it's a problem on that end 3. Has many powerful features, 4. Easy to keep information organized. Hot mail has number 3-4 but there are too many possible issues. I need something a lot more stable, I don't really want to rely on my web host, www.1and1.com. This is a major issue. I just want one that is reliable, not hot mail. They are not reliable. I never know when I am suppose to receive something I don't, I have this feeling I could have lost whole clients who never got my emails, or vice versa. I just read your message below, I don't use the web host because I change often. I am using 1and1 before then I used blue host. After I get some money I am upgrading to a VPS, or managed server, maybe with 1and1 maybe something else. I want to get a permanent, trustworthy, reliable (again permanent) email address. One that will handle all my business/personal needs. Something that is trustworthy, and not full of problems, and errors. That has a proven winning streak. Is GMail really good, do they do a lot better than hotmail, are they more reliable than hot mail. Hot mail also has the built in virus scanner, I just wish I could make sure hot mail was secure and why this was happening, I have enough to worry about without having to worry about email.