Jump to content

raza.shahzad

Members
  • Posts

    23
  • Joined

  • Last visited

    Never

Everything posted by raza.shahzad

  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.
  16. thankyou sir, you have helped me to recall what i once put on paper and forgot. the idea that you provided matches the one i created in my mind a few days ago(although i am not the pioneer of this idea). i am once again thankful to you for your generous help.
  17. Dear Mr. HitMan, your suggestion is good, same as what i thaught once and is acceptable. please clear to me one thing about the time/expiration thing that you mentioned in your reply to my question. when the user is offline for a long period is it the duty of server admin(me) to delete manually the username or the login info from the database or the PHP script will automatically delete the login info. what is the possibility without using the cookies or sessions. cookies are what i can use but i am confused about sessions because i have not learned much about them. i just know that they have some relation with cookies and object oriented programming too.
  18. i really haven't understood your question completely but as an amateur programmer i use to print the variable that i use as a handler for mysql query. like; if you are confused about the step to which the script works you can echo $conn, $db, $result, etc one by one just after the line in which you placed $conn = ...., $db = ...., and so on. this will give you an idea about the step at which your script has a flaw. it is childish( i think it is) but at times it works for me.
  19. dear friend, if you are using mySQL to store the profiles of your registered users then you can execute an mysql query using PHP to display the users registered with you. but it depends what database or technology you are using to store the profiles of your users. and the same is what you have not mentioned.
  20. Hi there. Please tell me whether there is a way by which the server can standalone'ly check that the user is online or not. the user authentication thing. I don't want the browser to tell me that the user is online by setting up cookies or by other means. because i find that if the cookies are disabled the website is set useless. please help in this regard. PHP freaks asks for the login duration when we log in (60mins) or unlimited. i want some technique by which the server may check whether the user is online or not.
  21. [quote]Copying a site would be pretty simple however I imagine. Just list all the features, then start programming.[/quote] First: do i need to copy the website that i want to clone to my harddrive for the purpose of duplication. remember, my question was in reference to the jobs that are offered at freelance websites asking for programmers to clone websites for money. does this thing really benefit? [quote]I still find myself (especially when Im using php - its very disorganised / un-standardized) using reference materials (the manual) quite often.[/quote] with due respect please tell me your level of expertise in programming so that i may consider myself of some worth....
  22. hi there. i have heard a lot about orkut community. the website is simple and offers good services to its registered members. by stating the above, i want to ask how can i make a clone of this website. secondly, is there any special technique of making clones. do i need to learn some new skills or my knowledge of php and html is sufficient for this purpose? There are dozen of other different websites offering different services. can i make clones of every website depending upon the knowledge of programming language i have. what are the things that i need to know about a website while cloning.? my second question is typical: i have learned PHP(from a book by wrox publishers 'professional PHP programming'), HTML, Flash, Photoshop, freehand, dreamweaver, fireworks, C++(a little bit from another book), CSS and other similar things by my own without the help of anyone. the conditions under which i learned all these things lead me to a mixed mind. now i can program and/or design many things(web pages) but i always use help from books. my question is whether it is necessary for me to learn every function, etcetera from the book so that i may become professional or is it all right if i don't learn these things and carry on with my career as i am doing right now. i must add that i am doing masters in mathematics from a university in my city. and doing two things at a same time requires a lot of efforts. Please guide me keeping in mind that i want to adapt web programming as a hobby and part-time-profession(home based/freelance/etc)
  23. I started to work out an online chat room using PHP. the basic idea was to use PHP wity MySQl to provide the users with a good online web browser based chat experience. In doing so i caught myself up in a problem that i want to discuss with you guys. Displaying the list of online users is not a big issue with PHP. The 'behind the scene' structure is like.... 1. the user logs in to the website with his username and password. everything is as simple as it can be. and there can be many other ways for doing so. i will appreciate help in any direction. 2. the database contains a column that saves the status of the user say: name=status value=online or offline. if the user is online the status is set to the same and for offline the status in the database is saved or changed/updated to offline. as long as the user uses the website/chat his name appears to be online and as he/she clicks log off, his status is set back to offline. and so on. the problem comes when the user disconnects without clicking the log off link. in this case i am unable to set the database entry of status to offline because the user leaves the chat, turns off his browser or shuts down his PC without clicking the log off button due to which the process remains incomplete and other users who are online see the person to be online too. Simply speaking, i want to know a better way to implement to my chat website. i wish the solution be like yahoo or msn messengers. whenever a user logs off or shuts down his PC accidently, the other user recieves a message that MR.XYZ has logged off. Is there any solution to this problem. definitely there are many. the one i am thinking of is to place a field in the database that stores the time the last msg was recieved from the user and if the time extends a particular period, say 15minutes, the script considers the user to be offline. but this one is not the same as i want it to be like yahoo messengers'.
×
×
  • 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.