Jump to content

gizmola

Administrators
  • Posts

    5,945
  • Joined

  • Last visited

  • Days Won

    145

Everything posted by gizmola

  1. By default php sessions actually work with a cookie. It's a session cookie that simply has an id in it. On subsequent page views, php matches up any $_SESSION variables it has stored with that session id. The default is that these session variables are stored in small files on the server. Therein lies the advantage, as unlike cookies, the data you store in the session variables is never sent to the client.
  2. AFAIK, the way to handle this is with the setup and configuration of apache and php so that it uses fastcgi + suexec. The thing that allows people to read each other's files is when you're using mod_php and the apache process has to have access to everyone's file systems. You need a configuration where every user is running as their OS user, in their home directory. There is a long discussion of this here, and a bit of googling on php fastcgi suexec will provide you a lot more to read about. Good start -> http://forum.linode.com/viewtopic.php?t=2982
  3. Of course, you just need to code it. GD has lots of useful functions you should read through. This one will probably be of help imagecopyresized.
  4. Yes because that code is completely invalid. You are already in a php block ... you just need to use the proper interpolation. $qry="SELECT * FROM troop WHERE login='{$_SESSION['SESS_LOGIN_NAME']}'";
  5. Yes sessions can do what cookies do, and even more importantly, the data stays on the server. Try: session_start(); if (!isset($_SESSION['pagecount'])) { $_SESSION['pagecount'] = 1; } else { $_SESSION['pagecount']++; } echo 'Session tester'; echo "Ran this {$_SESSION['pagecount']} times.";
  6. You probably have a syntax error. Did you remove the xml header as well? yes i did And if you look at www.thedaylightmafia.be you can see i have no error ... Just a blank screen, php error message are turned on so if there was an error we would see it. I'm also sure i didnt miss out one, i triple checked it to be sure. You have a runtime error. It is probably in the error log for the server. On shared hosting you can't get access to that most times. Shared hosting is crap more times than not, but like most things in life you get what you paid for. Since you know that your code requires php short tags to be enabled, at least you can check with other potential hosting companies to make sure they support it, before you move somewhere else.
  7. You probably have a syntax error. Did you remove the xml header as well?
  8. $astat34 = "login"; $astat35 = "person"; $astat36 = "code"; $astat37 = "area"; $astat38 = "crew"; $astat39 = "Who has a swissbank"; $astat40 = "Pincode"; $astat41 = "Bank Account"; $astat42 = "Bank"; No you are not right. That has nothing to do with short tags. Those are variable assignments. PHP allows you to mix html with php. The way it knows that you have a block of php code instead of html is that you have a start/end php block. some html more html here That is the issue. Short tags does the same thing, only you omit the php from the tags, but php needs to be configured to allow it. We've already been over this. Short tags example: This is html = "This is the same as using echo" ?> See more html in the same .php document! If it's not configured you can't use the short tag syntax to start a php block, and your code uses short tags.
  9. Hey Alex, as far as I know the alternative syntax will still work with our without the shorttags. It definitely works for control structures.
  10. Your message makes no sense. On one hand you state that short tags is on. You are using short tags. Clearly that is not the case. It is really very simple: Short open tag: Full (normal) open tag): <?php Stop messing around with trying to make your pages xml, that has nothing to do with anything and will only make your problem worse. What allows support for short open tags is a setting in the php.ini file for the server: short_open_tag = On That must be off. If the hosting company is saying that they will not turn it on for you, then you have no choice other than to find another hosting company or move to a vps or dedicated host you control where you can make the settings whatever you wish. The other possibility is that you simply search/replace through your entire code base and change to <?php.
  11. You can check to see if a variable is set, with isset(), so if you want that level of completion you can do if (isset($_POST['user_name']) && isset($_POST['user_name'])) { $username = mysql_real_escape_string($_POST['user_name']); // etc. ...do your form processing. } else { // there's no valid account info to check }
  12. Well you should get busy then reading, testing and trying things out. Maybe even look at the source code. Nobody here gives a crap about the urgency of your problems unless you're going to pay them. Also, Joomla 1.15? I'm sure you meant Joomla 1.5, but seeing that this is your problem one would think you would take a bit more care than that. Did you even try to google for this for more than 1 second? http://www.rsjoomla.com/tv/35-episode-3-joomla-form-inside-article-rsformpro.html
  13. A notice is not an error. It is an indication in your case that the code tried to reference a variable that did not exist. PHP recovers fine from that, and if you set your errorlevel for a production server you probably wouldn't log notices. They are primarily for your use during development. It's very obvious why you get the notices when a form is submitted where the user_name or password fields are empty. However, a bigger issue is your code: $username = mysql_fetch_assoc($_POST['user_name']); $password = mysql_fetch_assoc($_POST['password']); That is not how mysql works. You need a query, and if the query returns a result set, then you can fetch it. With mysql_fetch_assoc, you would get an array where the columns are the array keys. You can't just pass in a string and "fetch" it. Those function calls will not work.
  14. If you don't need that, then a very efficient solution would be to suck the data into a string and md5 it. You could have a simple table of entries: pageurl | hash. When you run it, you just need to compute the hash. Of course this isn't going to work for pages where the content is dynamic.
  15. Are you talking about pagination? There is no concept of a "record number" in relational databases although a few have a "row id" or something similar that can be used in some circumstances. MySQL is not one of those. You need to explain better what you are trying to accomplish, if you want help on how to solve your problem.
  16. I posted a test message and it was accepted, as far as I could see.
  17. You truly captured the spirit of phpf there.
  18. Does your script have a configuration file you had to setup? I'm assuming it does. This is not a coding question, it's a question of what you did to set this script up to run. The url for the image is broken: Notice that your domain is in there 2x. This is why it doesn't work. So my assumption is that the script generates that url, and it already is adding the domain and then adds it again.
  19. Looks to me like a config problem. Wherever you configure your image path, don't have the url to your website in there. Just the relative path to the images.
  20. Linux already has nice: http://www.linux.com/archive/feed/58638
  21. Yes, well look at your method: function replace($var, $content,$from) { $this->$from = str_replace("#$var#", $content, $this->$from); } Notice that your parameter is $from, but you are passing $this->$from, which should instead be just $from.
  22. Your captcha is really bad. However even when you have a captcha there are schemes and even people who are paid to manually post spam, if the target is considered important enough. With that said, you really need a better captcha. Recaptcha is one solution you should consider.
  23. Without code, there's no way to look at your problem. There were some things changed in php5, but it's not possible to comment on whether they might be effecting your code without actually seeing relevant portions.
  24. The -> accesses the class member (variable or method) of the same name, that is a part of $foobar. In that example, $foobar has an array variable or string named "header" and that is returning the 0th element.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.