Jump to content

hank__22

Members
  • Posts

    14
  • Joined

  • Last visited

    Never

Everything posted by hank__22

  1. Hi, I'm looking for a script to show news messages on my site. I want a way to display 10 stories on the page, and at the bottom have an option to look at the next (older) stories, and the page should update that information. Something like a blog but on a simpler scale, Just a title and the news story. Can anyone recommend such a script?
  2. Ive now done it that way! thank you for spotting that Thanks everyone
  3. that works, sort of! Ive just realized that youtube has two variation of the link: The single link is: http://www.youtube.com/watch?v=o5g2yyvdjrE and the link in the embaded flash is: http://www.youtube.com/watch?v=o5g2yyvdjrE So it doesn't work And posting the whole embaded code into the database results in only half the code being shown on the webpage
  4. The problem is with the php part, the link doesn't get put into the code, and so the video wont load: <object width="425" height="350"><param name="movie" value="<?php echo $row["link"];?>"></param> <param name="wmode" value="transparent"></param><embed src="<?php echo $row["link"];?>" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>
  5. Ok trying it the other way: <div id="content"> <h2> <?php $host="localhost"; // Host name $username="xxxx"; // Mysql username $password="xxxx"; // Mysql password $db_name="xxxx"; // Database name $tbl_name="video"; // Table name // Connect to the database // 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"); // Edit this number to however many links you want displaying $num_displayed = 1 ; // Select random rows from the database $result = mysql_query ("SELECT * FROM $tbl_name ORDER BY RAND() LIMIT $num_displayed"); // For all the rows that you selected while ($row = mysql_fetch_array($result)) { echo $row["text"] ; } ?> </h2> <object width="425" height="350"><param name="movie" value="<?php echo $row["link"];?>"></param> <param name="wmode" value="transparent"></param><embed src="<?php echo $row["link"];?>" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object> </div> The video doesn't show, what am I doing wrong?
  6. Hi, I'm having trouble with the syntx of this echo: Basically I have a database with a load of youtube video links (e.g. http://www.youtube.com/watch?v=293X33Goo_k) I want to have random videos be loaded when ever you go to the page (this does work). What I have so far for the echo is: echo "<object width="425" height="350">" . "<param name="movie\"" . "value=\"" . row["link"] .\""> . "</param><param name="wmode" value="transparent"></param>" . "<embed src=\"" . row{"link"] .\"" . "type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"> </embed></object>" ; link is surprisingly the link of the youtube video. The full html syntax looks like this: <object width="425" height="350"><param name="movie" value="http://www.youtube.com/watch?v=293X33Goo_k"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/watch?v=293X33Goo_k" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object> But I get parse errors and I'm finding it hard to work out where the quotes go etc, can anyone please help? Also I would like to have the title of the video at the top of the video it self, the table is called text and if possible be inside <h2> tags
  7. Ive gotten it to work now! thank you very much for your help But is there a better login script available?
  8. ok , do you know of a good example?
  9. I've tried: <?php ob_start(); $host="localhost"; // Host name $username="xxx"; // Mysql username $password="xxx"; // Mysql password $db_name="xxx"; // Database name $tbl_name="members"; // 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"); // Define $myusername and $mypassword $myusername=$_POST['myusername']; $mypassword=$_POST['mypassword']; $sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'"; $result=mysql_query($sql); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $myusername and $mypassword, table row must be 1 row if($count==1){ // Register $myusername, $mypassword and redirect to file "login_success.php" session_register("myusername"); session_register("mypassword"); header("location:login_success.php"); } else { echo "Wrong Username or Password"; } ob_end_flush(); ?> <html> <head> But its still giving me errors! I got the code from http://www.phpeasystep.com/phptu/6.html Can anyone recommend a better place where I can get a login php script?
  10. Hi I'm getting these error mesages for my login: Warning: session_register(): Cannot send session cookie - headers already sent by (output started at /home/mike401c/public_html/access/test/checklogin.php:10) in /home/mike401c/public_html/access/test/checklogin.php on line 34 Warning: session_register(): Cannot send session cache limiter - headers already sent (output started at /home/mike401c/public_html/access/test/checklogin.php:10) in /home/mike401c/public_html/access/test/checklogin.php on line 34 Warning: Cannot modify header information - headers already sent by (output started at /home/mike401c/public_html/access/test/checklogin.php:10) in /home/mike401c/public_html/access/test/checklogin.php on line 36 I'm not sure what they mean! can someone tell me whats going wrong?
  11. seems local host is "localhost" But now I get this error: Warning: session_register(): Cannot send session cookie - headers already sent by (output started at .... etc What does this mean? Or is there a better place where I can get php login scripts?
  12. the code is: <?php $host="mike401.com"; // Host name $username="mike401c"; // Mysql username $password="password"; // Mysql password $db_name="mike401c_members"; // Database name $tbl_name="members"; // 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"); // username and password sent from signup form $myusername=$_POST['myusername']; $mypassword=$_POST['mypassword']; $sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'"; $result=mysql_query($sql); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $myusername and $mypassword, table row must be 1 row if($count==1){ // Register $myusername, $mypassword and redirect to file "login_success.php" session_register("myusername"); session_register("mypassword"); header("location:login_success.php"); } else { echo "Wrong Username or Password"; } ?> obviously password is not actually 'password'.
  13. Hi there, I'm using a pre-made login script from http://www.phpeasystep.com/phptu/6.html. I've filled in all the places I need to change but when I try and login I get this message: Warning: mysql_connect(): Access denied for user: 'mike401c@df53' (Using password: YES) in /home/mike401c/public_html/access/checklogin.php on line 19 cannot connect I'm not too sure what it means? Could someone explain to me whats going wrong?
×
×
  • 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.