Jump to content

rhysmeister

Members
  • Posts

    51
  • Joined

  • Last visited

Contact Methods

  • Website URL
    http://www.tweet-sql.com

Profile Information

  • Gender
    Not Telling
  • Location
    England

rhysmeister's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks, that nearly got it. Changed to '/<title>(.+?)<\/title>/si' to make the search case insensitive. I've always shied away from regular expressions so never think to use them. Guess I shouldn't!
  2. Added in $contents = preg_replace("/\n|\r\n|\r$/", "", $contents); and it seems to get around the issue of title tags being on different lines. Thanks for your help. Rhys
  3. Very good point. I went for DOM because it would't matter if the title tags were on different lines. I might try to stip out any newline characters. Thanks, I will give your approach a go this evening.
  4. I just want to get the title of a web page from any given url. I run a url shortenign service and I post a small number of links to twitter. It'll just be a nice touch to add the title of the html page.
  5. This solution advises it (see bottom) http://forums.digitalpoint.com/showthread.php?t=833
  6. Hi is it possible to dynamically unload or disable a certain extension from a php script? I want to disable DOMXML for a certain script.
  7. Nah, that's not it either. I'm going to have a look tomorrow with a fresh head. Thanks for you efforts.
  8. Ok done that, this is returned... Array ( ) Emtpy array? I presume there's got to be something up with my form?
  9. I'm using php 4.4.4 on OS X. I have used $_POST on other pages with no issues at all. Obviously doing something silly! Thanks for the pointer, was using the assinment instead of a comparison operator.
  10. Can anyone see what I'm doing wrong with the code? No matter what I do I can't seem to get my txtUsername and txtPassword variables posted by the page. I've returned to using php after a few years and this has me stumped at the moment. <?php require_once('Connections/localhost.php'); $FF_valUsername = $_POST['txtUsername']; // *** Start the session session_start(); // *** Validate request to log in to this site. $FF_LoginAction = $PHP_SELF; if (isset($FF_valUsername)) { $FF_valUsername=$_POST["txtUsername"]; $FF_fldUserAuthorization="mem_role"; $FF_redirectLoginSuccess="index.php"; $FF_redirectLoginFailed="index.php"; $FF_rsUser_Source="SELECT mem_email, mem_password "; if ($FF_fldUserAuthorization != "") $FF_rsUser_Source .= "," . $FF_fldUserAuthorization; $FF_rsUser_Source .= " FROM member WHERE mem_email='" . $FF_valUsername . "' AND mem_password='" . $_POST["txtPassword"] . "'"; mysql_select_db($database_localhost, $localhost); $FF_rsUser=mysql_query($FF_rsUser_Source, $localhost) or die(mysql_error()); $row_FF_rsUser = mysql_fetch_assoc($FF_rsUser); if(mysql_num_rows($FF_rsUser) > 0) { // username and password match - this is a valid user $MM_Username=$FF_valUsername; session_register("MM_Username"); if ($FF_fldUserAuthorization != "") { $MM_UserAuthorization=$row_FF_rsUser[$FF_fldUserAuthorization]; } else { $MM_UserAuthorization=""; } session_register("MM_UserAuthorization"); if (isset($accessdenied) && false) { $FF_redirectLoginSuccess = $accessdenied; } mysql_free_result($FF_rsUser); session_register("FF_login_failed"); $FF_login_failed = false; header ("Location: $FF_redirectLoginSuccess"); exit; } mysql_free_result($FF_rsUser); session_register("FF_login_failed"); $FF_login_failed = true; header ("Location: $FF_redirectLoginFailed"); exit; } ?> <?php require_once("classes/Connection.php"); $MyConnection = new Connection(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <!-- DW6 --> <head> <!-- Copyright 2005 Macromedia, Inc. All rights reserved. --> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <title>www.sqlcoders.co.uk</title> <link rel="stylesheet" href="3col_rightNav.css" type="text/css" /> <script type="text/javascript" src="javascript/global_javascript.js"></script> <style type="text/css"> <!-- .style1 {font-size: 150%} --> </style> </head> <body> <div id="masthead"> <h1 class="style1" id="siteName">www.sqlcoders.co.uk - The Complete SQL Resource </h1> <div id="globalNav"><a href="#" title="www.sqlcoders.co.uk">Home</a>|<a href="article.php" title="Browse our index of articles." target="iframe">Articles</a>| <a href="scripts.html" title="Browse our script archive." target="iframe">Scripts</a> | <a href="reference.html" title="Use our SQL reference to learn how to use specific functions." target="iframe">Reference</a> | <a href="faq.html" title="FAQ's for those common questions." target="iframe">FAQ's</a> | <a href="#" title="Post in our forums to help you resolve a query or problem.">Forums</a> | <a href="product.html" title="Read product and book reviews here." target="iframe">Product & Book Reviews</a>| <a href="join.html" title="Join www.sqlcoders.co.uk for full member benefits!" target="iframe">Join Us</a> | <a href="contact.html" title="Contact us here!" target="iframe">Contact</a>| <a href="online.php" title="See who's online" target="iframe">Who's Online?</a></div> <?php $result = mysql_query("SELECT mem_name, mem_created FROM member ORDER BY mem_created DESC LIMIT 1"); while($row = mysql_fetch_row($result)) { $name = $row[0]; $registered = $row[1]; } echo $FF_rsUser_Source; ?> <h2 id="pageName">SQL Articles, Scripts, FAQ's & Forums<span class="latestmember"><?php echo $name." on ".$registered; ?></span><span class="latestmember">Latest member: </span></h2><div class="latestmember"></div> <div id="breadCrumb"></div> </div> <div id="headlines"> <h2>SQL Server News</h2> <script language="javascript" src="http://www.rss-info.com/rss2.php?integration=js&windowopen=1&rss=http%3A%2F%2Fmsdn.microsoft.com%2Fsql%2Frss.xml&number=3&width=230&ifbgcol=FFFFFF&bordercol=FFFFFF&textbgcol=FFFFFF&rssbgcol=FFFFFF&showrsstitle=0&showtext=1"> </script> <h2>MySQL News</h2> <script language="javascript" src="http://www.rss-info.com/rss2.php?integration=js&windowopen=1&rss=http%3A%2F%2Fwww.mysql.com%2Fmysql.rss&number=3&width=230&ifbgcol=FFFFFF&bordercol=FFFFFF&textbgcol=FFFFFF&rssbgcol=FFFFFF&showrsstitle=0&showtext=1"> </script> <h2>Oracle News</h2> <script language="javascript" src="http://www.rss-info.com/rss2.php?integration=js&windowopen=1&rss=http%3A%2F%2Fwww.oracle.com%2Frss%2Frss_ocom_dbnews.xml&number=3&width=230&ifbgcol=FFFFFF&bordercol=FFFFFF&textbgcol=FFFFFF&rssbgcol=FFFFFF&showrsstitle=0&showtext=1"> </script> <h2>PostgreSQL News</h2> <script language="javascript" src="http://www.rss-info.com/rss2.php?integration=js&windowopen=1&rss=http%3A%2F%2Fwww.postgresql.org%2Fnews.rss&number=3&width=230&ifbgcol=FFFFFF&bordercol=FFFFFF&textbgcol=FFFFFF&rssbgcol=FFFFFF&showrsstitle=0&showtext=1"> </script> <div id="advert"> <img src="" alt="" width="107" height="66" /></div> </div> <!-- end masthead --> <div id="content"> <iframe src="iframe.html" name="iframe" width="100%" height="10000px" scrolling="Auto" frameborder="0"></iframe> </div> <!-- end content --> <div id="navBar"> <div id="search"> <?php if(!isset($txtUsername)) { echo "Not set!!!!!!"; } if ($FF_login_failed = true) { echo $FF_valUsername." = ".$txtPassword; ?> <form action="index.php" METHOD="post" enctype="" name="frmLogin" target="" id="frmLogin"> <label>Login</label> <table border="0" cellpadding="0" cellspacing="0" height="100%"> <tr> <td> <p style="font-size: 80%; float: left"> Username </td> <td> <input name="txtUsername" type="text" id="txtUsername" onfocus="changeColour(this)" onblur="revertColour(this)" size="10" style="float: right" /> </p> </td> </tr> <td> <p style="font-size: 80%; float: left"> Password </td> <td> <input name="txtPassword" type="password" id="txtPassword" onfocus="changeColour(this)" onblur="revertColour(this)" size="10" style="float: right" /> </td> </tr> <tr> <td> <? echo "<p style=\"font-size: 80; font-color=\"red\">Login Failed</p>"; } else if ($FF_login_failed = false && isset($txtUsername)) { echo "Welcome user!"; } ?> </td> <td> <input name="btnLogin" type="submit" class="btn" id="btnLogin" onmouseover="changeColour(this)" onmouseout="revertColour(this)" value="Login" style="float: right" /> </td> </tr> </table> </p> </form> </div> <div id="sectionLinks"> <h3>Latest Articles </h3> <ul> <?php $result = mysql_query("SELECT art_id, art_title FROM article WHERE art_timestamp < NOW() ORDER BY art_timestamp DESC LIMIT 5"); while($row = mysql_fetch_row($result)) { echo "<li><a href=\"article.php?article=".$row[0]."\" target=\"iframe\">".$row[1]."</a></li>"; } ?> </ul> </div> <div class="relatedLinks"> <h3>Latest Comments </h3> <ul> <?php $result = mysql_query("SELECT cmt_id, cmt_art_id,cmt_mem_id, LEFT(cmt_comment, 50), art_title, mem_name FROM comment, article, member WHERE cmt_art_id = art_id AND cmt_mem_id = mem_id ORDER BY cmt_timestamp DESC LIMIT 10"); while($row = mysql_fetch_row($result)) { echo "<li><a href=\"article.php?article=".$row[1]."#comment=".$row[0]."\" target=\"iframe\">".$row[5]." On ".$row[4]."</a></li>"; echo $row[3]; } ?> </ul> </div> <div class="relatedLinks"> <h3>Latest Scripts </h3> <ul> <?php $result = mysql_query("SELECT spt_id, spt_filename, LEFT(spt_comment, 50), mem_name FROM script, member WHERE spt_submitted_mem_id = mem_id ORDER BY spt_timestamp DESC LIMIT 5"); while($row = mysql_fetch_row($result)) { echo "<li><a href=\"script.php?script=".$row[0]."\" target=\"iframe\">".$row[1]." submitted by ".$row[3]."</a></li>"; echo $row[2]; } ?> </ul> </div> </div> <!--end navBar div --> <div id="siteInfo"> <img src="" width="44" height="22" /> <a href="#">About Us</a> | <a href="#">Site Map</a> | <a href="#">Privacy Policy</a> | <a href="#">Contact Us</a> | ©2007 www.sqlcoders.co.uk </div> <br /> </body> </html>
  11. Just have a standard text field and input the html for a hyperlink. When this is spat out onto a html page you will have your hyperlink.
  12. Use mysqldump... http://www.mysql.com/doc/en/mysqldump.html This can be used from MySQL to MySQL or any other DB supporting standard SQL. I often simply copy the DB files onto a disk and put them onto the new server manually between my two windows server - with no problems yet. ALthough I am told mysqldump is the preffered way to do it.
  13. rhysmeister

    Rollup

    MySQL 4.1.1 http://www.mysql.com/doc/en/GROUP-BY-Modifiers.html
  14. Mmmmmm, I\'d probably blame your PC first rather than apache. Have a go with easyphp a package of apache, php, mysql and phpmyadmin, all configured (more or less) and ready to go.
×
×
  • 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.