Jump to content

wildteen88

Staff Alumni
  • Posts

    10,480
  • Joined

  • Last visited

    Never

Everything posted by wildteen88

  1. All the errors you are getting are caused by the first error message. Once the first error message is solved all the other errors will disappear. To solve this error you will need set the password for your mysql username with the OLD_PASSWORD function. You can do this via the command line/shell if you have access to this. If you dont then ask you host to set your mysql password with the OLD_PASSWORD function. [a href=\"http://dev.mysql.com/doc/refman/5.0/en/old-client.html\" target=\"_blank\"]Click here[/a] for more information on how to set your mysql passord with the OLD_PASSWORD function.
  2. The problem is to do with the order in which you include your pages. Header.php is included before caseswitch.php Now in caseswitch.php you include your forum when you click the forums link. Now when you include your forum index file it has session_start as the first line of code. Which inturn stops the script from running as you have output from header.php To solve this you need to add ob_start() as the first line of code in your index.php file and the ob_end_flush as the last line of code in your index.php filem like so: [code]<?php ob_start(); require_once ('header.php'); require_once '../dbsettings/databasesettings.php'; include 'caseswitch.php'; require_once ('footer.php'); ob_end_flush(); ?>[/code]
  3. [!--quoteo(post=375120:date=May 19 2006, 04:12 AM:name=PCB guy)--][div class=\'quotetop\']QUOTE(PCB guy @ May 19 2006, 04:12 AM) [snapback]375120[/snapback][/div][div class=\'quotemain\'][!--quotec--] I have been going through a tutorial. It is a tutorial for PHP 4. I have PHP 5 installed on my PC. I have read that the $_SERVER[PHP_SELF] is not supported in PHP 5. [/quote] That is completly wrong. PHP does support the PHP_SELF server variable. Now PHP will only out put something when using $_SERVER['PHP_SELF'] or any other superglobal array variables if register_globals is turned off on the server, But you can sitll use PHP_SELF but you call it this way instead: $PHP_SELF, basically you use the index/key of the superglobal array as the variable instead when register_globals is turned on. And no PHP_SELF does not call the next php script but it gets the filename of the currently executing script, relative to the document root. Oh ghers a link for information about [a href=\"http://uk.php.net/manual/en/security.globals.php\" target=\"_blank\"]regsiter_gloabls[/a].
  4. [!--quoteo(post=375133:date=May 19 2006, 05:07 AM:name=Bhaal)--][div class=\'quotetop\']QUOTE(Bhaal @ May 19 2006, 05:07 AM) [snapback]375133[/snapback][/div][div class=\'quotemain\'][!--quotec--] Thanks for the reply. Let me elaborate on that second issue. One of the cases in the case switch is: [code]    case "forum":      include("forum/index.php");      break; [/code] But this produces an error: [code] session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at c:\site\www\header.php:5) [/code] I'm assuming this is because there is already a header.php as an include file. Therefore, this case is attempting to insert 'forum/index.php' inside of the original 'index.php'. Does that make more sense? [/quote] No it is not to do with having a header.php file but the problem is have something outputted (html/text/whitespace) to the browser before you include your forums index.php file, and so you get the headers already sent error message From what the error message is saying it has detected out on line 5 in index.php. Post the coie you have ob lines 1 - 8 so we can help you sort out this header problem.
  5. This is normal behavior with refresh. Refrsh clears any POST/GET data currently being transferred to the server/client. Thefore your POST'd data is not available any more. If you want the data that is currently in the form fields then you might want to save any POST'd data into a cookie/session and each time the page is requested put in the saved data into the form fields.
  6. Are you planning on running the script you are devloping in a live envrionment, eg host it on the internet. If so then your script wont actually launch any appas from the users computer but it will from the server as PHP is server side. Or is this just for for personal use on just your PC?
  7. Change your code to this: [code]$query = "SELECT DISTINCT(DATE_FORMAT(post_date, '%M %Y')) FROM $tablename";          if ($result = mysql_query ($query)) {     while ($row = mysql_fetch_array ($result)) {     echo("Date {$row['post_date']} <br>");[/code] DATE_FORMAT is not the name of the row you are getting the data from, but post_date is
  8. Try with just root as the username and then leave your password as blank first. If that doesn't work then consult the easyphp manual/FAQ [b]EDIT:[/b] With a quick search I found [a href=\"http://www.easyphp.org/faq.php3#6\" target=\"_blank\"]this[/a] [quote][b]6 - What are the: name of the server, the user name, the database name and the password for accessing mySQL capabilities?[/b] "localhost", "root", ""[/quote]
  9. [!--quoteo(post=374777:date=May 17 2006, 09:42 PM:name=moberemk)--][div class=\'quotetop\']QUOTE(moberemk @ May 17 2006, 09:42 PM) [snapback]374777[/snapback][/div][div class=\'quotemain\'][!--quotec--] I'm still a big fan of [a href=\"http://www.xs4all.nl/~peterned/csshover.html\" target=\"_blank\"]whatever:hover[/a] myself, but Ober's method works too. [/quote] Ober? [img src=\"style_emoticons/[#EMO_DIR#]/unsure.gif\" style=\"vertical-align:middle\" emoid=\":unsure:\" border=\"0\" alt=\"unsure.gif\" /] You mean obsidian right? [img src=\"style_emoticons/[#EMO_DIR#]/huh.gif\" style=\"vertical-align:middle\" emoid=\":huh:\" border=\"0\" alt=\"huh.gif\" /] Yes you can use the :hover pseudo class howewer :hover doesn't work in IE6 unless you are styling an anchor tag. But things have changed now as IE7 suports :hover on almost any html tag!
  10. The -> is an operator used when doing OOP (Object Oriented Programming) in PHP. It allows you to call functions/variables from within a class as [b]samshel[/b] mentioned above. -> is not the same as => => is used when assigning indexes/keys within an array.
  11. Make sure you are saving your files with a [b].php[/b] extension and not anyother extension! Such as .html
  12. If you dont want the links then either disable your javascript or enable/install adblocker on your browser. If you want PHPFreaks stay up then phpfreaks needs the money in order to pay for the hosting fees. There are plans to move away from the Kontera links within 6months (thats when the contract finishes or something) and eric the main admin will be sorting something else out with advertising. So if you want to see the back of the Kontera liknks click on one or two links a day which help phpfreaks finsih the contract earlier. Its the javascript that causes the site to freeze for 1 or 2 seocunds as thats how the links are inserted into the page. Thread closed Read [a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=93379\" target=\"_blank\"]this thread[/a] for more info on when the contract finsihes.
  13. There is a security script on this site which monitors the POSTed data being transmitted to the site and if it sees certain bits of code in the POSTed data then it thinks you are attacking the site and so you get that forbidded error message. If you want to post your code I would recommend you to post your code on a site called [a href=\"http://www.pastebin.com\" target=\"_blank\"]http://www.pastebin.com[/a]. When you go to that site make sure the [b]syntax highlighting[/b] drop down box has PHP selected. Now paste your code into the textbox underneath the drop down list and click the Send button your PHP code with be highlighted and displayed with line numbers. Now copy thge URL from the Address bar and paste that url into your post and just refer to the link when posting about your question/problem with the PHP script. Again this is not an error but a security script running on the server to help protect phpfreaks from hackers as we did get hacked a whiled back. Thread closed threre has been plenty of threads posted about this issue please read those before posting a new thread about the same issue.
  14. [!--quoteo(post=374598:date=May 17 2006, 09:12 AM:name=coz)--][div class=\'quotetop\']QUOTE(coz @ May 17 2006, 09:12 AM) [snapback]374598[/snapback][/div][div class=\'quotemain\'][!--quotec--] Thanks for that, yes im on windows server 2000 :) [/quote] As you are on windows i can provide infomration on setting up php to parse .php files with the PHP Intepreter. OK by now you should have apache installed on you computer and that Apache is working. You can test this by openning up a web browser such as Internet Explorer and typing in [a href=\"http://localhost\" target=\"_blank\"]http://localhost[/a] when you go to that address you should see the Apache Welcome page which confimrs apache is working. Now to configure apache. First find where your Apache httpd.conf file is located to and open it up. You can easily retrieve the file by going to Start > All Programs > Apache HTTP Server 2.0.58 >and click Edit the Apache httpd.conf Configuration File Your httpd.conf file should now be open in wordpad/notepad for editing. Now scroll down and find the following line: [code]#LoadModule ssl_module modules/mod_ssl.so[/code] And place the following lines after that line: [code]#PHP5 LoadModule php5_module "C:/php/php5apache2.dll" PHPIniDir "C:/WINDOWS"[/code] NOTE: As I didn't kwo the version of PHP or where you have install PHP i presumed you had PHP5 and PHP was installed in C:\php If you have PHP4 the change the LoadModule php5_module... line to the following instead: [code]LoadModule php4_module "C:/php/isapi/php4apache2.dll"[/code] Now scroll a little further and fine the following line: [code]DirectoryIndex index.html index.html.var[/code]Now append index.php after index.html.var seperared by a space. The line should now look like this: [code]DirectoryIndex index.html index.html.var index.php[/code] Now find this line: [code]AddType application/x-gzip .gz .tgz[/code] and place the following lines after it: [code]#PHP AddType application/x-httpd-php .php .phtml AddType application/x-httpd-phps .phps[/code] Save your httpd.conf file. Now to setup PHP a little. You need find a file called php.ini-recommended and rename that file to just php.ini. Now copy the renamed php.ini file to C:\WINDOWS folder. The php.ini-recommended file should be in the root for the PHP installation folder (C:\php) And thats it! If you have setup the LoadModule line correctly then Apache should start with no beeps or errors when you restart it and you should now be able to run you PHP scripts via the web browser by going to [a href=\"http://localhost/filename.php\" target=\"_blank\"]http://localhost/filename.php[/a] To restart Apache you should see a little icon in the bototm right hand corner of the window in the system tray which has small green triangle pinting to the right inside a white circle and purple line coming out from the circle. That is the Apache system tray icon. If you click on that and select Apache 2 from the menu and click on Restart. Apache will attempt to restart itself allowing for the new configuration settings to become available. Note: You have to store your PHP, html and any other files you want be seen by the server in the htdocs folder whcih is in your Apache installation folder (the location of the folder is someting like C:/Program Files/Apache Group/Apache 2/htdocs) There will be files in that folder already. I would either delete these files or move them to a new folder called htdocs_old. That way your htdocs folder is empty and you dont keep getting the Apahce welcome message everytime you go to [a href=\"http://localhost/\" target=\"_blank\"]http://localhost/[/a] instead you'll see a file directory with a list of your files and folders currently in your htdocs folder.
  15. If you want to run your php scripts through a web browser then you are going to need to install a secound piece of software which is called Apache. NOTE: if you are on windows then [a href=\"http://mirrors.dedipower.com/ftp.apache.org/httpd/binaries/win32/apache_2.0.58-win32-x86-no_ssl.msi\" target=\"_blank\"]click here[/a] to download it. Note: when you go to install apache it will ask you for your network/server name settings just put localhost in both boxes and then your or a fake email address in the third box. Now before you can run your php scripts via a web browser you need to tell Apache to parse any .php files with the PHP Intepreter. I will be able to help if you confirm you are on Windows.
  16. About absolute/relitive positioning in most cases yes dont use it. However instead for what you want to do I would suggest you do is the following: wrap your mainnav div insde another div and give your new div an id of leftcol. Now remove the [i]float: left[/i] from your #mainnav style. After that create new style called #leftcol in your style sheet and apply a float: left style to it. Now you'll want to create another div which will hold your validation buttons underneath your #mainnav div inside your new #leftcol div. With the div you have just created give that an id of buttons and apply the following to your style sheet: [code]#buttons {     width: 200px;     margin: 0.5em;     margin-right: 0px;     text-align: center;     padding: 0.5em; } #buttons img {     padding: 20px; /* spred the buttons out evenly */ }[/code] Your buttons should now be underneath your #mainnav div and is centered inside the #leftcol div too. Take a look [a href=\"http://homepage.ntlworld.com/cshepwood/businessman/freelancebusinessman.html\" target=\"_blank\"]here[/a] for what the out come will look like. Absolute/relative positioning should left until last if all other methods fail.
  17. Just before xmas you would of been able to put *SOLVED* infront of your topic title with a click of a button, but unfortunatly that button got removed due to a forum upgrade and since then it hasn't been added back. However currently moderaters and admins add in *SOLVED* infront of the topic title manually. We only solve topics if we see the author has put solved in their post or if the author is saying something along the lines of "thanks that worked!" or just "Thanx"
  18. [!--quoteo(post=374031:date=May 15 2006, 04:37 PM:name=businessman332211)--][div class=\'quotetop\']QUOTE(businessman332211 @ May 15 2006, 04:37 PM) [snapback]374031[/snapback][/div][div class=\'quotemain\'][!--quotec--] I have 2 more questions, I took them out of that post, because they were on a different subject. 1. In My Main navigation over at www.freelancebusinessman.com The padding, margin, doesn't look right in all browsers, is there a way to make it get directly in the middle, but not like it does on text-align:center. It's not working out, the other browsers are adding extra padding even when I specify a smaller amound, and I can't get it to look right.[/quote] Do you mean the headings? If os make sure you are applying both margin and a padding. As header tags h1, h2, h3 .. h6 etc have a defualt margin and padding set. So make sure you set padding to zero pixels and then just set the margin for the tag. [!--quoteo(post=374031:date=May 15 2006, 04:37 PM:name=businessman332211)--][div class=\'quotetop\']QUOTE(businessman332211 @ May 15 2006, 04:37 PM) [snapback]374031[/snapback][/div][div class=\'quotemain\'][!--quotec--] 2. I have stopped using absolute positioning 90% of the time, but I will possibly redoing my entire site to liquid design, or trying to redo what I have for hte homepage, the question I have is, if I use absolute positioning on the following elements a. the picture to show xhtml validation b. The picture to show css validation c. Whatever else I choose to validate (I am planning on putting them all a little under the navigation on each page, but I want them to be even.) Will it have any negative affect on my site once it's liquid to use the absolute positioning for just these elements, if so what other means should I try to learn toward to get them there, without interfering with anything else on the page at all, thanks again for the help. [/quote] No stay away from absolute positoning it is not needed for that. Just put them in a div and set the margin to position it.
  19. Ok I will explain the CSS to you. First the body style: [code]body { background-color:#7A97A5; width: 900px; margin: 0px auto; /* Allows the site to be centered on the screen, rather than being stuck to left of the window */ }[/code] You know about background-colour and width. But you seem to be confused about the margin bit: [i]margin: 0px auto:[/i] What that code does is set the top [b]and bottom[/b] margins to zero pixels. Now the clever bit, auto is basically a predifined keyword within CSS which makes the browser work out an [b]equal margin[/b] to go on the [b]left and the right side[/b] of an element. However the browser will only center your page if you actually specify a width to the element you are using auto margins with. Also [i]margin: 0px auto[/i] is shorthand for [i]margin: 0px auto 0px auto[/i]. margin: 0px auto 0px auto is setting the margin for the top, right, bottom and left sides of an element respectively it save having to type out margin-top, margin-right, magin-bottom, margin-left. Now onto the maincontent and mainnav styles: [code]#mainnav { width: 200px; background-color: #666666; margin: 0.5em; border-color:#333333; border-style: double; float: left; } #maincontent { float: left; width:640px; border-style:double; border-color:#333333; text-indent:1.2em; margin: 0.5em 0 0.5em 0.5em; padding: 0.5em; }[/code] You'll notice I have floated both elements to the left. I did this so both the naviagtion and the content divs sat side by side of each other. Others if you didnt float both elements to the left none of the elements will sit side by side and instead one will be underneath the other. In both styles i applied a margin of 0.5ems to seperate the elements apart and to be seperated form the header image and the footer, aswell as appling 0.5ems of padding inside the elements too. The rest of the CSS is self explanitory. Hope that helps. Also CSS can style any HTML tag apart from the title and head tags as any styles you apply to these are ignored. You can even style the html tag too.
  20. I think your hosting company may have a special setup of PHP which might require a special line called a shebang line, I think thats what it is called, it goes something like this: [code]#!user/cgi-bin/php[/code] That goes right at the top of your PHP file. However I would check with your webhost how to execute and where to store your PHP scripts, also you might want to ask whether they have configured the server to parse .php files with the PHP Interpreter correctly.
  21. The server is most probably cacheing your mysql queries and/or your browser is cacheing your images. So you might want to put [a href=\"http://uk2.php.net/manual/en/function.mysql-free-result.php\" target=\"_blank\"]mysql_free_result[/a] after have got the data from the database and put the following at the top of the PHP scripts that generates your images: [code]header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache");[/code] That code should stop the browser from cacheing your images.
  22. Is there a question here, and could you provide more information on what you are trying to do as currently your question is alittle vague.
  23. [!--quoteo(post=373776:date=May 14 2006, 05:56 PM:name=crouchjay)--][div class=\'quotetop\']QUOTE(crouchjay @ May 14 2006, 05:56 PM) [snapback]373776[/snapback][/div][div class=\'quotemain\'][!--quotec--] [code]mysql_connect("localhost","root") or die(mysql_error()); [/code] I am not totally sure, but I do believe you need a password in there. Jay [/quote] He most probably took the password out for security reasons or hes developing the script locally on his local PC and his seup of mysql has no password set. So that isn't the problem but mainly to do with his SQL queries.
  24. Thanks toplay. I noticed that my expression wasn't working when I added in 0-9 and somei nvalud characters so I made a quick dash over to php.net and did a quick readup on a few pattern modifiers I have fixed my expression now. [img src=\"style_emoticons/[#EMO_DIR#]/huh.gif\" style=\"vertical-align:middle\" emoid=\":huh:\" border=\"0\" alt=\"huh.gif\" /]
  25. Umm, I must have misread the thread. Any whay I've added in 0-9 in to the regular expression now [img src=\"style_emoticons/[#EMO_DIR#]/wink.gif\" style=\"vertical-align:middle\" emoid=\":wink:\" border=\"0\" alt=\"wink.gif\" /]
×
×
  • 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.