Jump to content

The-Last-Escape

Members
  • Posts

    116
  • Joined

  • Last visited

    Never

Everything posted by The-Last-Escape

  1. does anyone know a simple way to limit a string to the first word in it?
  2. I\'ve a very big serveur : 4 xeon 2GHZ with 2Mb Cache Each ... 3 Gb Memory ECC Server INTEL SRSH4 .... And i\'ve Redhat 7.3 and a lot of software ... I want to install a lot of website in this server, but my problems it\'s to know if, because of a lot a people connected to the machine, the apache will be work slowly ... and the machine working without problems and with a liltle % of CPU and Memory Usage ... There is a solution ? more than 1024 Sumultaneous Users ? Or maybe 2 or 3 Apache on the same server ? I\'ve a lot of website(6) who have more than 35 000 users/Days and a mensual trafic at 400 Gb/site ... Please help me ! Thanks !!
  3. ve been running a dating site written in php/mysql. Most of it was built by someone else and I've done some minor modifications. It works fine 99% of the time, but occassionally it makes small errors when writing a record to the database. For example, it might post a record for a new member and all of the info is correct except it doesn't post the "M" or "F" for male or female. Or it might be a logical field and it posts a "N" instead of a "Y". Like I said, it posts most of the record correctly with a small exception like the ones above. Also, it might post 99 records correctly, but then one day I get a glitch. I've only got about 500 members right now, so it's not a big deal. But when I get up to 5,000+ members, these glitches will become a daily occurance! Do anyone know why this might happen? Is there any way of keeping this from happening? I've only been using PHP and MySQL for a year, so I'm not expert, but I'm assuming this isn't normal. Thanks in advance for your suggestions.
  4. ok, i got this code which is supposed to select a random row in mysql. select * from quotes order by rand() limit 1 i have 10 rows in the table, and i seem to get the same row each time! i don\'t understand. maybe after reloading about 50 times i\'ll get one different row, then it will go back to the previous one for another 30 times. i have no idea why it\'s really not randomizing these. any ideas?
  5. To be honest, I can't remember if I dreamt this (dreaming about programming, such a life I have) or if it is real, but is there a function one can call to get the php code from a php file displayed in a browser...I know that you can't just save a php file and look at the code, it is all handled on the server end, but I either dreamt or read that there is a function that you can use to read the backend code for any file...and if this is so, is it only possible on localhost or can you check any url in cyberspace for it? I apologize if i make no sense.
  6. I basically just need to be able to display all logged in users. The actual log in authentication I'm able to cope with and I can also get logged in users into a dbase table so as to display them. However I'm stuck on how to delete them from the table in the event of them logging off the site. I found tutorials but as always seems to be the case they're never exactly what you need. In short how can I clean up a mySQL table if the user logs off and the session ends. thanks
  7. Please, how can I transformer the date 12/07/2001 08:15 to timestamp?
  8. Hi I get the following error when i load my login page. Fatal error: Call to a member function query() on a non-object on line 35 Below is the code: <?php // database connect script. require 'dbconnect.php'; if($logged_in == 1) { die('You are already logged in, '.$_SESSION['username'].'.'); } ?> <html> <head> <title>Login</title> </head> <body> <?php if (isset($_POST['submit'])) { // if form has been submitted /* check they filled in what they were supposed to and authenticate */ if(!$_POST['username'] | !$_POST['s_password']) { die('You did not fill in a required field.'); } // authenticate. if (!get_magic_quotes_gpc()) { $_POST['username'] = addslashes($_POST['username']); } $check = $db_object->query("SELECT username, password FROM student WHERE username = '".$_POST['username']."'"); if (DB::isError($check)) { die('That username does not exist in our database.'); } $info = $check->fetchRow(); // check passwords match $_POST['s_password'] = stripslashes($_POST['s_password']); $info['password'] = stripslashes($info['password']); $_POST['s_password'] = md5($_POST['s_password']); if ($_POST['s_password'] != $info['password']) { die('Incorrect password, please try again.'); } // if we get here username and password are correct, //register session variables and set last login time. $_POST['uname'] = stripslashes($_POST['uname']); $_SESSION['username'] = $_POST['username']; $_SESSION['password'] = $_POST['s_password']; $db_object->disconnect(); ?> <h1>Logged in</h1> <p>Welcome back <?php echo $_SESSION['username']; ?>, you are logged in.</p> <center><h3>Relations</ h3></center> <center><h3>Please Click relations to access the database relations index.</center></h3> -------------------------------------------------------------------------------- <?php } else { // if form hasnt been submitted ?> <h1>Login</h1> <form action="<?php echo $_SERVER['PHP_SELF']?>" method="post"> <table align="center" border="1" cellspacing="0" cellpadding="3"> <tr><td>Username:</td><td> <input type="text" name="username" maxlength="40"> </td></tr> <tr><td>Password:</td><td> <input type="password" name="s_password" maxlength="50"> </td></tr> <tr><td colspan="2" align="right"> <input type="submit" name="submit" value="Login"> </td></tr> </table> </form> <?php } ?> </body> </html> Any help would be much appreciated.
  9. how do i design a layout as below : - Item Description Serial Number Qty Unit Price Amount(RM) 1. ABC 3956, 3957 2 8.00 16.00 2. ABD 4235, 4236, 4237, 18 16.00 288.00 4238, 4239, 4240, 4241, 4242, 4243, 4244, 4245, 4246, 4247, 4248, 4249, 4251, 4253, 4254 total 254.00 commission 10% 25.40 Grand Total 229.60 I have already done a part of the php script just lack how to fit unit price and amount in the coding. Below is the script that i have done, please help me to modify the script to design the layout as above. please advise.Thanks a lot. $count = 1; $result3 = mysql_query("SELECT package, serialNo FROM orderdetail WHERE resellerID = '$resellerID' AND orderNo='$orderNo' ORDER BY package, serialNo"); $data = array(); // build array of serial numbers for each package while (list($p, $s) = mysql_fetch_row($result3)) { $data[$p][]= $s; } echo "<TABLE WIDTH='100%' BORDER ='1'>"; echo "<TR>"; echo "<TD WIDTH='10%' ALIGN='center'><FONT CLASS = 'View'><B>Item</B></FONT></TD> <TD WIDTH='30%' ALIGN='center'><FONT CLASS = 'View'><B>Description</B></FONT></TD> <TD WIDTH='10%' ALIGN='center'><FONT CLASS = 'View'><B>Quantity</B></FONT></TD> <TD WIDTH='50%' ALIGN='center'><FONT CLASS = 'View'><B>Serial</B></FONT></TD>"; foreach($data as $pkg => $s_array) { $num = count($s_array); $gserial = listSerNums($s_array,0); echo "<TR valign='top'> <TD><FONT CLASS='normalText'>$count</FONT></TD> <TD><FONT CLASS='normalText'>$pkg</FONT></TD> <TD><FONT CLASS='normalText'>$num</FONT></TD> <TD><FONT CLASS='normalText'>" . listSerNums($s_array, 6) . "</FONT></TD> </TR>"; $count++; } echo "</TABLE>"; function listSerNums($sers, $n) { $i = 1; $j = 1; $x = count($sers); foreach ($sers as $s) { if ($j++ == $x) { $res .= $s; } else { $res .= $s . ', '; } if ($n != 0) { if ($i++ % $n == 0) $res .= ' '; } } return $res; }
  10. Yes I relised that to well I hope I helped you master anyway
  11. i am designing a member login program and am having problems working out how to lay out the DB. i have a maintenance option, where they fill in a form and it adds it to a db, would it be best to have 1 maintenance table with all of the members queries etc in it or a seperate table for each member? but i will need to be able to reply to the queries and have them stored too. so should i use a maintenance post table and then have a replies table, or should i have a table that has all the members and all of their posts in it?
  12. I donot see listen 80 in my document anywhere
  13. Ok heres the deal. I need to get input data using method post so i can view the data later. basically i need a php script to route the data in post to like an email address, or something. This is really important to me if any onw can help it would be greatly appericated.
  14. You must be a clever young man
  15. OMG! Master I have never ever seen such as list of questions this big before! Anyway I will try to awnser a few questiosn for you. 1. When working with php what is the quickest way to learn, I don't know if I will master all the tags, hopefully I will, but I understand the concept of if, while, and, looping, and other related statements, but not how to use those and principles to write out my own programs, I can't even validate forms myself, actually haven't even yet, I want to master these things, what are the best steps for me to do that, I have went through every tutorial online that could be found and www.php.net manuals. And this site. and the php and the faqs website as well, and no luck, I am learning slowly week by week, but I want to start a full fledged career soon, I will always study new things, but I need the basics. To get started with PHP look at online tutorial sites such as w3schools.com to get the real basics. Once you have learnt the basics at w3shools.com (make sure you run the examples too). Try to create something out of what you have learnt. You should be able to create someting even its someting that sounds dumb but its a start everyone starts somewhere. When I started PHP I first created a guestbook, however I learnt how to create one first by running through a turorial. I then created my very own guestbook from scratch from what I learnt from learning the Basics of PHP and creating the guestbook. If you get stuck search the manual over at www.php.net. Another way of learn PHP, which most people prefer to do is to download a premade script and play around with it. ALso dont just rely on online tutorials get out there into a libary / book store and have read through a good PHP book. Such as PHP 5 for Dummies 4. When should I use database driven websites and when should they not be database driven should every website I do, have every single page database driven, or should I do the special tasks database driven, like login names, and log in related stuff, or stuff like big search functions, and guestbooks, and forums and things of that nature,. 5. Should forms be database driven themselves You should only need to create a database driven site when your site requires dynamic content, such as a guestbook will require a database to keep track of the entries vistors have made about a site. You shouldn't use a database to show a login form for example, unless you have all your templates stored in the database for truely dynamic site. Forms shouldn't be database driven no, however the data that is collected from the forms can be stored in database, a flat file database or to be used in general. 6. I know that I want to learn how to process forms with php, and how to validate them, but I have heard it's better to use javascript to validate, and php to process. Or asp whichever server side you are using, I heard it's best to use javascript to do the validating. is this true or should I do both with php. Yes I would say use javascript for form validation as javascript can permit a form being submitted if a required form field is not filled in or there is an error in one of the form fields. PHP on the other hand can do the same (accept permit a form from being submitted) but it can be slower. 7.After I master php, will it be very easy for me to do tasks when given, or build websites then using jsp, asp, cf, or am I going to have to learn all those languages as well, or is it the exact same thing just different sintax and once I get the right idea down, then the rest falls into place. There are lots of different web programming langauges out there. If you are to provide a service such as you creating websites for people don't overload yourself with lots of programmiung languages chose one langauge that you are compfortable with, one that is easy to use, cost efficent etc which PHP is. JSP, ASP, CF etc are alot more difficult to use and can be quite costly. 8. IF that's the case then why do people who know for instance asp, why don't they say they know jsp, php as well because they might as well know all if they know one if this is the proper case. Web Programming Languages can differ dramatically as I have only PHP I cannot comment on ASP or JSP. However these three lanaguages are completely different. 12.Can I create a php file, and save it with a .htm, or .html extension and it still be good or the same effect if so what would be the point, is the .htm or html, or the .php better. You can code PHP in a .htm or .html file but your server must be configured to parse .html files as PHP. Webhosts will only allow .php files for PHP, .html for CSS/Javascript etc. 13. What is the difference between .html, and .htm, I always use .htm as default is that the best choice, or should I use .html. As a permanent complete resolution for all things. There is no difference between .html and .htm file extensions but .html never used to exist. the .htm extension was used on OS that could only allow upto three letters as their file extensions. This changed since Windows 2000 as OS could use extensions more than three letters. This is why there is far more three lettered extensions, such as .doc, .txt, .inc, .xls, .pdf etc. compared to four lettered file extensions. 14. What is shtml. SHTML is HTML on steriods. Well not really but it allows you to stuff like inlude other HTML files in to .shtml document or to should the time other stuff. But SHTML is only limited certain functions. It is rarely used. 16. Should I stay away from php 5 for awhile longer, I was told it has a lot of bugs, and isn't good to use it's functions right now until in the future, should I not use it. Who told you that! That is not true! Although PHP5 did have it problems when it was first released. However this has been corrected and fine to use. But unfortuanly many webhosts have not upgraded their versions of PHP (PHP4) to the newer version. So if you are planning on creating a dynamic website for a client before you go a head and create their site for them you will need to check that their hosting account supports PHP and what version the server has, however 90% of the time it'll be PHP4 only a handfull of hosts have PHP5. If they have PHP5 then it doesn't matter whether you code in PHP4 or 5 as PHP5 is backwards compatible. 17. Are there any cross browser issues when relating to server side scripting like php, jsp, or asp, or does all php work in all browsers, and all jsp, and all asp, work in all browsers, if this is not true, then what do I have to do with php to make sure I follow all guidelines to make sure it's as close to browser compatible as possible. IF someone is using internet explorer or firefox version 1( I know it's a 1 in a million) would they be able to see all php and asp as well as someone using a new browser, or do certain browsers not use certain server side languages. I have never heard anything about browser compatibility when relating to something like server side scripting. Well PHP, JSP, ASP is a server side language meaning it runs of the server and not the browser. The only thing you should worry about with cross browser compatibility is your HTML, CSS and Javascript as these are Client side lanagues (meaning these are run of the clients computer and not the server it self). Any server sided lanague shouldn't show the true souce (your PHP code) when viewed in the browser by going to view -> source but only the output which will be your HTML/CSS or Javascript. This what happens when you request a page on website that is a php file. User click link to see products (products.php) > browser sends request to server for a file called products.php > The server checks to see if the file ends in .php prefixif it does it'll send it to the PHP Intepreter > PHP Intepreter parses the PHP code and returns the output (list of products) to the server > Server returns the list of products to the browser > Browser parses the list of products and displays then to the user. 19. If I learn really good graphic arts, where I can create logo's banners, and everything else, plus finish mastering xhtml, css, javascript, php, asp, jsp, coldfusion, sql, it's variations. Where do I go from there, is there anything else I can learn that will help, is there anywhere else I can go to learn more, are there any other languages I should start on after that. You dont need to learn every single web progrommaing languages under the sun. I would recommend you to learn HTML and CSS pretty well these are the only two languages that are important for creating a site that looks good in any browser. Secoundly consentrate on another langauges or two which is server sided sich as PHP and MySQL and thats your lot! If you where to learn all the web programming lanagues under the sun it'll take you years to master them you cannot just pick up a lanaguage, click your fingures and say "hay presto!" and be a wiz at that lanaguage. 20. I have heard of ajax, what are it's purposes and reasons for being, are there any reasons for it, and if so, why have I never heard about it from a client, or other web designer, I have only seen it in one place and that is w3schools.com With AJAX you can create extremely rich content and display data without having to keep refeshing you browser. For a good example of where AJAX is being used go to [a href=\"http://www.forgetfoo.com/\" target=\"_blank\"]forgetfoo.com[/a]. Click on the links on the left and look at your browser loading bar you'll see it will never appear this where AJAX is really cleaver. Instead of you having to clcik and link and then wait for your browser to refresh the page instead AJAX tacks the back door aproach. It request for the page in the background. For more information on AJAX have a read about it over at [a href=\"http://en.wikipedia.org/wiki/AJAX\" target=\"_blank\"]wikipedia.net[/a]. You wont really get any think from a client reqesting their site to feature AJAX as, well they won't have a clue what it is. 22. What is the height of php knowledge, how will I know when I can say I have mastered php. I have being using PHP for about 2 years now and I'm still learning but I have not mastered it as I havn't learnt every single function, configuration setting or developed enough apps to be a master. No one can really say they have mastered PHP. 23. How long will it take for me to be able to do my own stuff in php without a lot of checking back with the references. You are always going to be finding yourself winging your way back to php.net or some help forum or even a book for help with PHP even if you are deserted on some island miles a way from any where. I have done it loads of times sitting in front of my computer screen pulling my hair out asking myself Whats that function called again? How did I do that? Why aint this working?, How can I do/this/that and the other? 24. Are there multiple ways to do each thing with server side languages, for instance, with php I see there are like 100 differnet people that create 100 different sets of coding to validate and process forms, does that mean there are different ways to do different things, again meaning there are not just 1 specific way to process forms, but actually many, and if so is this the same for asp, and all the others. Yes there aloads of different ways a off doing the same task, there isn't any set standard to do things. People just do what best for them and people have different opinions. This is becuase PHP is classed as a "loose" programming lanaguge. Such as an if/else statment you can do this: Code: if($var == $var1) echo "something else"; else echo "something else";or Code: if($var == $var1) { echo "something else"; } else echo { "something"; }or another style Code: f($var == $var1) { echo "something"; } else { echo "something else"; }As you can see they are the same thing but coded diffferently. PHP allows to get away with this but if you where you doing in another language such as ASP it'll probably have a right out sissy fit. 29. How do I use xml with xhtml, should I make it a habit of incorporating xml, into all Xhtml, along with my css, and javascript, is it something that would make me a better designer in some way. What's its purpose, what's it for, and how do I learn how to use it, is there any real significance for it's use, or is it just there. xHTML is XML. xHTML has a standard set, same goes for XML. These standards are set by w3c (World Wide Web Consortium). With xHTML all (accpet a few such as ) tags must be closed, all tags and attributed must be in lowercase etc. Well thats my big 2cents worth there. Scince awnsering all these questions it suddenly dawned on me that you have look at w3schools.com and going through all the tutorials there and said "I have to learn all these lanaguges to be web design". This is not the case. HTML/CSS/PHP and MySQL are the moist common. Hope this helps
  16. When people talk about ColdFusion, they could be referring to a couple of things. They could mean the ColdFusion Markup Language, a tag-based language that you can use to create data-driven Web sites. But it's also the ColdFusion Application Server, which translates the tags, talks to the database, and returns HTML to the Web browser. Internally, ColdFusion works similarly to other hypertext preprocessors. The application server recognizes ColdFusion markup, denoted by <cf, processes this code, and performs any necessary operations. Then it returns the result in HTML. There are, of course, a number of technologies that do this, such as PHP, ASP, CGI, JSP, and so forth. If you're familiar with these languages, there are a number of reasons to choose ColdFusion for making dynamic Web applications. ColdFusion Is Easy to Learn For one thing, ColdFusion is an easy language to learn. Because it is tag-based, like HTML, it will be familiar to newer programmers. ColdFusion also comes with its own Web-based administration system that makes it convenient to manage your sites. This system, known as the ColdFusion Administrator, is a Web application itself written in ColdFusion. From within the administrator, you can perform a number of tasks that help make deployment and maintenance of your applications easy. Here are just some of the things that you can do in a few mouse clicks: Create searchable document directories that are instantly available to your ColdFusion applications. Search Word documents, Excel spreadsheets, HTML, XML and PDF documents, and more with the built-in Verity K2 engine. Manage all of your ODBC and OLEDB datasources. Verify connections, update usernames and passwords, and connect string attributes. Ease server monitoring with MIB support and sophisticated log-file filtering. New with ColdFusion 5, you can create and deploy server probes to monitor the health of your server. Create ColdFusion Archive (CAR) files to wrap entire applications for easy backup and deployment. Manage server access with sandbox security, allowing for multiple developers to coexist in protected environments on the same ColdFusion server. No other Web programming language comes with such a tool. Adobe, formally Macromedia ColdFusion is the leading cross-platform Web application server that gives you the fastest way to build and deploy scalable web systems. ColdFusion enables you to incorporate live data into dynamically created web pages. For example, with ColdFusion your online store can actually deal with real-time inventory levels, enabling you to notify your customers of any out of stock items. Benefit from these features: Rapid Development Build complex applications quickly and easily. Scalable Deployment Deliver reliable, complex sites and applications with load balancing and fail-over. Open Integration Use the full range of Internet and enterprise technologies. Complete Security Control Access your servers for development and administration and use advanced security features to protect applications during run-time. ColdFusion application processing When a user clicks a 'Submit' button on a form or a hypertext link on a page, the user's web browser sends an HTTP request to the web server via the Internet or an intranet. The web server processes the data submitted by the client and calls up the appropriate .cfm page through a server API. ColdFusion reads the data from the client and processes the CFML in the page. Based on CFML, the server interacts with database servers, file systems and mail servers. ColdFusion dynamically generates an HTML web page. The HTML page is returned to the user's browser. Making .cfm pages ColdFusion tags (CFML: ColdFusion Markup Language) that allow ColdFusion functionality are incorporated into normal HTML pages. The following code shows a simple ColdFusion example: This ColdFusion Markup... ...results in this HTML output. <CFQUERY NAME="ProductList" DATASOURCE="CompanyDB"> SELECT ProductName, Price FROM Products </CFQUERY> <HTML> <BODY> <H1>Company X products</H1> <CFOUTPUT QUERY="ProductList"> #ProductName# ?#Price# </CFOUTPUT> </BODY> </HTML> <HTML> <BODY> <H1>Company X products</H1> Mower ?80.00 Drill ?45.00 Jeans ?30.00 Goods ?25.00 </BODY> </HTML> By using CFML tags, data such as 'ProductName' and 'Price' can be retrieved from a database so that any pricing changes made to the database are automatically reflected in the web pages. SQL statements are embedded into pages to interact with the database. For instance, the web pages could reduce the number of items in stock when an item is purchased. With standard HTML the actual web page would have to be manually edited to reflect any price changes. More information ColdFusion also features the Verity search engine, mail processing from within your pages, secure transaction processing and password authentication. All these features give you the ability to develop dynamic, interactive web applications in the minimum amount of time. From online stores with real-time inventory control (no more customers ordering out of stock items) to Human Resources intranets that reflect live information from an HR database, ColdFusion brings your web applications to life.
×
×
  • 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.