Jump to content

Derleek

Members
  • Posts

    297
  • Joined

  • Last visited

    Never

Everything posted by Derleek

  1. Ok. so i am attempting to update a chunk of text in a database. the query looks like this: UPDATE mail SET msg = '<p> asdfasdfasdf</p>' AND title = 'frustrated' WHERE title = '3' as it should. but when i go to check to see that it is updated properly it does not touch the title in the database and msg gets set to 0.
  2. yes, is there a way to pass a variable with $_GET without using it in the url? just curious.
  3. no, because i am updating the database where the old title's match. if i do $title=$_GET['$title']? will that work? maybe i don't understand how $_GET works because i tried changing the form to form action="<?php echo $_SERVER['PHP_SELF'];?><? echo '?title2=$title'; ?>" method="request"> so i could use 'get' and 'post', because i think i would need to use both. When i make that change and click submit it just clears everything...
  4. So I am implementing the FCK editor (http://www.fckeditor.net/) and i've successfully made it so i can create and submit a text file to my database. I am now trying to make it so I can open a message saved in the database and load the title/message into the editor. That all works fine. But when I try and edit it everything goes crazy. Basically I have variables set to $title and $message to fill out the given form. When i click submit, the variable $title is no where to be found after the submit button is clicked... and i have no clue why. I don't think it really has anything to do with the editor or even the $_POST function. I've made several scripts using $_POST and i haven't gotten any funky results like this... here is my code: <?php include_once("fckeditor/fckeditor_php5.php") ; include_once("db.php"); dbConnect("massMailer"); $title = $_GET['title']; $msg = "SELECT msg FROM mail WHERE title = '$title'"; echo $msg."<br>"; $result = mysql_query($msg) or die(mysql_error()); while($row = mysql_fetch_array($result,MYSQL_ASSOC)) { $message = $row['msg'];} ?> <html> <head> <title>Edit Your Message</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <body> <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post"> Title: <input type = "text" name = "Title" value = "<?php echo $title; ?>"> <?php $oFCKeditor = new FCKeditor('fck') ; echo "$title!!!"; $oFCKeditor->BasePath = '/MassMailer/fckeditor/' ; $oFCKeditor->Value = $message ; $oFCKeditor->Create() ; ?> <br> <input type="submit" value="Submit" name="SubmitBtn1"> </form> </body> </html> <? if($_POST['SubmitBtn1']) { $newTitle = mysql_escape_string($_POST['Title']); $newMessage = mysql_escape_string(stripslashes( $_POST['fck'] )) ; echo "$title!!!<br>"; $sql = "UPDATE mail SET msg= $newMessage AND title = $newTitle WHERE title = $title)"; echo $sql; mysql_query($sql) or die(mysql_error()); } the echo "$title!!!<br>"; line outputs this '!!!<br>' any idea's why $title gets erased after submission?
  5. So I am creating a page that displays titles of messages that are stored in a DB. I would like to make each title a hyperlink to each message. Is there a way to send the title of a given article to a page called 'msgHandler.php' when a message title is clicked? I was thinking of using some kind of onClick command, but i'm not proficient in JavaScript. So is there any way to send a variable through a hyperlink so i don't have to create an individual file for each message that is submitted to the DB?
  6. forgive me for this silly question, but i'm just looking to use some basic JS for a script i'm developing. How are variable's handled between JS and PHP? Lets say i have a variable $msg defined in a php sript. If i wanted to use that in a JS function... do I have to do anything special to pass a variable from language to language?
  7. thanks... i think that should work just fine
  8. I am storing e-mails for a mass e-mail system i'm throwing together. I can't figure out how to allow people to put a single quote in the message without throwing everything off... this is the code that i have now, which doesn't allow users to use the ': $sql = "INSERT INTO mail (msg) VALUES ('$content')"; I've tried: $sql = `INSERT INTO mail (msg) VALUES ("$content")`; and get 'query was empty' and: $sql = 'INSERT INTO mail (msg) VALUES ("$content")'; the sql inserts $content how do i get around this?
  9. Hi, I am trying to figure out how to run a short little flash video every time the user clicks a link. what would the best way to do this be? I was thinking just putting the onClick ='callVideo()' in the <a> tag...
  10. How do i take input from a file and just stick it all in a string? The only way i can remember how to do it sticks each line into an array... grr
  11. no the 'UPDATE' command didn't work when i create a table with 'default 0'
  12. Hey, i was just wondering if any one could recommend a good tutorial/explanation of the some good ways to secure a website. I'm new to the web development world and know basically nothing about security. I am using apache if it matters.
  13. How do i set up a table cell to have a default value so i don't have to 'INSERT' anything so i can just do 'UPDATE'. I tried doing CREATE TABLE options( nameToggle INT NOT NULL DEFAULT 0)
  14. Hi, So i am very interested in learning javascript. I have checked out the basic syntax, watched a couple video's i found on the net and i feel javascript will be a great addition to my web development skills. I'm particularly impressed with the mootools framework and will likely aim to develop in that. Although i'm uncertain when it is appropriate to use and implement it, because i've read a TON of people say things like, 'javascript is a great tool, if you know how and when to use it!' being a novice at this language, i do not know 'how and when to use it'. example:This hair studio hired me to make them a website. she wants some animated stuff, i was going to do the whole thing in flash (which i hate), then i found out i could do it in javascript. Should I bypass flash and use javascript, or just embed a simple flash file over the website. She wants animation stuff similar to this website(minus the intro): http://www.onlysalons.com/Sample%20Sites/Site7/index.html
  15. I always run into this problem and i'm curious what would be the most efficient way to approach it. I have to select up to 65 names from a database and display them in 10 different drop down menu's. would it be more efficient to run a bit of code 650 times code: (i am not sure if the MySQL stuff is right, i'm new and experimenting ) <? //QUERY to set the rider ID for pre-entry list of race $query = "SELECT racer_id FROM race_racer WHERE race_id = $race_id AND class_id = $class_id"; $result = mysql_query($query) or die(mysql_error()); $R_id = array(); while($row = mysql_fetch_array($result,MYSQL_ASSOC)) { $R_id= $row['racer_id']; $q=0; $sql = "SELECT name FROM Racers WHERE racer_id = $r_id"; $result = mysql_query($sql) or die(mysql_error()); $row = $result; $name =$row; } ?> or store all of the names into an array and go through the array 10 times. Once again i'm relatively new to the php/MySQL realms so go easy on me
  16. Ok, so i have two tables that have this information in it Racers: id| Name Race_racer: (which matches up a racer to a race) id| class| race_id| Now what i need to do is retrieve a name from 'racers' if it equals the id, race_id, and class. Can this be done?
  17. oh yeah, i posted this as well so i could see what other things people use. so i'll update the poll if you use something that is 'other'
  18. My friend found Aptana and i fell in love with it. I used to use Notepad++ before i switched to mac. Then i tried Smultron but it sucked.
  19. not quite sure what you mean by this... mooTools is completely open so you can modify it as much as you want
  20. Danieal0, what do you think of mooTools? i'm trying to expand my knowledge base and i'm looking at JavaScript thinking it might be a good addition. that being said, i just read that you recommend learning the language thoroughly before jumping to a framework such as mooTools... Would there be any big drawback to learning the basic in's and outs of JS then jumping to mooTools or JQuery?
  21. i do it like this: if(x>129038129038) { return blah; } I saw some code organized like this and i just felt it made sense...
  22. Derleek

    Joomla!

    could you list some of the frameworks? are there any that you recommend?
  23. It seems to me that these elements of JS can be implemented to benefit the user in a non-distracting way. Ex: i am currently working on a moto-cross fantasy league site. There are 40+ riders in each pre-entry list for each race. To me it seems more logical to be able to search a database and drag and drop the results than A) having the user type the riders name or B) having a extremely large drop down menu Granted i haven't really explored any other options, which i intend to do when i cross the bridge of developing this feature. but it just seems like the easiest, user friendly way to approach that situation.
  24. Derleek

    Joomla!

    Ok, well what if we learned to make our own templating system?
  25. Derleek

    Joomla!

    So me and my buddy are starting a web design company. I am the coder with some decent experience with C++ and now php/mysql he is a very knowledgeable computer guy who is working on more design stuff. He stumbled upon Joomla! several months ago when he was venturing out on his own. I am wondering the pro's and con's to using a system like joomla! to develop a rather wide range of websites (from modeling pages to lawyers and out from there). I'm going to be up front. Like many other coders, i am lazy... i don't really want to mess with other peoples crappy templates, so i'm debating weather we should use Joomla! as the base for all (or at least some or most) of our projects. meaning we would have to develop a templates on our own... i know basically nothing about Joomla! and he knows nothing about coding, so considering i can code all of the features i have seen, and likely most that i haven't, is it worth using this CMS? we are using... (kinda using anyways) joomla 1.5...
×
×
  • 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.