Jump to content

iJoseph

Members
  • Posts

    36
  • Joined

  • Last visited

    Never

Everything posted by iJoseph

  1. I wasn't sure where to post this, but I thought this would be best as there are most people. I need a script to type in the url from a website and get the favicon as an image. Like if I type in http://www.facebook.com/ I get the facebook favicon displayed as an image. Any ideas how this would be done?
  2. Try this: <?php $Email = $_REQUEST['Email']; $Message = $_REQUEST['Message']; /*Sending Email*/ $to = "[email protected]"; $subject = "Cerere Stiri"; $message = "Contact Client Email = ".$Email." "; $from = "$Email"; if(mail($to, $subject, $message, "From: $from")) { echo "Message sent"; headder( "location: index.html"); } else{ echo "Mail not sent please try again"; } ?>
  3. I have the following code, (I'm sorry it's so long an it does more that the question asks.) It's ment to edit, delete and make new links in a mysql database, by also using a link header to home all the links (Like a dropdown menu) And thig manages the links. However then the update, or when the new form is submitted it leaves then titlereg field blank. (The titlereg is the id of the main link, it's called reg in the title_reg database) I know this is complicated and i'm not too good at explaining the problem but any help would be great. I have commented on anything that could help. <?php include "../includes/mysql_connect.php"; include "../includes/info_files.php"; echo "<strong>Links</strong><br />"; echo "Currect links:<br /><br />"; if($_POST['submit']){ $name = mysql_real_escape_string($_POST['name']); $titlereg = mysql_real_escape_string($_POST['titlereg']); $url = mysql_real_escape_string($_POST['url']); $id = mysql_real_escape_string($_POST['id']); mysql_query("UPDATE nav_sub SET name='$name', SET titlereg='$titlereg', SET url='$url' WHERE reg='$id'"); ////////////////////////////////// Here will help, the update MY SQL thingie echo "Link Changed.<br /><br />"; } elseif($_POST['remove']){ $id = mysql_real_escape_string($_POST['id']); mysql_query("DELETE FROM nav_sub WHERE reg='$id'"); echo "Link deleted.<br /><br />"; } else{ $result = mysql_query("SELECT * FROM nav_sub"); while($row = mysql_fetch_array($result)) { echo '<strong>' . $row['name'] . '</strong>'; echo '<form action="" method="post">'; echo 'Name: <input type="text" name="name" value="' . $row['name'] . '" /><br />'; echo 'Link: <input type="text" name="text" value="' . $row['url'] . '" /><br />'; echo 'Navigation title: <select name="titlereg">'; $resultabc = mysql_query("SELECT * FROM nav_title"); while($rowabc = mysql_fetch_array($resultabc)) { echo '<option value="' . $rowabc['reg'] . '">' . $rowabc['name'] . '</option>'; ////////////////////////////////// Here is the option } echo '</select>'; echo '<input type="hidden" name="id" value="' . $row['reg'] . '" />'; echo '<input type="submit" name="submit" value="Change" /> <input type="submit" name="remove" value="Remove" /><br />'; echo '</form>'; } } echo "New link:<br /><br />"; if($_POST['new_submit']){ ////////////////////////////////// Here!!!!!!!!!!!!!!! $result = mysql_query("SELECT * FROM nav_sub"); $new_titlereg = $_POST['new_titlereg']; $new_name = mysql_real_escape_string($_POST['new_name']); $new_url = mysql_real_escape_string($_POST['new_url']); mysql_query("INSERT INTO `nav_sub` (`titlereg` ,`reg` ,`name` ,`url`)VALUES ('$new_titlereg', '', '$new_name', '$new_url')"); ////////////////////////////////// here is the MY SQL statement... echo "Link added.<br /><br />"; } echo '<form action="" method="post">'; echo 'Name: <input type="text" name="new_name" value="" /><br />'; echo 'Url: <input type="text" name="new_url" value="" /> \\\\ If your linking to a page you made, then the url is index.php?catt=(The categrory you put)&page=(The page you put)<br />'; echo 'Navigation title: <select name="new_titlereg">'; $resultab = mysql_query("SELECT * FROM nav_title"); while($rowab = mysql_fetch_array($resultab)) { echo '<option value="' . $rowab['reg'] . '">' . $rowab['name'] . '</option>'; ////////////////////////////////// Here isn't submitting the value in the option } echo '</select>'; echo '<input type="submit" name="new_submit" value="Insert" /><br />'; echo '</form>'; ?> By the way, explain simply as I'm only 13
  4. I don't get what you mean, could you clarify more?
  5. I didn;t know if I should put this in javascript or in PHP as it covers both in a way, but as there is nobody in the Javascript forum I put it here. Here is my problem: I have a script that get's info from a mysql database and makes it into a navigation bar (The bar is in Javascript.) And the 'url' bit seems to be the problem. - If I type the url in Manually, "index.php?catt=mainpage-home" Then it works, no problem. But if I type: "' . $rowa['url'] . '" then the menu doesn't drop. The rowa[''] method works fine because it works for the 'name' bit. Just the url seems to not work. I will post the code below. <?php include "../../includes/mysql_connect.php"; include "../../includes/info_files.php"; ?> <link rel="stylesheet" href="http://www.controlhabbo.net/layout/global.css" type="text/css" /> <link rel="stylesheet" type="text/css" href="http://www.controlhabbo.net/layout/menu/anylinkmenu.css" /> <script type="text/javascript"> <?php $result = mysql_query("SELECT * FROM nav_title"); while($row = mysql_fetch_array($result)) { echo 'var ' . $row['id'] . '={divclass:\'anylinkmenu\', inlinestyle:\'width:150px; border: solid black 1px; background:#ebebeb\', linktarget:\'\'} ' . $row['id'] . '.items=[ '; $resulta = mysql_query("SELECT * FROM nav_sub WHERE titlereg='$row[reg]'"); $num = mysql_numrows($resulta); while($rowa = mysql_fetch_array($resulta)) { $url = $rowa['url']; echo ' ["' . $rowa['name'] . '", "index.php?catt=main&page=home"]'; ////// --------- "' . $rowa['url'] . '" ----------------- Here is the error!!! ------------- if($num > 1) echo ','; echo ' '; $num = $num - 1; if($num == 0) { $num = mysql_numrows($resulta); } } echo '] '; } ?> </script> <script type="text/javascript" src="http://www.controlhabbo.net/layout/menu/anylinkmenu.js"></script> <script type="text/javascript"> //anylinkmenu.init("menu_anchors_class") //Pass in the CSS class of anchor links (that contain a sub menu) anylinkmenu.init("menuanchorclass") </script> <div id="navbar"> <div id="navbardropdown"> <?php $resultb = mysql_query("SELECT * FROM nav_title"); while($rowb = mysql_fetch_array($resultb)) { echo '<a href="" class="menuanchorclass" rel="' . $rowb['id'] . '">'; echo '<img src="http://www.controlhabbo.net/layout/images/buttons/' . $rowb['id'] . '.png" style="border-width:0" />'; echo '</a>'; } ?> </div> </div> It's nothing to do with the include files, as it works if I type in the url manually, just not if I use the MY SQL database. Any help would be great!
  6. Yay! it worked! Cheers. Sorry for the late reply. I went off to do somthing else.
  7. I have this code but it just retruns as the 'or die()' It's not the included connection, that all works for other scripts. But for some reason nothing happenes. Any help? <?php include "../includes/mysql_connect.php"; include "../includes/info_files.php"; if(isset($_POST['submitted'])) { mysql_query("UPDATE `pages` SET name='$_POST[name]' AND SET content='$_POST[content]' AND SET catt='$_POST[catt]' AND SET page='$_POST ' WHERE id='$_POST[id]'") or die('Edit failed'); echo "Page made.<br /><br />"; }else{ $result = mysql_query("SELECT * FROM pages WHERE id='$_GET '"); while($row = mysql_fetch_array($result)) { echo '<form action="" method="post">'; echo '<input type="hidden" name="id" value="' . $row['id'] . '" /><br />'; echo '<strong>Edit: ' . $row['name'] . '</strong><br />'; echo 'Name: <input type="text" name="name" value="' . $row['name'] . '" /><br />'; echo 'Category: <input type="text" name="catt" value="' . $row['catt'] . '" /><br />'; echo 'Page: <input type="text" name="page" value="' . $row['page'] . '" /><br />'; echo '<textarea rows="25" cols="60" name="content">' . $row['content'] . '</textarea><br />'; echo '<input type="submit" name="submitted" value="Edit" />'; echo '</form>'; } } ?>
  8. O.o I don't think anybody is going to look through all of that for errors.
  9. Do you know how to use MySQL? If so then a comment script would be a good thing to do.
  10. Hey, I have this code, and it's ment to change the name / content of a page that is being put onto a page. Both of the include files are fine as it works for other actions, but this one just returns the error. <?php include "../includes/mysql_connect.php"; include "../includes/info_files.php"; if(isset($_POST['submitted'])) { mysql_query("UPDATE `pages` SET name='$_POST[name]' AND SET content='$_POST[content]' AND SET catt='$_POST[catt]' AND SET page='$_POST ' WHERE id='$_POST[id]'") or die('Edit failed'); echo "Page made.<br /><br />"; }else{ $result = mysql_query("SELECT * FROM pages WHERE id='$_GET '"); while($row = mysql_fetch_array($result)) { echo '<form action="" method="post">'; echo '<input type="hidden" name="id" value="' . $row['id'] . '" /><br />'; echo '<strong>Edit: ' . $row['name'] . '</strong><br />'; echo 'Name: <input type="text" name="name" value="' . $row['name'] . '" /><br />'; echo 'Category: <input type="text" name="catt" value="' . $row['catt'] . '" /><br />'; echo 'Page: <input type="text" name="page" value="' . $row['page'] . '" /><br />'; echo '<textarea rows="25" cols="60" name="content">' . $row['content'] . '</textarea><br />'; echo '<input type="submit" name="submitted" value="Edit" />'; echo '</form>'; } } ?> Any help would be great.
  11. It looks like the variables are not being seen by the code, so they are filling the insert area with 'null'
  12. Yeah. This looks like the correct error: Notice: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'group, age, xp) VALUES ('', '9', '', '', '', '0')' at line 1 INSERT INTO avatars (id, usernameid, name, group, age, xp) VALUES ('', '9', '', '', '', '0') in _________ on line 31 Still have no idea though.
  13. Yes, I get an error, but I don't see why. Parse error: syntax error, unexpected '{' There is no '{' on the line the erorr is saying (28).
  14. There - I put the correct sql query in. Still the same problem.
  15. Ah, I used the wrong code. This is the code for registering the actual user, not the database I want to insert into, but for some reason I put the other SQL query. :S sorry.
  16. I have this code: <?php $con = mysql_connect("localhost","hhh","hhh"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("hhh", $con); // -------------------- // Avatar insert check // -------------------- session_start(); $name = $_POST[name]; $group = $_POST[group]; $age = $_POST[age]; $usernameid = $_SESSION[id]; $result = mysql_query("SELECT * FROM avatars WHERE name='$_POST[name]'"); $num = mysql_numrows($result); if ($num == 0) { mysql_query("INSERT INTO avatars (id, usernameid, name, group, age, xp) VALUES ('', '$usernameid', '$name', '$group', '$age', '0')"); header( 'Location: me/' ) ; } else echo 'Sorry, please pick a new name'; ?> And it does everything but put the data into the datebase. If I add a session befor and after '$request' they both run, but the sql doesn't. No error returns, if just redirects to the other page. Any help?
  17. I have some code that I need to put into a variable to post onto a site. But is just comes up with the actual code, not the result. Here is the code: <?php $search = $_GET['search']; if($search == '') die('You didn\'t fill out the Search field.'); $con = mysql_connect("localhost","hhh","hhh"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("music", $con); $result = mysql_query(" SELECT * FROM songs WHERE album='$search'"); $num_rows = mysql_num_rows($result); if($num_rows == 0) die('No results were found.'); $content = ' <?php echo "<table border=\"1\"><tr> <td width=\"33.333%\"><b>Song name</b></td> <td width=\"33.333%\"><b>Artist</b></td> <td width=\"33.333%\"><b>Album</b></td> </tr>"; while($row = mysql_fetch_array($result)) { echo "<tr> <td><a href=\"play.php?id=" . $row[\'id\'] . "\">" . $row[\'song\'] . "</a></td> <td><a href=\"search_artist.php?search=" . $row[\'band\'] . "\">" . $row[\'band\'] . "</a></td> <td>" . $row[\'album\'] . "</td> </tr>"; } echo "</table> <p>This page shows all of the songs in an album.</p>"; ?> '; include "layout/index.php"; ?> I would be thankfull of any help. I'm not that good at PHP, I'm only 13
  18. I think this will work: <?php $con = mysql_connect("localhost","hhh","hhh"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("Blah", $con); $result = mysql_query("SELECT * FROM users"); while($row = mysql_fetch_array($result)) { $from = "From: <[email protected]> "; $to = " " . $row['email'] . " "; $subject = "title "; $message=" Message "; $message = stripslashes($message); if (mail($to,$subject,$message,$from)) { echo "Email sent"; } else { echo "MAIL FAILED"; } } mysql_close($con); ?> Sorry if it doesn't work, I havn't tested it.
  19. Thanks
  20. The $username / $passord are at the top, from the $_POST[''].
  21. I normally do: <?php $from = "From: <[email protected]> "; $to = " [email protected] "; $subject = "Subject"; $message="Hello!"; $message = stripslashes($message); if (mail($to,$subject,$message,$from)) { echo "Message sent"; } else { echo "MAIL FAILED"; } ?>
  22. I have made this code for a login. It just shows a blank page showing nothing, so the code is not wrong, but I can;t see what is... I would like it if you could identify the problem for my. Thanks, Joe. <?php $username = $_POST['username']; $password = $_POST['password']; $con = mysql_connect("localhost","hhh","hhh"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("Blah", $con); $result = mysql_query("SELECT * FROM users WHERE username='$username' AND password='$password'"); while($row = mysql_fetch_array($result)) { $d_username = $row['username']; $d_password = $row['password']; if($d_username == $username && $d_password == $password) { echo 'Win '; } else { echo 'Fail :l'; } } ?>
  23. How would I make a div's height 100%? This is my code: <!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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style type="text/css"> <!-- body { background-image: url(images/bg1.gif); } .main { background-image: url(images/bg.gif); background-repeat: repeat-y; background-position: center; height: 100%; } --> </style></head> <body> <div class="main"> <table border="0" width="100%" height="100%"> <tr> <td height="21"> </td> <td width="960px"><p>Howdie</p></td> <td></td> </tr> </table> </div> </body> </html> But it's not working, any ideas?
  24. Hey, I'm not that good with CSS, and even dreamweaver can't help me. I'm trying to get two backgrounds to show at the same time, but for one to overlay the other. I have one, for the whole background, and another that goes in the middle on the y axis I have tryed: <style type="text/css"> background-image: www.mysite.com/images/bg.gif; background-image: www.mysite.com/images/bg2.gif; </style> And... <style type="text/css"> background-image: www.mysite.com/images/bg.gif; </style> <body background="www.mysite.com/images/bg2.gif"> But it's not working. Can anybody help me? I'm 13 by the way
×
×
  • 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.