Jump to content

premiso

Members
  • Posts

    6,951
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by premiso

  1. How would it better security? I am asking these questions because without knowing where you are going I cannot help you properly. As far as I know, there is nothing to do with security here. The file name itself, (not the extension) would be the security part. As long as that is handled properly it is fine. If you want the images to be "universal" and that is your reason for converting to jpg, and that is a good enough reason for you to do that, then go ahead and do it. But it won't make your application any more secure and will just cause for an extra step, either or.
  2. What harm can come from a negative integer? If you are worried about a negative integer being entered, check to make sure it is > 0. But inval, will allow -24 to pass through, because that is a valid integer.
  3. I think the standard is .jpg, at least my preference. But why convert to .jpg? png is an acceptable format, if there is no need to change the format just leave it as png. Unless you have a good reason to convert it, just leave it.
  4. Don't just wipe out your question, post a follow up post with the answer. It may help someone down the line. *premiso rollseyes.
  5. Echo the contents inside of <pre> tags: <?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title> 3.1 </title> </head> <body> <p> <pre> -- insert -- </pre> </p> </body> </html>
  6. The probable cause is in the Connection::Open(); / Close, although the close is after the return. But since you are returning 1, that fits the output after. So yea, we will need to see more code to help.
  7. So your line after the modules function does not exist. Read the manual on the frontController to find out what that method should be.
  8. It looks like you are referring to the root of the drive with the initial slash. Try removing that slash and see how it goes. If that does not work, we need the actual code you are using where the addModuleDirectory code is. The main thing is, the path has to be found and either needs to be relative to the directory, in the include path or needs to be absolute from the root of the drive.
  9. Try this out: $email = new Zend_Form_Element_Text('UEmail'); $email->setLabel('Email') ->setRequired(true) ->setDecorators(array( array('HtmlTag',array('tag'=>'input','class'=>"txt-field-login")), ));
  10. A good start would be the Zendframework Coding Standards as well as the Zendframework Reference guide There are plenty of screencasts available for ZF as well, you just have to do a bit of googling to find them.
  11. Or just use html_entity_decode. I do not really see why that would not work for this situation. echo html_entity_decode("/template/NamlServlet.jtp?macro=app_people&node=136&i=20"); // Outputs: /template/NamlServlet.jtp?macro=app_people&node=136&i=20
  12. wtf? Random, retarded, and should get you banned. If only you could ban retarded people who post stupid shit like you just did...but then we wouldn't have a forum. Oh well I guess. *premiso ignores phpSensei EDIT: And for the record, it's been our home longer.
  13. Did you do password resets on the database for the main accounts etc? If you didn't I would suggest doing so, if you were sql injected, they may have the password(s). Are you constantly running an alter table in your code?
  14. They are two completely different items. You need to explain a bit clearer and better what you are wanting to do.
  15. Chances are you have white spaces above line 4, as line 4 is where your php starts. Remove those white spaces and you should be fine. Or post everything above line 4 as well.
  16. Don't necro a dead topic (over 2 years old). Create your own topic, feel free to link to it stating you have a similar problem, but yea.
  17. For something like that, recursion is generally the method of choice. It can be a bit rough to get right and to do but will definitely streamline the process like you want. I am not very handy with doing recursion stuff, if I find some time I will try and do a mock of what you would be looking for. In the interim, you can check out google for php recursion and find some good articles on the matter, if you want to pursue this.
  18. http://www.phpfreaks.com/forums/index.php?topic=294324.0 Already a topic on the matter.
  19. $row['id'] = (int)$row['id']; // cast to int to make sure nothing bad gets through. if (file_exists('/var/www/html/images/races/' . $row['id'] .'/images/' . $row['id'] . $dthumb)): Should do what you want. This is called concatenation. I also statically cast the id to an integer, as that is what you are expecting and this will make sure that something weird doesn't go through that could be used to get information about your site (more than likely not, but better save than sorry). Also, instead of manually typing the path in like that, I would use $_SERVER['DOCUMENT_ROOT'], if possible. if (file_exists($_SERVER['DOCUMENT_ROOT'] . '/images/races/' . $row['id'] .'/images/' . $row['id'] . $dthumb)): Assuming that has been set by your webserver and it is set to /var/www/html
  20. No, you cannot do it the way you mentioned. Do you use this similar code to generate a list elsewhere on the site? Or are you trying to streamline the loop? If you are not using it elsewhere on the site, the way you have it original is fine and perfectly acceptable, and putting it in a function does not reduce redundancy. If, you do use it in multiple places, well we can probably help you stream line it a bit more. Just need to know which it is.
  21. You are going to want to look into Load Balancing: http://www.webhostingtalk.com/showthread.php?t=1017989 Just something about the same subject you are talking about to get you started.
  22. This line you posted: Create table db.t (f1 enum (‘a’, ‘b’) not null); Those are smart quotes in the enum section. Change them to be regular single quotes: Create table db.t (f1 enum ('a', 'b') not null); The smart quotes seem to be coming from your word document (as that is probably the most common place), it is best to turn them off in M$ Word if you plan to keep using that, as the smart quotes really do nothing special other than look pretty. You could also use an actual IDE / Programing application to create SQL's. M$ Word is not ideal for writing code / queries because it uses a lot of special characters that can break code. So either turn it off (some where in the auto-complete section I think for m$), paste the code in notepad and re-copying then pasting into the text box, or use an actual editor meant for SQL etc.
  23. Or just keep it in a numerical index based array and use a foreach loop later: $bio = mysql_query("SELECT * FROM soc_meminfo WHERE m_id = '".mysql_real_escape_string($en['mm_id'])."'"); if (mysql_num_rows($bio) == 0) call404(); $lines = array(); while ($line = mysql_fetch_assoc($bio)) { $lines[] = $line; } // Then later on: foreach ($lines as $line) { echo nl2br($line['field_name']) . PHP_EOL; echo nl2br($line['field_name2']) . PHP_EOL; // or inner loop as well: foreach ($line as $val) { echo nl2br($val) . PHP_EOL; } } Then it is one loop, and no mucking about with creating your own design. Edit: added the nl2br, it does the same thing as your str_replace, but with the proper method for it.
  24. To get the inner array: $innerArray = $array['GetSMSInboundResponse']['SMSInbounds']['InboundSMS']; To echo it, outside a loop: echo $innerArray[0]['ID']; If you want it in a loop to echo everything: foreach ($innerArray as $item) { echo $item['ID'] . PHP_EOL; }
  25. Althought I do shutter at doing a global inline with the code like you did, this should fix it: "/users/<?php global $user; if ($user->uid) { print $user->name; } ?>"> The problem was that without the initial slash, it becomes relative to the page you are on, and thus the content is added. With the initial slash added it will be relative to the root.
×
×
  • 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.