Jump to content

PFMaBiSmAd

Staff Alumni
  • Posts

    16,734
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by PFMaBiSmAd

  1. Based on the forum section, the title, and the post, he means how do you enable the imap extension in php. The reason no one likely replied to this topic when it was written is because of how basic the problem is/was, i.e. do a little research and then run to a programming forum if what you tried didn't work. @txmedic03, replying in recent threads is okay, but replying in year old threads will get you labeled as a post-count spammer, i.e. bumping old posts with replies just to increase your post count, regardless of how helpful the replies end up being. Please limit replying to posts that are at most a few months old. Topic locked ...
  2. You have two replies that both state you need to have one user table. Now would be the time to fix your design. Here's a rule of thumb - fixing design problems in the planning stage saves about 10 times the time and money it takes to fix them after they are implemented in code. Fixing design problems while code is being developed saves about 10 times the time and money it takes to fix them after the code is released.
  3. Where exactly are these files at when you are testing this? You mentioned your Windows directory, but AFAIK the xxx style of file permissions (except for the readonly attribute) doesn't apply to windows servers.
  4. I'm pretty sure (untested) you will need to use bindParam and the 5th parameter looks like it would also need to be PDO::SQLSRV_ENCODING_BINARY
  5. An equal comparison is two == or three === (depending on if you want to match values or values and types.) One = is an assignment operator.
  6. It would really help if you posted code that reproduces the problem so that someone could, well, reproduce the problem to see if they can find a solution.
  7. Are you specifically binding the input parameters/value without specifying a data type attribute or are you passing the data values as an array to the ->execute(...) method? Both of these default to string data types. After a little research, the image type, which is now the varbinary(max) type, are large object data types. You would need to specifically bind the value/parameter and specify PDO::PARAM_LOB as the 3rd parameter in the bind method.
  8. You would ORDER BY the absolute value ABS() of the difference between the target number and the summed number for each entry.
  9. Php is a SERVER-side scripting language. It requires a web server to invoke php to parse/tokenize/interpret the php code. You cannot browse directly to the .php file through your browser/operating system and get it to work. You must use a URL in your browser, something like http://localhost/your_file.php
  10. What have you done to pin down exactly at what point your code and data are doing what you expect and at what point it is not? I can guarantee that the problem lies somewhere between those two points. If all you have done is run your code and it doesn't work, all you have pined the problem down to is 'somewhere in your code.' Is your code taking the expected execution path? Is the input data what you expect? The reasons I ask this is - 1) We cannot run your code, because we don't have all of it (nor do we want you to post all of it) and we don't have your database tables or any data (nor do we want you to post this.) 2) We are not going to look through 100's of lines of mostly non-relevant code trying to find just the few lines that are relevant.
  11. Hey Kid, that's not form processing code. Form processing code - 1) tests if a form has been submitted, 2) filters and validates the submitted data, 2) then uses that data the way you want.
  12. It's because you are executing the query a second time without any data values, which would mean that the WHERE clause is false -
  13. In your form processing code, you would assign the value you want to $config['handy'] - $config['handy'] = $_POST['handy'];
  14. What does the 'view source' of the output in your browser show?
  15. You can also do this directly in ONE update query (a query without a WHERE clause will update all the rows at once, no looping required) using the mysql STR_TO_DATE function to convert your existing values to a DATE value - http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_str-to-date
  16. You should use an array so that it all the values are in one place. This would make it easier to loop over the values (they're all in one array) and to make sure you don't overwrite any existing program variables when you include the file. <?php // use an array so that you know exactly where the values are at and where they will end up when you include them $config['handy'] = "nokia"; $config['computer'] = "P4"; // write out the $config array to a .php file $file = 'config.php'; $content = "<?php\n"; foreach($config as $key=>$value){ $content .= "\$config['$key'] = '$value';\n"; } $content .= "?>"; file_put_contents($file,$content);
  17. The array of data was just so the demonstration would work. See the comments in the code -
  18. Most likely cause is the lazy-way short opening tag <? on the line above the foreach() : statement.
  19. There's likely a syntax error on the line(s) right above that point (the WP style of programming makes it easy to break the syntax, but hard to find the problem.) Post lines 159-169 of that file.
  20. Your problem is actually simple. After you retrieve the rows you want in the order that you want them, you simply output the data the way you want it when you iterate over the rows in the result set. Example code showing how you can do this - <?php // sample data to simulate the rows a query produced $data[] = array('id_name'=>1,'phone number'=>'927567348','email'=>'lalala@gmail.com'); $data[] = array('id_name'=>1,'phone number'=>'965437823','email'=>'lalala@gmail.com'); $data[] = array('id_name'=>1,'phone number'=>'963423495','email'=>'lalala@gmail.com'); $data[] = array('id_name'=>2,'phone number'=>'4357986345','email'=>'bubu@hotmail.com'); $data[] = array('id_name'=>2,'phone number'=>'4395874355','email'=>'bubu@hotmail.com'); $data[] = array('id_name'=>3,'phone number'=>'3459875234','email'=>'ghjfgh@mail.com'); // form and execute your query that gets the rows you want in the order that you want them here... $last_heading = null; // remember the last heading, initialize to a value that will never appear in the data //while($row = mysql_fetch_assoc($result)){ // loop over the actual rows from your query here... foreach($data as $row){ // loop over the sample data, in place of the traditional while(){} loop on the line above // detect a change in the heading if($last_heading != $row['id_name']){ // heading change, either a new one or the first one if($last_heading != null){ // not the first section, close out the previous section here ... echo $last_email . '<br /><br />'; } // start a new section here... echo $row['id_name'] . '<br />'; // remember values from the current row $last_heading = $row['id_name']; // remember the heading $last_email = $row['email']; // remember the email since it will have changed to the next value at the time you need the last value } // output the data under each heading here... echo $row['phone number'] . '<br />'; } // close out the last section here, if any... if($last_heading != null){ echo $last_email . '<br /><br />'; }
  21. If you are trying to save your setting values so that they are persistent and they apply to all visitors, you need to save the values either to a file or to a database table. Since you haven't described what overall goal you are trying to achieve, you haven't gotten many replies.
  22. Ummm. Even ignoring the documentation for the method in question, here's the definition of the addaddress() method - public function AddAddress($address, $name = '') { return $this->AddAnAddress('to', $address, $name); } and the start of the addanaddress method - private function AddAnAddress($kind, $address, $name = '') { if (!preg_match('/^(to|cc|bcc|ReplyTo)$/', $kind)) { echo 'Invalid recipient array: ' . kind; return false; } $address = trim($address); $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim It/they DON'T accept an array of addresses.
  23. Not if you are including them using a file system path, which is the normal way. Using a URL to include files takes from 10 to 100 times longer to execute, only includes the content that the file outputs, and means that you won't be able to prevent http requests to them because the http request your main page is making to them must work, therefor a http request from a browser must work as well.
  24. You are reading the folder images/gallery, but only using the filename in $file in the remainder of the code. $file isn't where the file is at, it's just the filename. You would need to add images/gallery/ to get the actual location of the file.
  25. Do you want to turn the Tournament {$row['tournament_name']} text into a link or add a separate link after it? Edit: LOL, the IPB forum post notification is pointless. So, you want to turn the tournament name into a link - echo "<dl class='v_show_hide' >\n<dt>Tournament <a href='page.php?con={$row['tournament_id']}'>{$row['tournament_name']}</a></dt>\n";
×
×
  • 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.