Jump to content

cursed

Members
  • Posts

    71
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

cursed's Achievements

Member

Member (2/5)

0

Reputation

  1. Yes I know, but that wouldn't be automated, would it?
  2. Well, CMS's are a little much for a simple php script such as a database retrieve. It'd just be cool if the content (i.e the rows of a database) could be automatically styled nicely/professionally. It wouldn't be too hard to do this in pure CSS.. I might make a quick function for it one day.
  3. After working with PHP for a looooooooong time, I get bored of the black and white/just text. Is there a function out there to auto template the content and maybe have a cool interface? It'd be pretty useful for people that make admin interfaces. This is just out of curiosity xD It wouldn't be too hard to code, just put everything under an expandable DIV, logo as the basename of a domain, maybe nav bars based on directory tree, with a glossy web 2.0 UI.
  4. Hey all, So I've been failing at writing PHP code for the last couple days, any help would be great. So I get this error: 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 'key, title, content, url) VALUES('google wave', ' WebJunction Group: Google Wave' at line 1 The line of code is: mysql_query("INSERT INTO content (key, title, content, url) VALUES('$key', '$title', '$page', '$link')") or die(mysql_error()); The funny thing is, when I remove the column KEY and it's value, it works fine. (It would look like mysql_query("INSERT INTO content (title, content, url) VALUES('$title', '$page', '$link')") or die(mysql_error()); ) I've added slashes and it does exist (I echo it before I input it, just to show i'm not crazy) Thanks in advance for the help, love you guys.
  5. I am a dumbass :'( Forgot to assign the addslashes variables. do'h.
  6. Code: if (!empty($title) && !empty($page)) { addslashes($title); addslashes($page); addslashes($link); mysql_connect("localhost", "user", "pass") or die(mysql_error()); mysql_select_db("database") or die(mysql_error()); $query = mysql_query("SELECT * FROM content WHERE title='$title'"); if(@mysql_num_rows($query)!=0) { echo "carry on with script"; } else { echo "adding"; mysql_query("INSERT INTO content (content, url) VALUES('$page', '$link' ) ") or die(mysql_error()); } A lot of miscellany (might be important?) and wrongly formatted code but when I execute this code I get this error: 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 's announced the new iPhone, a refresh to the Pro line (or that it's being scrapp' at line 2 This happens every single time on the first or second sentence. The code that is inserted is HTML. Thanks in advance.
  7. Is this possible? Thanks for all the help, I'm not very fluent (at all) in javascript. edit: oh just the default cursors in CSS.
  8. Thanks again cags for solving yet another one of my problems. I wonder where the solved button went.. edit: in your opinion, do you think setting it as a global variable is any good? file_get_contents increases load time by quite a bit, especially with large websites. especially if I do destroyiffound("a"); destroyiffound("b"); destroyiffound("c");
  9. Apologies for the stupid q in advance. Why doesn't strpos find the keyword? <? $test = "hi"; $page = file_get_contents("http://www.google.com"); function destroyiffound($keyword) { if(strpos($page, $keyword)) { $test = "bye"; echo $test; } else echo "wtf"; } echo $test; destroyiffound("b"); ?>
  10. Thanks guys, it seems to work fine now. I greatly appreciate the help.
  11. I used RegexBuddy and RegexTester's website, they both say no match. A example of the code needing to be matched can be found at: http://the-palm-sound.blogspot.com/ (not my website, just randomly searched upon)
  12. Hey, so I have some code: othercontent... <!-- AddThis Button BEGIN --><br /><a href="http://www.addthis.com/bookmark.php" onclick="addthis_url = location.href; addthis_title = document.title; return addthis_click(this);" target="_blank"><img src="http://s7.addthis.com/button1-share.gif" width="125" height="16" border="0" alt="Bookmark and Share" /></a> <script type="text/javascript">var addthis_pub = '';</script><script type="text/javascript" src="http://s7.addthis.com/js/widget.php?v=10"></script> <br /><!-- AddThis Button END -->(other content) and my regex to match the code looks like: <!-- AddThis Button BEGIN -->[\s\S]*?<!-- AddThis Button END --> Why doesn't this work?
×
×
  • 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.