Jump to content

raza.shahzad

Members
  • Posts

    23
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

raza.shahzad's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Dear friend, there are many methods/techniques that you can use for the desired result that you want. the simplest is to create a file and put it in the root directory for all users. then use the mkdir and filecopy techniques to copy that file to a newly created directory for your registered users or for anyone who logs in to your website. this  method is the simplest. and to secure your code from being used by others at the root level you can simply put <?php exit(); > at the first line to avoid anyone from viewing the page. and while copying the contents of this page which are typed below the <?php exit.... line you can make the thing work quiet easily. hope you get the point. other method can be using database to store complete page scripts and running queries for each individual but it will be a bit difficult for an amateur PHP programmer. but you can give it a try.
  2. dear friends, while working on a project i came across a question which i asked to my-self. the answer seems to be very straight forward but to satisfy my mind i want opinions from you people. the question is: is it better to put images(that are uploaded from client side onto the server side) in a database say MySQL, or putting the paths to images in database and images in separate directories is a better approach as there are a few constrains while adopting any one of the two techniques. these constrains are not only the consequence of PHP programming tricks but also due to the work needed to be done for the accomplishment of job.
  3. Hello every one, [quote]<?php // The message $message = "Line 1\nLine 2\nLine 3"; // In case any of our lines are larger than 70 characters, we should use wordwrap() $message = wordwrap($message, 70); // Send mail('caffinated@example.com', 'My Subject', $message); ?> [/quote] is there any problem in the above code? i used it to try n send email to my account from my windows PC. i have apache 1.3x, PHP 5 n mysql installed with some PHP extensions too. i don't have additional/extra knowledge of sending emails using php scripts. i can do it using smtp using tutorial in the book that i follow but i don't want to get stuck with smtp and other things. i want the send mail to be simple. few lines of codes.
  4. hi there once again. my mind clicked once again with a question. what if there is no user online and no script is running on any browser. i.e. on the clientside? can the server smell a user's status (online or offline)? i read a book saying that most network applications consist of two pieces: a client and a server. further it says that we focus on the communication process from the client side. the request or control from the serverside is not defined in it. the chapter's name is PHP connectivity. is there any way that the server understands by itself that someone is offline now or then. like msn messenger understands that a user is offline when someone disconnects by any reason. can the methods of msn or yahoo messenger be applied on websites with PHP. please refer to me a solution if there is any.
  5. dear friend, it looks like that you are looking to save your time then saving your file. if i am getting it right, you have asked for templates that one can define in dreamweaver. and then set some editable region for other files to use. if this is the case goto file menu, select new and select template whether html or php. its upto you. carry on with it.
  6. you need some quick tutorials regarding database handling (php and mysql) also you need some more tutorials.... you can search on google for such articles and surely you will find some in your favour. http://blazonry.com/scripting/linksdb/start.php is also a link that describes to you how to deal with mysql using php. The tutorial is amongst the first ones which i read online. try it out.
  7. Sir, i have understood the use of this forum and i am following the rules of messaging for purpose, not for status. I am trying to sort out problems that the visitors are facing to the extent i can. I have a good knowledge of PHP and i can reply to question related to PHP and other programming languages as well. but still i call myself a learner because you guys are superior to me in every field. so i respect all of you. this is the last ir'relevant msg that i am posting just because you asked.
  8. [quote]I would like to add a checkbox right before the SEND button that says, "if you want to send me a copy, please check this box"[/quote] i suppose that if the check box is clicked(checked) and the send button clicked then the reciever as well as the person whom you refer as 'me' both will recieve the same msg. if above is correct then you can place an if condition for processing the form which checks whether the checkbox is clicked or not. if the condition returns 1(checked) then email is sent to multiple recievers else it is sent to only one person. hope you get my point.
  9. are  $articles->id and $articles->title giving correct display? echo $articles->*; them for test purpose
  10. dear friend, many people use the word database for mysql, oracle etc. if you take the meanings of database as the same you can store the form data in a file say data.txt and then retrieve the data into another file using some simple functions. you can ask for more from here if you wish to use files. no matter how huge the amount of data is you can do it this way.
  11. friend, i hope your problem has been solved. yet if you encounter any problem you can reply to this msg of mine. thankyou. one more thing. your subject said that you were looking for a maths problem and being a mathematics student i took it wrong and thought if you were looking for something related to algebra, geometry or calculus etc. anyways, keep working good on your project.
  12. [quote]want to make some pages password protected. In order to do this I need to move them into another directory and change the .htaccess[/quote] dear friend, in my opinion you can use this on top of you pages [quote]if ($password != "abcxyz") { echo "error, unauthenticated user"; exit(); } else { the body of your webpage } [/quote] and to access the page properly you need to use the following http://www.abcdomain.com/anyfile.php?password=abcxyz don't tell the password to anyone.
  13. friends, all of you are PHP experts and i respect your knowledge in the field of PHP programming. i want to ask one more thing. how can i change the nonspammer sub-title that is being displayed below my username to something else on this forum. people have different sub-titles attatched to their names. please. it will feel good if i have a sub-title saying that i am a PHP programmer.
  14. dear friend, [quote]Here is what I have to accomplish: Purchase Database Index page displays: Account Code, Account Name, Budget and Amount Remaining[/quote] i suppose that the above quoted statements refer to the project you are handling and the problem you are facing is as under: [quote]Every time somone adds a purchase it will subtract from the budget in that account and display the remaining amount of monies in that account.[/quote] this is simple. suppose that $cost is the cost of item purchased and $budget is the amount the visitor has. $remainingamount being the.... oh u can understand. then $remainingamount = $budget - $cost; simple :) if you want to ask for the process that you have to apply to your database then you can ask. otherwise your present question has been answered. i hope....
  15. dear friend, the problem is simple and you are making it complicated. just goto a website that offers tutorials for PHP and look for a tutorial that refers to searching through databases. thats it, you will surely find your answer there. what i asked you initially was about the database you use. if it is MySQL then you can place a form tag for search'ing purpose and put action="abc.php". then in abc.php you can put the code that produces the result from mySQL database. suppose that the visitor to your website is looking for a username similar to $username. then you can put the following in your abc.php file [quote] // connect to the server if (!($link=mysql_pconnect($dbhostname,$dbusername,$dbpassword))) { echo ("error connecting to the server"); exit(); } // select the database if (!mysql_select_db($database,$link)) { echo ("error selecting the database"); exit(); } // search for the requested/required username $details = "SELECT * FROM dbtablename WHERE username LIKE '%$username%'; if (!($result = mysql_query($details,$link))) { echo ("no match found".mysql_error()); exit(); } // print the result if match is found while ($myrow = mysql_fetch_array($result)) { echo $myrow['username'];    // here you can print all the profiles you have. $myrow[] is an array and you have to place in [ here ] the values of entities placed in your db table. } [/quote] i hope that i have made it easier for you.
×
×
  • 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.