Jump to content

morrisjohnny

Members
  • Posts

    300
  • Joined

  • Last visited

Posts posted by morrisjohnny

  1. I'm having problems migrating one client from web server to another. I have attached the current .htaccess in use at the bottom. On the current site visitinghttp://domain.com/index.php/about-ushttp://domain.com/index.php/news-eventshttp://domain.com/index.php/newsall return correct pageson the new website these pages load fine However going to this pagehttp://domain.com/index.php/news/23/87/Gardens-Opening-for-Leuchie-House-2012returns a Not Found The requested URK was not found on this server. (a side note which may help is)The hyperlinks on the live site shows links as index.php/about-us for example yet on the new site they are shown as index.php?page=about-us What could be causing this? the database/files and .htaccess files have all been brought across. .htaccess file

      <IfModule mod_rewrite.c>RewriteEngine onRewriteBase /leuchieRewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule ^(.+)$ index.php?page=$1 [QSA]</IfModule> <IfModule mod_header.c>Header unset ETagFileEtag None</IfModule> <IfModule mod_deflate.c>AddOutputFilterByType DEFLATE text/css text/plain text/xml image/gif image/jpeg image/png</IfModule> <IfModule mod_expires.c><FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">ExpiresActive OnExpiresDefault "access plus 1 year"<IfModule mod_header.c>  Header set Cache-Control "public"</IfModule></FilesMatch></IfModule> 

  2. in order to migrate from MS SQL to MySQL you can just export from MS SQL and import into MySQL both support export and important and because they are both based on SQL they should function okay in terms of accessing the database depending on the functions you've used you may have more problems for exmaple MySQL can use Limit where's MS SQL does not as one example. You should not need to publish a MS SQL using an IP address. we have a ms sql server and a web host that is located in a DMZ the web host and still talk to our MS SQL database without any problems and that does not have a public IP. Either way the damage to either a MS SQL and a MySQL data will also ways be the same, someone gets access and gets access and either manipulates the data, sells it or deletes it whether is is MySQL or MS SQL !

  3. correct me if i'm wrong but i think he means the CMS {Content management system}if not could you please expand or explain in a bit more detail?the system of on-line examples are all in different directorylook this is where the xhtml tutorial is located in a 'folder' (directory) called xhtml

    http://w3schools.com/[b]xhtml/default.asp[/b]

    while the php tutorial is located in another 'folder' (directory) calledphp

    http://w3schools.com/[b]php/default.asp[/b]

    I hope this explains a bit about the how they(W3Schools) organized the system of on-line examplesIf I'm wrong with anything someone please correct me I'm not as well educated as most people are around here.if you wasn't looking for this information again could you explain in a bit more detail what your looking for?

  4. output

    <html><header><link href='../style.css' rel='stylesheet' type='text/css'></header><body><table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"><tr><td><table width="100%" border="0" cellpadding="3" cellspacing="1" bordercolor="1" bgcolor="#FFFFFF"><tr><td class="fheader"><strong>Title:Welcome</strong></td></tr><tr><td class="fsub"><b>By</b> jnymris <b>On:</b> 06/04/07 01:27:04</td></tr><tr><td class="fmain">Welcome To The Forums<br /><br />Please use your comman sense</td></tr></table></td></tr></table><br><table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"><tr><td><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF"><tr><td class="fsub"><b>By:</b> jnymris <b>On</b> 06/04/07 07:39:42</td></tr><tr><td class="fmain">Testing Replies</td></tr></table></td></tr></table><br><table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"><tr><td><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF"><tr><td class="fsub"><b>By:</b> admin <b>On</b> 06/04/07 12:47:52</td></tr><tr><td class="fmain">[b]larger Bold B's [/b][b]smaller bold B's[/b]</td></tr></table></td></tr></table><br><BR><table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"><tr><form name="form1" method="post" action="forum_add_answer.php"><td><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF"><tr><td valign="top"><strong></strong></td></tr><tr><td colspan='2'><textarea name="a_answer" cols="45" rows="3" id="a_answer"></textarea></td></tr><tr><td><input name="id" type="hidden" value="3"></td><td align='center'><input type="submit" name="Submit" value="Submit"> <input type="reset" name="Submit2" value="Reset"></td></tr></table></td></form></tr></table>  </body></html>

    __________________________The Scriptslog_in.php

    <html>  <header>   <link href="style.css" rel="stylesheet" type="text/css">   <title>Log In - Management Tycoon</title><script language='javascript' type='text/javascript'> if (top.location != self.location) {top.location.replace(self.location)};</script>  </header>  <body><table align='center' border='1'><tr><td class='indextitle' colspan='2'><img src='banner.bmp'></tr></td><tr><td class='indextitle' colspan='2'>Welcome To Management Tycoon</td></tr><tr><td width='50%'>	<table with='100%' valign='top'>		<tr><td>Management Tycoon is a new online text based game, where you become the manager of your own business in hope to make millions. You being the manager will have to deal with the creation of your product, the staff, sponsors backing your product in order ho help you make millions.<br>But is it as simple as that?</td></tr>	</table>	</td><td>	<table width='50%' border='0'>		<tr><td>Existing Members can log in below</td></tr>		<tr><td><?php echo "<font color='red'>" .$msg . "</font>"; ?><form action="" method="post"></td></tr>    			<tr><td>Username:<input type="text" name="username" /></td></tr>    			<tr><td>Password:<input type="password" name="password" /></td></tr>			<tr><td><input type="submit" name="submit" value="Log In" /></td></tr>			<tr></td></form></td></tr>	</table></td></tr><tr><td align='center' colspan='2'>- <a href='screenshots.html'>Screenshots</a> - <a href='register.php'>Register</a> -</td></tr></table>

    forum_view_topic.php

    <?phpinclude ("logincheck.php");?><?php if ($logged_in) { ?><?php$host="localhost"; // Host name$username="root"; // Mysql username$password=""; // Mysql password$db_name="mt"; // Database name$tbl_name="forum"; // Table name// Connect to server and select databse.mysql_connect("$host", "$username", "$password")or die("cannot connect");mysql_select_db("$db_name")or die("cannot select DB");// get value of id that sent from address bar$id=$_GET['id'];$sql="SELECT * FROM $tbl_name WHERE id='$id'";$result=mysql_query($sql);$rows=mysql_fetch_array($result);?><html><header><link href='style.css' rel='stylesheet' type='text/css'></header><body><table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"><tr><td><table width="100%" border="0" cellpadding="3" cellspacing="1" bordercolor="1" bgcolor="#FFFFFF"><tr><td class="fheader"><strong>Title:<? echo $rows['topic']; ?></strong></td></tr><tr><td class="fsub"><b>By</b> <? echo $rows['name']; ?> <b>On:</b> <? echo $rows['datetime']; ?></td></tr><tr><td class="fmain"><? echo $rows['detail']; ?></td></tr></table></td></tr></table><br><?php$tbl_name2="forum_answer"; // Switch to table "forum_answer"$sql2="SELECT * FROM $tbl_name2 WHERE question_id='$id'";$result2=mysql_query($sql2);while($rows=mysql_fetch_array($result2)){?><table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"><tr><td><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF"><tr><td class="fsub"><b>By:</b> <? echo $rows['a_name']; ?> <b>On</b> <? echo $rows['a_datetime']; ?></td></tr><tr><td class="fmain"><? echo $rows['a_answer']; ?></td></tr></table></td></tr></table><br><?}$sql3="SELECT view FROM $tbl_name WHERE id='$id'";$result3=mysql_query($sql3);$rows=mysql_fetch_array($result3);$view=$rows['view'];// if have no counter value set counter = 1if(empty($view)){$view=1;$sql4="INSERT INTO $tbl_name(view) VALUES('$view') WHERE id='$id'";$result4=mysql_query($sql4);}// count more value$addview=$view+1;$sql5="update $tbl_name set view='$addview' WHERE id='$id'";$result5=mysql_query($sql5);mysql_close();?><BR><table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"><tr><form name="form1" method="post" action="forum_add_answer.php"><td><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF"><tr><td valign="top"><strong></strong></td></tr><tr><td colspan='2'><textarea name="a_answer" cols="45" rows="3" id="a_answer"></textarea></td></tr><tr><td><input name="id" type="hidden" value="<? echo $id; ?>"></td><td align='center'><input type="submit" name="Submit" value="Submit"> <input type="reset" name="Submit2" value="Reset"></td></tr></table></td></form></tr></table><?php } else { ?><?php include("log_in.php") ?><?php } ?>  </body></html>

    logincheck.php

    <?phpsession_start();$logged_in = false;$msg = "";if ($_SESSION['online'])  $logged_in = true;else if (isset($_POST['username'])){  $db=mysql_connect("localhost", "root", "");  mysql_select_db("mt", $db);  $username = htmlentities($_POST['username']);  $password = htmlentities($_POST['password']);  $username = mysql_real_escape_string($username);  $password = mysql_real_escape_string($password);  $query = mysql_query("SELECT login, pazzword FROM Users WHERE login = '$username' AND pazzword = '$password'");  if(mysql_num_rows($query) == 1)  {    $_SESSION['online'] = true;    $_SESSION['username'] = $username;    $logged_in = true;  }  else    $msg .= "The username and password did not match.<br /><br />";  mysql_free_result($query);  mysql_close($db);}/*at this point you can do a header redirect if necessary because you have not sent any outputheader("Location: login.php");exit();*/?>

    NEWoutput

    <html><header><link href='../style.css' rel='stylesheet' type='text/css'></header><body><table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"><tr><td><table width="100%" border="0" cellpadding="3" cellspacing="1" bordercolor="1" bgcolor="#FFFFFF"><tr><td class="fheader"><strong>Title:Welcome</strong></td></tr><tr><td class="fsub"><b>By</b> jnymris <b>On:</b> 06/04/07 01:27:04</td></tr><tr><td class="fmain">Welcome To The Forums<br /><br />Please use your comman sense</td></tr></table></td></tr></table><br><table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"><tr><td><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF"><tr><td class="fsub"><b>By:</b> jnymris <b>On</b> 06/04/07 07:39:42</td></tr><tr><td class="fmain"></td></tr></table></td></tr></table><br><table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"><tr><td><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF"><tr><td class="fsub"><b>By:</b> admin <b>On</b> 06/04/07 12:47:52</td></tr><tr><td class="fmain"></td></tr></table></td></tr></table><br><BR><table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"><tr><form name="form1" method="post" action="forum_add_answer.php"><td><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF"><tr><td valign="top"><strong></strong></td></tr><tr><td colspan='2'><textarea name="a_answer" cols="45" rows="3" id="a_answer"></textarea></td></tr><tr><td><input name="id" type="hidden" value="3"></td><td align='center'><input type="submit" name="Submit" value="Submit"> <input type="reset" name="Submit2" value="Reset"></td></tr></table></td></form></tr></table>  </body></html>

    forum_view_topic.php

    <?phpinclude ("../logincheck.php");?><?php if ($logged_in) { ?><?php$host="localhost"; // Host name$username="root"; // Mysql username$password=""; // Mysql password$db_name="mt"; // Database name$tbl_name="forum"; // Table name// Connect to server and select databse.mysql_connect("$host", "$username", "$password")or die("cannot connect");mysql_select_db("$db_name")or die("cannot select DB");// get value of id that sent from address bar$id=$_GET['id'];$sql="SELECT * FROM $tbl_name WHERE id='$id'";$result=mysql_query($sql);$rows=mysql_fetch_array($result);?><html><header><link href='../style.css' rel='stylesheet' type='text/css'></header><body><table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"><tr><td><table width="100%" border="0" cellpadding="3" cellspacing="1" bordercolor="1" bgcolor="#FFFFFF"><tr><td class="fheader"><strong>Title:<? echo $rows['topic']; ?></strong></td></tr><tr><td class="fsub"><b>By</b> <? echo $rows['name']; ?> <b>On:</b> <? echo $rows['datetime']; ?></td></tr><tr><td class="fmain"><? echo $rows['detail']; ?></td></tr></table></td></tr></table><br><?php$tbl_name2="forum_answer"; // Switch to table "forum_answer"$sql2="SELECT * FROM $tbl_name2 WHERE question_id='$id'";$result2=mysql_query($sql2);/*** AddPattern* @param list        The array/list to add the pattern to* @param pattern    The (perl) regular expression pattern to add* @param string    The string that the pattern should be replaced with* @param escape    Should we "escape" the pattern (escapes /, [ and ] ) and adds*                            "delitimers" ( /pattern/ ) and any defined "rule"* @param modifs    Any modifiers that should be added to the pattern (ignored if escape is false)*                         could be i (case-insensitive) etc. (see manual)* @author Christopher Hindefjord - Mr_CHISOL - Kachtus.net  2007**/function AddPattern( &$list, $pattern, $string, $escape = false, $modifs = '' ) {    // Just in case...    if (!isset($list[0])) {        $list[0] = array();        $list[1] = array();    }    // If we should "escape" the string and treat it... (default: No)    if ($escape) {        // Escape...        $pattern = str_replace( '/', '\/', $pattern );        $pattern = str_replace( '[', '\[', $pattern );        $pattern = str_replace( ']', '\]', $pattern );        // add /        $pattern = '/'.$pattern.'/'.$modifs;    }    $list[0][] = $pattern;    $list[1][] = $string;}$patterns = array( array(), array() );AddPattern( $patterns, '[b](.*)[/b]', '<span class="bold">$1</span>', true, 'i' ); // ignore case and escape itAddPattern( $patterns, '[i](.*)[/i]', '<span class="italic">$1</span>', true, 'i' ); // ignore case and escape itAddPattern( $patterns, '[url="http://(.*)"](.*)[/url]', '<a href="$1">$1</span>', true, 'i' ); // ignore case and escape it// You can add the rest yourself...// Adding the newline replace here, then you don't need multiple call to a replace function...AddPattern( $patterns, "/\n/", "<br />\n" );$_message = preg_replace( $patterns[0], $patterns[1], $rows['a_answer']);while($rows=mysql_fetch_array($result2)){?><table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"><tr><td><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF"><tr><td class="fsub"><b>By:</b> <? echo $rows['a_name']; ?> <b>On</b> <? echo $rows['a_datetime']; ?></td></tr><tr><td class="fmain"><? echo $_message; ?></td></tr></table></td></tr></table><br><?}$sql3="SELECT view FROM $tbl_name WHERE id='$id'";$result3=mysql_query($sql3);$rows=mysql_fetch_array($result3);$view=$rows['view'];// if have no counter value set counter = 1if(empty($view)){$view=1;$sql4="INSERT INTO $tbl_name(view) VALUES('$view') WHERE id='$id'";$result4=mysql_query($sql4);}// count more value$addview=$view+1;$sql5="update $tbl_name set view='$addview' WHERE id='$id'";$result5=mysql_query($sql5);mysql_close();?><BR><table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"><tr><form name="form1" method="post" action="forum_add_answer.php"><td><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF"><tr><td valign="top"><strong></strong></td></tr><tr><td colspan='2'><textarea name="a_answer" cols="45" rows="3" id="a_answer"></textarea></td></tr><tr><td><input name="id" type="hidden" value="<? echo $id; ?>"></td><td align='center'><input type="submit" name="Submit" value="Submit"> <input type="reset" name="Submit2" value="Reset"></td></tr></table></td></form></tr></table><?php } else { ?><?php include("../log_in.php") ?><?php } ?>  </body></html>

  5. okay, I', understand it. I'll try and convert it all to when it's being displayed :)Thanks :)*EDITI didn't add the middle part i have added it now if i put something in text it just sends nothing?like i said i'm going to convert everyting so it changes on display rather than post.*UN-EDITYou have been a big help :)*EDITNow when i show the text it just display it like it is in the databasewith [ b]bold[ /b] without the spaceshere is my code

    <?phpinclude ("../logincheck.php");?><?php if ($logged_in) { ?><?php$host="localhost"; // Host name$username="root"; // Mysql username$password=""; // Mysql password$db_name="mt"; // Database name$tbl_name="forum"; // Table name// Connect to server and select databse.mysql_connect("$host", "$username", "$password")or die("cannot connect");mysql_select_db("$db_name")or die("cannot select DB");// get value of id that sent from address bar$id=$_GET['id'];$sql="SELECT * FROM $tbl_name WHERE id='$id'";$result=mysql_query($sql);$rows=mysql_fetch_array($result);?><html><header><link href='../style.css' rel='stylesheet' type='text/css'></header><body><table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"><tr><td><table width="100%" border="0" cellpadding="3" cellspacing="1" bordercolor="1" bgcolor="#FFFFFF"><tr><td class="fheader"><strong>Title:<? echo $rows['topic']; ?></strong></td></tr><tr><td class="fsub"><b>By</b> <? echo $rows['name']; ?> <b>On:</b> <? echo $rows['datetime']; ?></td></tr><tr><td class="fmain"><? echo $rows['detail']; ?></td></tr></table></td></tr></table><br><?php$tbl_name2="forum_answer"; // Switch to table "forum_answer"$sql2="SELECT * FROM $tbl_name2 WHERE question_id='$id'";$result2=mysql_query($sql2);while($rows=mysql_fetch_array($result2)){<?php/*** AddPattern* @param list        The array/list to add the pattern to* @param pattern    The (perl) regular expression pattern to add* @param string    The string that the pattern should be replaced with* @param escape    Should we "escape" the pattern (escapes /, [ and ] ) and adds*                            "delitimers" ( /pattern/ ) and any defined "rule"* @param modifs    Any modifiers that should be added to the pattern (ignored if escape is false)*                         could be i (case-insensitive) etc. (see manual)* @author Christopher Hindefjord - Mr_CHISOL - Kachtus.net  2007**/function AddPattern( &$list, $pattern, $string, $escape = false, $modifs = '' ) {    // Just in case...    if (!isset($list[0])) {        $list[0] = array();        $list[1] = array();    }    // If we should "escape" the string and treat it... (default: No)    if ($escape) {        // Escape...        $pattern = str_replace( '/', '\/', $pattern );        $pattern = str_replace( '[', '\[', $pattern );        $pattern = str_replace( ']', '\]', $pattern );        // add /        $pattern = '/'.$pattern.'/'.$modifs;    }    $list[0][] = $pattern;    $list[1][] = $string;}$patterns = array( array(), array() );AddPattern( $patterns, '[b](.*)[/b]', '<span class="bold">$1</span>', true, 'i' ); // ignore case and escape itAddPattern( $patterns, '[i](.*)[/i]', '<span class="italic">$1</span>', true, 'i' ); // ignore case and escape itAddPattern( $patterns, '[url="http://(.*)"](.*)[/url]', '<a href="$1">$1</span>', true, 'i' ); // ignore case and escape it// You can add the rest yourself...// Adding the newline replace here, then you don't need multiple call to a replace function...AddPattern( $patterns, "/\n/", "<br />\n" );$_message = preg_replace( $patterns[0], $patterns[1], $rows['a_answer']);?>?><table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"><tr><td><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF"><tr><td class="fsub"><b>By:</b> <? echo $rows['a_name']; ?> <b>On</b> <? echo $rows['a_datetime']; ?></td></tr><tr><td class="fmain"><? echo $_message; ?></td></tr></table></td></tr></table><br><?}$sql3="SELECT view FROM $tbl_name WHERE id='$id'";$result3=mysql_query($sql3);$rows=mysql_fetch_array($result3);$view=$rows['view'];// if have no counter value set counter = 1if(empty($view)){$view=1;$sql4="INSERT INTO $tbl_name(view) VALUES('$view') WHERE id='$id'";$result4=mysql_query($sql4);}// count more value$addview=$view+1;$sql5="update $tbl_name set view='$addview' WHERE id='$id'";$result5=mysql_query($sql5);mysql_close();?><BR><table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"><tr><form name="form1" method="post" action="forum_add_answer.php"><td><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF"><tr><td valign="top"><strong></strong></td></tr><tr><td colspan='2'><textarea name="a_answer" cols="45" rows="3" id="a_answer"></textarea></td></tr><tr><td><input name="id" type="hidden" value="<? echo $id; ?>"></td><td align='center'><input type="submit" name="Submit" value="Submit"> <input type="reset" name="Submit2" value="Reset"></td></tr></table></td></form></tr></table><?php } else { ?><?php include("../log_in.php") ?><?php } ?>  </body></html>

  6. Here's how you could use it (see http://www.php.net/manual/en/ref.pcre.php for more info about reg.exp and modifiers):

    $patterns = array( array(), array() );AddPattern( $patterns, '[b](.*)[/b]', '<span class="bold">$1</span>', true, 'i' ); // ignore case and escape itAddPattern( $patterns, '[i](.*)[/i]', '<span class="italic">$1</span>', true, 'i' ); // ignore case and escape itAddPattern( $patterns, '[url](.*)[/url]', '<a href="$1">$1</span>', true, 'i' ); // ignore case and escape it// You can add the rest yourself...// Adding the newline replace here, then you don't need multiple call to a replace function...AddPattern( $patterns, "/\n/", "<br />\n" );$_message = preg_replace( $patterns[0], $patterns[1], $_POST['a_answer']);

    Please NOTE: the function is currently untested, but it should work just fine...After putting this into my script it says "call to undefined function AddPattern"I have no idea on functions but i'm gussing it's not be 'set-up'correctly? i'm gussing?

  7. I'm using this while i post it into the database. should i make it so it changes it when it's being loaded instead?what do you mean by flexible codes?so thoses tags are right then? for <b> ect yeah?cheers i'll add it in nowis their anyway you can reset the auto_increment back to 1 or anything? i'm doing so much testing it's on about 90 and i want it to be 'fresh' or would that jsut imple being running the sql_query again?

  8. would i jut place that where i placed the line break code?so it does for <b> for <i> for <u>hyperlink for <a href='link>Hyperlink</a>ect right? would that work fine or would i need to install bb code or something?that would still turn out like <html> tags when displayed right?

  9. For the Page to download XAMPP for windows: Click hereForm that page i have given you should be able to download the program if you can't i'll send you the one i used.When installing unplugged your internet connection. and any network connection and open certain ports ( not sure which onces but it will tell you)From their you should remeber where u installed XAMPP from here you can then begin to make php scripts Putting them in the folder C:/Program Files/XAMPP/htdocs/ or in folders in more folders. from their you must start your internet broswer and type127.0.0.1/(where your files is located after htdocs)then you should be able to run php filesif you file is located in this locationC:/Program Files/XAMPP/htdocs/folder1and your files is called index.phptype into firefox/Internet explorer127.0.0.1/folder1/index.phpor localhost/folder1/index.phpif you need anymore help just respond i will check back.-JohnnyWelcome Aboard :)

  10. thanks working perfectly so how would i find out the other functions like would it just$_message = str_replace('', '<b>', $_POST['a_answer']);is it possible to insert code into the input box form clicking a button?for the likes of inserting after clicking the bold links

  11. Thanks I'm just having a look now.I'll report back with my finding seems to be perfect.*EDITFCKeditor is something which is a bit too complex since it lets users input checkboxs. I'm hoping to find something i little more simple although i would rather do it all manually to learn. Also i don't know how to 'install' then and extract the data the user is inputting to insert into the data base. I will find one suitable and play around.I will look for a much simpler one**RE-EDITI have found out how to use string replace which is what i want for the replacement does anybody now know what the char is for linebreak for i can replace it with <br>$_message=str_replace("(line-break-char","<br>".$_POST['a_answer'])

  12. It says the headers already sent out. probably by logincheck.phpmaybe if the user isn't logged in i should direct them to the login.php page?

  13. Cheers that worked like a charm the location: was giving an error but i replaced it with the html refresh one :) Thanks :)Anyone know anything in regards to the activeness?so it would change $logged_in=falseor just repeat the logout action? after a time limit on a page refresh or something?

  14. Hello. i got this code from Herei have modified it a bit to suit my needslogincheck.php

    <?phpsession_start();$logged_in = false;$msg = "";if ($_SESSION['online'])  $logged_in = true;else if (isset($_POST['username'])){  $db=mysql_connect("localhost", "root", "");  mysql_select_db("mt", $db);  $username = htmlentities($_POST['username']);  $password = htmlentities($_POST['password']);  $username = mysql_real_escape_string($username);  $password = mysql_real_escape_string($password);  $query = mysql_query("SELECT login, pazzword FROM Users WHERE login = '$username' AND pazzword = '$password'");  if(mysql_num_rows($query) == 1)  {    $_SESSION['online'] = true;    $_SESSION['username'] = $username;    $logged_in = true;  }  else    $msg .= "The username and password did not match.<br /><br />";  mysql_free_result($query);  mysql_close($db);}/*at this point you can do a header redirect if necessary because you have not sent any outputheader("Location: login.php");exit();*/?>

    Log_in.php

    <html>  <header>   <link href="style.css" rel="stylesheet" type="text/css">   <title>Log In - Management Tycoon</title>   <script language='javascript' type='text/javascript'>    if (top.location != self.location) {top.location.replace(self.location)};   </script>  </header>  <body><table align='center' border='1'><tr><td class='indextitle' colspan='2'><img src='banner.bmp'></tr></td><tr><td class='indextitle' colspan='2'>Welcome To Management Tycoon</td></tr><tr><td width='50%'>	<table with='100%' valign='top'>		<tr><td>Management Tycoon is a new online text based game, where you become the manager of your own business in hope to make millions. You being the manager will have to deal with the creation of your product, the staff, sponsors backing your product in order ho help you make millions.<br>But is it as simple as that?</td></tr>	</table>	</td><td>	<table width='50%' border='0'>		<tr><td>Existing Members can log in below</td></tr>		<tr><td><?php echo "<font color='red'>" .$msg . "</font>"; ?><form action="" method="post"></td></tr>    			<tr><td>Username:<input type="text" name="username" /></td></tr>    			<tr><td>Password:<input type="password" name="password" /></td></tr>			<tr><td><input type="submit" name="submit" value="Log In" /></td></tr>			<tr></td></form></td></tr>	</table></td></tr><tr><td align='center' colspan='2'>- <a href='screenshots.html'>Screenshots</a> - <a href='register.php'>Register</a> -</td></tr></table>

    Logout.php

    <?phpinclude ("logincheck.php");?>    <?php echo $msg; ?><?php if ($logged_in) { ?>	<html><body>WHERE TO SIGN THE USER OUT</body></html><?php } else { ?><?php include("log_in.php") ?><?php } ?>  </body></html>

    anyway I'm having problems Logging the user out i have tried<?phpsession_destroy();?>but it won't work. unless i am putting it in the incorrect place.also is it possible to change the code to that they user is logged out after a certain amount of time? if so how would this be done?Thanks-Johnny(Sorry to keep asking questions but I'm trying to get as much done while I'm in the mood for it)

  15. Hello.*EDITI have found wha ti'm looking for i just need to find the char for linebreak i've left my problem in for anyone who was having the same.*UN-EDITI've just created a forum for my websiteI'm having problems with a <text area>when you user types in

    MoreText

    The display is just

    More Text

    I want it to stay

    MoreText

    I'm just wondering how would i detec where their is a line break and type in <br> after it has been sumitted?While the topics open what would happen if they put in :) how would i turn this into an image?Thanks-Johnny

  16. I'm having problems understanding you, apparently butt is for password? What's the question?
    basicly i 'm not sure how to compare to variables like the username and password the user put in the input boxes and the onces already in the database.I have no idea how to do this :) I would be even more greatful if you would help/tell me understand this.
×
×
  • Create New...