Jump to content

bonaparte

Members
  • Posts

    44
  • Joined

  • Last visited

    Never

Everything posted by bonaparte

  1. Zend Framework is a component library and framework for PHP 5. ZF believes in OOP. It uses a lot of design patters. I would recommend you to get acquainted with OOP before you start using ZF. It will be easier to understand ZF if you understand its motivations.
  2. You could try using sending mails via SMTP.
  3. You need this snippet to loopup the definition of the word 'camera' in the dict.org database. The script uses CURL with dict protocol. <?php $wordToLookup = 'camera'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "dict://dict.org/d:(" . $wordToLookup . ")"); $definition = curl_exec($ch); curl_close($ch); echo $definition; ?> You can also grab the script from Code Album repository - http://github.com/bngsudheer/Code-Album/blob/3a048318a679813013ef42de946f32b85c36e437/cli/scripts/standalone/CURL/LookupDictionary.php repository.
  4. Are you able to get a sample PHP script to work on the same server?
  5. You can do whatever you want to with the returned rowset. Display, edit or delete the returned object or array. Why would you want to do it at the SQL level?
  6. From the Wikipedia <quote> nginx (pronounced as "engine X") is a lightweight, high performance web server/reverse proxy </quote>
  7. I recommend a new print.php where you can print the order info.
  8. Sorry, I did not understand the SQL. What exactly do you mean by "fetches all the day for one day"? What is "interval 1 day"?
  9. This problem seems to be specific to browsers. Have you tried to submit the form by pressing the enter key in different browsers?
  10. You can't hide in the address bar. You can't restrict the user from tying whatever he/she wants in their browsers. You need have control the logical flow of using a different and secure mechanism. Some sort of input filter may help you.
  11. I did not go through the entire code. See if this helps... <?php echo "$picture[$num]" . ".jpg"; ?
  12. It looks like you need include(). Use the include() function to include other PHP scripts within your current file. For example, include 'next_script_to_run)'; Also, the if statement appears to have a logical mistake. if ($user==$username & $pass==$password) Notice the == symbol. == is the or operator. You may also use if ($user==$username and $pass==$password)
  13. Have you tried phpinfo()? <?php phpinfo(); ?> Save the above in test.php and access it from the browser. It gives you the information you are looking for.
  14. Hi, You are using GET form method. This is a security risk when you are injecting data into a database from the user input URL. Consider using POST form method. Your form will look like: <form method="post" action="formhandledurl"> <form field 1> </form field 1> <form field 2> </form field 2> </form> You may also use a hidden form field like this: <input type="hidden" name="hiddenfield" value="hiddenfieldvalue"> Researching about POST and Hidden form fields will sure help you. Also try to learn about input filtering.
  15. I use Zend framework for most of my web sites. You may want to have a look at Zend_Mail http://framework.zend.com/manual/en/zend.mail.html . There are many useful SMTP mail scripts in phpclasses.org.
  16. That's exactly is what the manual says, although it is not faulty. I don't know how this works on Windoze. In my experience I have learned that it is safe and reliable if you use a PHP script that connects and authenticates to the SMTP server to send mails.
  17. "Returns TRUE if the mail was successfully accepted for delivery, FALSE otherwise. "It is important to note that just because the mail was accepted for delivery, it does NOT mean the mail will actually reach the intended destination. " From http://in2.php.net/manual/en/function.mail.php
  18. if (mail()) { // mail was sent } else { // mail was not sent } Try using a reliable method, ie, authenticating to the SMTP server and then sending the mail.
  19. When the URL is something like "index.php?data=something", You can use the $_GET PHP predefined variable to collect data from the URL. Example, <?php $data = $_GET['data']; echo $data; // Or store this somewhere ?> The above script would display something on the web page. If the form method used is POST you would not see the ?data=something part of the URL. It would just be index.php. You could use $data = $_POST['data'] to capture the information posted by a form. You would want to read more about form processing in PHP. The below links provide more information http://php.net/language.variables.predefined http://www.w3schools.com/html/html_forms.asp http://php.net/manual/en/tutorial.forms.php
  20. It depends on how you want to implement it. You could use a GSM modem, hook it onto the server, insert the SIM card to the modem, and use PHP to send and receive messages. If you send too too many messages, consider subscribing to an SMS service. Usually telephone operators offer this service. You could use their APIs to customize your site.
  21. Use cookies. Read http://in.php.net/manual/en/function.setcookie.php As per the example in the manual: Use the below script to set a cookie in the user's browser. Good to use after the user authenticates his/her credentials for the first time. <?php $value = 'something from somewhere'; setcookie("TestCookie", $value, time()+60*60*24*30 ); /* expire in 30 days */ ?> On the landing page use this: <?php // Print an individual cookie //echo $_COOKIE["TestCookie"]; if ($_COOKIE["TestCookie"]=="something from somewhere") { // Write code for automatic login } else { //User's browser does not have the required cookie. Do not login } ?>
  22. Hi, You need to use the value attribute in the HTML forms. For example: <input type="text" name="name" size="40" value="<?php echo $_POST['name'];?>" /> value="<?php echo $_POST['name'];?>" is what you are looking for. Similarly you need to display the value for all the form fields.
  23. Hi, Open the file in append mode and fwrite. Here's the example. <?php $myString = "Some text"; $fh=fopen('test.txt',"a"); fwrite($fh,$myString); fclose($fh); ?> Make sure to set appropriate permissions to the file test.txt so that PHP can open it.
×
×
  • 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.