Jump to content

iJoseph

Members
  • Posts

    36
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

iJoseph's Achievements

Member

Member (2/5)

0

Reputation

  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 = "support@text.com"; $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.
×
×
  • 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.