Jump to content

wildteen88

Staff Alumni
  • Posts

    10,480
  • Joined

  • Last visited

    Never

Everything posted by wildteen88

  1. You should use the nl2br function rather than doing it manually. Use the nl2br function when you get the data out of the database. for exmaple nl2br($row["definition"])
  2. You need to setup PHP to a an SMTP server. Youm might be able to use your ISPs maiul server if they have an smtp server, so thing like smtp.ispname.com The defualt SMTP port is fine, as most SMTP servers run on port 25. NOTE: If your isp requires you to be logged into to send an email to the smtp server, you wont be able to use the mail function. As the mail function doesnt support any authentication protocols.
  3. Use the following as the reqaluar expression: [code]|\[quote=(.*)\](.*)\[/quote\]\]|is[/code]
  4. Change your code to: [code=php:0]// check that the form has been submitted first, before using the POST vars if(isset($_POST['theText'])) {     $filename = $_POST["bbultimate.css"];     $theText = $_POST["theText"];     $theText = stripslashes($theText);     $data = fopen($filename, "a");     fwrite($data,$theText);     fclose($data);     echo "The CSS has been edited"; }[/code]
  5. From what I see, you have an extra comma at the end of the query which seems to be the problem, try this: $sql="INSERT INTO Market (Player, Price, Type, Position, Age, Ka, Ta, Pa, Sa) VALUES ('$_POST[Player]', '$_POST[Price]', '$_POST[Type]' '$_POST[Position]', '$_POST[Age]', '$_POST[GK]', '$_POST[DEF]', '$_POS[MID]', '$_POST[ATT]')";
  6. You'll wnat echo $_GET[$from] otherwise nothing will be put in the value attribute of the input field so use: [code]<input type="text" value="<?php echo $_GET[$from]; ?>"[/code]
  7. [quote author=Crayon Violent link=topic=105899.msg423189#msg423189 date=1156746966] the PHP help thread is not for tutorials on how to do something in general.  it is for helping fix code you are already working on.  please go to the tutorial section or else google. [/quote] As well as asking questions about the PHP langauge. Which is what rajmohan is asking. rajmohan Barand has posted an excellent short intro to OOP [url=http://www.phpfreaks.com/forums/index.php/topic,104878.msg418672.html#msg418672]here[/url]. Have a read of that should get you started. Also it would be a good idea to look in the manual for more info on oop over at php.net/oop
  8. Have a look at [url=http://www.phpfreaks.com/forums/index.php/topic,103086.0.html]this[/url] thread. Your question is very similar to that thread.
  9. The defualt port for a SMTP server is port 25, which is the defualt value for the smtp_port directive in the php.ini If your ISP uses a port other than port 25, then it appears the smtp server requires authentication in order to use that server. If thats the case then you cannot use that smtp server as the mail function doesnt support any authentication protocols when sending emails.
  10. You put it in the htaccess file that is in the root of your websites folder you upload your files to.
  11. HEREDOC is very html for large text/html code blocks. Saves you having to escape quotes etc. But alot of people dont know this syntax exists.
  12. Your query is good. The problem is you are using a non-existant MySQL-link resource. $db is the link resource. However in the mysql_query function you usr $con which isnt the link resource so change: [code]if (!mysql_query($sql,$con))[/code] to: [code]if (!mysql_query($sql,$db))[/code]
  13. If the user has specified a defualt font for their browser to use it'll use that font, however by defualt a user will have a defualt font selected, usually sans-sarif.
  14. You are using single quotes in your echo statement. PHP will treat your variables as-is and will not parse the the variables. Use double quotes or use the concatenation operator: Double quotes: [code=php:0]echo "<a href=\"somefile.php?value1={$X}&value2={$Y}&value3={$Z}\">Print View</a>"; [/code] Concatenation operator: [code=php:0]echo '<a href="somefile.php?value1=' . $X . '&value2=' . $Y . '&value3=' . $Z . '">Print View</a>'; [/code]
  15. Site looks okay. However the stripy background is too noticeable, Chnage the colour of the stipes to a lighter color. Having a bitmap for your header graphic is a no no. Save the image as a gif/jpeg. It'll reduce the file size of that image massively, Having it as a gif it'll be 4.6KB compared to 280KB, thats alot of bandwidth saved! Other than that its ok.
  16. The same way you are setting up your other variables. [code=php:0]<?php if ($layout == "3center") {     $pageClass = "threecolumncenter"; } ?>[/code]
  17. Use $_SERVER['QUERY_STRING'] to get the bit after the ? in the url. PHP_SELF only gets the relative path to the file, it doesnt include the query string. So use this: [code=php:0]$url = $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING'];[/url]
  18. Use HEREDOC syntax: [code=php:0]$data = <<<PHP <?php \$i = 'hello'; print \$i; ?> PHP; $i = fopen(file); fwrite($i, $data);[/code]
  19. Change this: [code]$sql = "SELECT count(*) FROM banned_ips"; $res = mysql_query($sql); $row = mysql_fetch_row($res); echo ("<div style=\"text-align: left;\"><b><h2>Total Bans: $row</h2></b></div>[/code] to: [code]$numBans = mysql_num_rows($result); echo ("<div style=\"text-align: left;\"><b><h2>Total Bans: $numBans</h2></b></div>[/code]
  20. $_SESSION is already an array! So theres no point in redeclaring it as an array. What ever you do with sessions they will always expire when the user closes their browser, or if the user logs out.
  21. Thread closed. You already have a thread open about this in the [url=http://www.phpfreaks.com/forums/index.php/topic,105810.0.html]MySQL Help[/url] forum. Do not post multiple copies of the same problem in different forums.
  22. You'll want to have three links which will change the order by id, offender or tstamp. Here is the PHP code you'll want to use: [code=php:0]//we now get get the sort parameter from the url switch(@$_GET['sort'])) {     // This checks whether sort is either one of the following     // id, offender or tstamp     // if it is it'll set sort_order to sort URL parameter     case 'id':     case 'offender':     case 'tstamp':         $sort_order = $_GET['sort'];     break;     // if sort was not one of the above we use a defualt value, id     default:         $sort_order = "id";     break; }[/code] This replaces [code=php:0]$sort_order = "$date";[/code] Now the three links: [code]<a href="?sort=id">Sort by ID</a><br /> <a href="?sort=offender">Sort by offender</a><br /> <a href="?sort=tstamp">Sort by Timestamp</a>[/code] These links sets the sort URL parameter
  23. Its a another form of unit size. I think 1em is equal to about 14px or 16px. It is recommended to use em rather pt for sizing text. This [url=http://www.clagnut.com/blog/348/]article[/url] explains why.
  24. Not sure but each browser has its own defualt margin/padding on block level elements. But I thinks it like 1em or something.
  25. I need to need to see the HTML in order to make any sense of the CSS. Attach the HTML file here. What CSS selectors in your style sheet styles your menu?
×
×
  • 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.