Jump to content

bsmither

Members
  • Posts

    213
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by bsmither

  1. "disabled in the server configuration" This says you are not going to get your file. Please have a conversation with your hosting provider.
  2. "I am getting an error with PHP." How do you know it's an error? A pervasive mistake I see is this: while ($row = mysql_fetch_assoc($result)) { Technically, you are testing for $row containing a non-false value, but you are not doing anything should the expression for while() be false. mysql_fetch_assoc could return false - and it eventually will - but return false immediately. Sketch your flowchart and determine where program control flows when while() is false.
  3. I don't like the %20 sequences in the javascript code. (Doesn't mean I know they are bad. Just don't like 'em.)
  4. Fatal error: Call to a member function fetchAll() on a non-object The call to fetchAll() in this statement: // Does a space between the function name and the argument list in parentheses cause a problem? $query -> fetchAll (PDO::FETCH_ASSOC); is based on $query being an object in the same "scope" as that of the statement. If $query was assigned in the root, or global scope, then you might not be able to see it inside functions. However, I have learned (the hard way) that variables assigned in the global scope can be seen anywhere because PHP makes $GLOBALS['query'] from $query. Just FYI. I also think this can be looked at closer. I am of the opinion DISTINCT is not a SQL function. DISTINCT(shift) as value This will cause problems. PHP comments do not work as comments inside a string. Here is the MySQL comment format. DATE(start) = '2014-05-07' //THIS DATE IS ONLY FOR TESTING And I generally don't like separating the function name from the argument list, although I do not see why PHP would complain: Was: if ( count ($result) == 0 ) die ("No agents found"); Now: if( count($result) == 0 ) die("No agents found");
  5. Actually, you have your PHP fairly well separate from your HTML. This, however: <div class = 'header'> <? if(isset($_SESSION['popo']) && $_SESSION['popo'] == "POPO"): ?> <h2><br> POPO IS GREAT </br></h2> <? else : ?> <h2><br> POPO IS LATE </br></h2> <? endif ; ?> </div> is mixing "data logic" with "display logic". There actually is no display logic required in this example. This variation: <?php session_start(); $_SESSION['popo']="POPO"; if (isset($_SESSION['popo']) && $_SESSION['popo'] == "POPO") {$message = "POPO IS GREAT";} else {$message = "POPO IS LATE";} ?> <!-- snipped --> <div class = 'header'> <h2><?= $message ?></h2> </div> <!-- snipped --> (The PHP is condensed. Refer to post #3.) All the data gathering and preparation logic is performed in the PHP area. All the presentation logic (loops to build selectors, etc) is in the HTML area.
  6. /cro1/cRIO01_live.csv (error entry) still does not match /crio1/cRIO01_csv (code) Might there be an issue with PASV?
  7. A somewhat harder way, that is, if you want all the desired data to come in on the form submit, is to concatenate everything into one string: $sender_name . "|" . $sender_email to populate the HTML, then explode("|", $_POST)
  8. In my experience: Module 'gd' already loaded in Unknown on line 0 means that PHP has attempted to load this module from either the PHP.INI file (the GD or GD2 extension, although the error message might be little different on startup errors) or from a ZendGuard or ionCube loader file that might be using the dl() command. The fact that there is no known file or line number means (IMO) that PHP wasn't running a human-readable script. I think the version of PHP may be prior to 5.3, and this is only a warning. PHP won't crash or exit because something is asking PHP to load this module when it is already loaded. So, I think your time outs are not caused by this situation.
  9. It seems you are using PHP's "short open" tags. Your PHP configuration file must specifically allow for that. If it does not, then: <? stuff ?> will be ignored by PHP. It will also be ignored by the browser because angles denote an HTML tag, not content to be shown. But since a question mark is not a proper name of an HTML tag, the browser won't know what to do with it, except to ignore it. Thus, but phrases get displayed. For now, try to always use the normal PHP open tag: <?php stuff ?>
  10. This statement: $topics = $topic + ".txt"; is using a mathematical plus operator. In doing so, PHP must convert the strings to their mathematical equivalent - which is the value zero. To 'concatenate' (put strings together), please use the period: $topics = $topic . ".txt";
  11. Between one byte and 2GB is the range of this setting that Apache can work with. The server administrator may set this limit in the web server's configuration file to a value that the web server administrator has chosen to be appropriate - perhaps 20MB. Please consult your hosting provider.
  12. This: http://www.sparklenshinecs.com/index.php?content=paginas&cat=7 is a URL encoded variant of this: http://www.sparklenshinecs.com/index.php?content=paginas&cat=7 The character & is encoded to its html entity equivalent & Technically, when a script wants to paste a URL into the HTML output, such as the value of a text type form element, validation will agree with the encoded variant. Note that the browser will display all the HTML entities as their single character version. So, I think whatever script is creating these URLs, it is mistaking the intended place in the HTML: actual links, such as for images, or informational areas. Or, whatever is scanning your site for SEO-ness, is not discriminating between the two purposes. When PHP splits the querystring into the GET array, there will be $_GET['amp;cat'] that equals '7'. When your script tries to use $_GET'cat'], which is not set, your query will fail. Not having tested for the response from the database for a possible bad query - a boolean false (you are probably assuming the result from the mysql_query() call will always be a valid resource), the mysql_fetch_array() call will throw an error.
  13. Feel free to ask specific questions. "It don't work" is not specific. "If I lose line 42, the first array should be fine." Yes. And also for line 43. Odds are good this array will get populated somewhere earlier in the script. You don't want to empty it.
  14. Line 6 assigns a populated array to $query_vals. Line 42 assigns an empty array to $query_vals. Line 18 starts a function but you are not calling it. Line 44 is a complete statement, but is followed by a brace that usually groups statements to be executed via a program flow construct. Line 45,46 are program flow constructs with nothing to do. Line 49 is the closing brace to line 44, but line 44 is not a program flow construct.
  15. Assuming you get the user/pass fixed: WHERE user_username = $username Please consider using apostrophes to surround string values. WHERE user_username = '$username'
  16. Make absolutely sure you have the <tr>, <td>, </td>, and </tr> sequence correct. Also, browsers know to start another row when the sequence </tr><tr> is found. A few browsers (some versions of IE in particular) will collect all extraneous HTML that should not be between the table parts close/open tag sequences, and show them above the table. Thus, all the <br/> tags, being outside of cells, will be collected and 'displayed' above the table.
  17. $Username = safe($_POST['Username'] . ""); $Username = safe($_POST['Username']) . ""; Either statement. Let's see what happens.
  18. var_dump() gives you nothing...? If the unlikely result of var_dump() gives nothing if $Username is not set, please prepare the variable by doing this: $Username = $_POST['Username'] . ""; This will force $Username to equal an empty string if the POST variable is not set.
  19. It looks like you have inadvertently incorporated a BASIC string function in the key expression for $row. So, assuming what you get with $row['fm_auction'] is something like auction2013 and you just want the 2013 part, try: echo substr($row['fm_auction'],-4);
  20. Yes, something like that. Since you are echoing stuff to the browser, let's try: var_dump($Username); if ($Username == ""){ Let's let PHP tell us what it thinks of $Username.
  21. Can we assume the statement: if ($Username == ""){ has $Username holding the sanitized value of $_POST['Username']? And etc.?
  22. Yes, and it may be complicated to parse the results. Using cURL (or if that fails, fsockopen), you can have PHP issue a request to another site. Typically it is to one of that site's API methods where the return is no more, no less, than what you exactly need. But if you get back an entire web document, your PHP will need to parse out the data you want (called 'scraping' a page).
  23. It is. I was not able to make a number of adjustments to my profile until after some time or number of posts had passed.
  24. Let's start with $a being what we start with, $b being what we want. $b = array(); foreach ($a as $value) { $b[$value['sno']] = $value['result']; } print_r($b);
×
×
  • 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.