Jump to content

jazzman1

Staff Alumni
  • Posts

    2,713
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by jazzman1

  1. Try, $vote = $_POST['vote']; $tstring = implode(',', $vote); $sql="update `poll_results` set `num_votes` = `num_votes` + 1 where candidate IN ('".$tstring."')";
  2. I am the one who prefer to install all the LAMP stack from source code onto my linux machines. But interesting question here is - why you cannot use the package manager
  3. My IDE says: $order_items=$order_items_row['od_qty'].' x '.$order_items_row['pd_name'].'@'$order_items_row['pd_price']; //worng $mesage_content=$message_intro.$order_items //wrong $order_items=$order_items_row['od_qty'].' x '.$order_items_row['pd_name'].'@'.$order_items_row['pd_price']; //correct $mesage_content=$message_intro.$order_items; //correct
  4. What's happening when you're trying to reach - site.com/test? It redirects you to other page or it just shows you an empty content? And also, is it a dedicated or a shared hosting server?
  5. Well, I think it's time to show us what you've done so far
  6. Well, as Barand said you have to tell us about your database structure, so I wrote a simple example how to insert multiple radio values to database. In this example I'm going to use Barand's example. You can take a look that thread too - http://forums.phpfreaks.com/topic/267013-looping-multiple-rows-into-database/ <?php if(!empty($_POST['Submit'])) { $votes = $_POST['myvote']; // build a query string ..... $sql = "INSERT INTO `tbl_name`(`votes`) VALUES"; foreach ($votes as $vote) { $sql .= "(".$vote; // trim the last comma from a query string in case you have multiple values //$sql = rtrim($sql, ','); $sql .= "),"; } // trim the last comma from a query string $sql = rtrim($sql, ','); //echo '<pre>' . print_r($sql, true) . '</pre>'; } ?> <form method="post"> <input type="checkbox" name="myvote[]" value="1" /> <input type="checkbox" name="myvote[]" value="2" /> <input type="checkbox" name="myvote[]" value="3" /> <input type="submit" name="Submit" value="Go!" /> </form> Results:
  7. To send emails via SMTP ports you need to have a mail server, by default php uses sendmail. What OS are you using onto your machine?
  8. Ah....so sorry if I was misread your threads by saying: PS. By the way, you are not rude and an arrogant girl
  9. What do you mean by saying - php mail function does not work? It doesn't work at all or in this particular example?
  10. Yes, that's correct that an absolute path to the image onto the machine is "C:\wamp\www\project\web\images\image.png", but it's also true that an absolute path to this image onto the web server is "/images/image.png" , not "images/image.png" (it's a relative path) So, when we're starting to reach something with "/" that tells to the server that we're going to use an absolute path to this element.
  11. Jessi, no, no and no Every root directory of the web (nfs, samba, ftp and ect...) servers should be represent only by "/" symbol in the unix machines, so if his own web root directory is "public_html" the correct path is "/", not "/public_html".
  12. The "/public_html" is not a root directory is a sub-directory of the server. But....in fact that lots of hosting providers use that directory as a home directory of the web server. So.... if you want to get a proper root directory of the web server this path is completely wrong.
  13. Try, <form id="keywordForm" onsubmit="return false;"> <input id="keyword" type="text" /> <input type="submit" value="Search" /> </form> <script> var e = document.getElementById('keywordForm'); e.addEventListener("submit", function(){listener(e)}, false); function listener(e) { var search = e.keyword.value; var xhr = new XMLHttpRequest(); xhr.open("GET","keywordsearch.php?search="+search,true); xhr.send(); xhr.onreadystatechange = function() { if(xhr.readyState == 4 && xhr.status == 200) { var response = xhr.response; } }; e.preventDefault(); } </script>
  14. No, only the mail server is enough to map a new user(s) to the tables. What OS are you using for?
  15. He-he, Tony thank you for sharing the link to Silex I've installed Silex few days ago by Composer and i was very impressed how easy and fast I've done everything on my RedHat server I've noticed that Silex is not a real MVC framework like CakePHP, Symfony,Zend, etc...but....for small projects that is very useful, b/s we don't need to use a full functionality of MVC. It gives me only the C (controller) of the MVC pattern for V (view) I can use a "twig" or a flat php and for M (model) I could use a doctrine ORM, if I want it.
  16. Try to change: class try2 extends AppModel { } // to class Try2 extends AppModel { }
  17. Get all radio buttons into an array and then switch the answers and case radio buttons in your processor.php file. Something like: (be careful with radio buttons, they contain empty strings, just trim them) echo '<pre>'.print_r($_POST['selected_answers'][0], true).'</pre>'; switch($_POST['selected_answers'][0]) { case " requirement analysis": $value = '<pre>'.print_r($_POST['selected_answers'][0], true).'</pre>'; break; case "Risk management": $value = '<pre>'.print_r($_POST['selected_answers'][0], true).'</pre>'; break; case "quality management": $value = '<pre>'.print_r($_POST['selected_answers'][0], true).'</pre>'; break; default: $value = "No radio has been selected for selected_answers"; } echo $value;
  18. Don't double post, please! The name of the model class has to have the same name as database table. The database table name needs to be in a plural form. The plural form of try that I know is a "tries" not a "trys".
  19. Try, $openFile = fopen("questionandanswers.txt", "r") or exit ("unable to open the text file"); $string = fread($openFile, filesize("questionandanswers.txt")); // match all characters sequence preg_match_all('/[a-zA-Z.:?,-\s]+(?=\d\))/', $string, $parts); // reindex the array starting to 1 $iOne = array_combine(range(1, count($parts[0], COUNT_RECURSIVE)), array_values($parts[0])); //echo '<pre>'.print_r($iOne, true).'</pre>'; // count all re-index keys of that array $count = count($iOne); // loop through array keys and display the results for($i=1;$i<$count;$i++){ echo $i.')'.$iOne[$i]."<br />"; } Results:
  20. Do you have a mail server running on the local machine?
  21. Does your localhost run on an apache server or something else? If you are using an apache server, could you show us the http.conf file.
  22. What version of cake is used for? Try to change the try2s_controller.php to Try2sController.php file and the view from try2s to Try2s directory. app/Controller/Try2sController.php class Try2sController extends AppController { function try2s() { $test='hello world'; $this->set('test',$test); } } app/View/Try2s/try2s.ctp <?php pr($test); ?> app/Model/Try2.php class Try2 extends AppModel { } Your name's convention is not very clear but that one should work. EDIT: The path of the url should be something like:
  23. Is it a dedicated or shared server? P.S: Yes, my fault, the " -u" flag is available only for a renice unix command. There is no problem using single quotes here.
×
×
  • 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.