Jump to content

mikesta707

Staff Alumni
  • Posts

    2,965
  • Joined

  • Last visited

Everything posted by mikesta707

  1. hmm maybe post code, I dont have much experience with showing other languages on websites though
  2. You can do it that way, but that won't be dynamic (IE you will have to reload the page for the quote to actually show up) If i'm not mistaken (and I might be) I believe these forums use javascript to get the quote. The way I would do it is wrap every post in its own unique div tag (IE the div id would be the post number) and use the getElementByID function to get the innerHTML of the div tag and voila. A quick example would look like <script type="text/javascript"> function getText(id){ element = getElementById(id); reply = getElementById("replyBox");//this is the ID of the reply textarea reply.value = "[quote]"+element.innerHTML+"[/quote]"; } </script> and then you would have links like [code] <a href="#quickReply" onclick="getText('post124')">Quote</a> a div may look like <div id="post124"> ZOMG I GET HEDER ERORS HALP </div> You can probably figure out the rest. But this is how I would go about it if i wanted a dynamic quote system like these forums have
  3. yep its an array. You could, technically, concatenate all the stuff into one big string, but the array method is much cleaner in my opinion
  4. I think you are supposed to set the charset in a meta tag, not the doctype declaration, like so <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> but I could be wrong. just did a google search and this line of code came up in one of the pages
  5. this Error: Permission denied for <http://talkgadget.google.com> to call method Location.toString on <http://www.google.com>. is a javascript error I believe, and one that I commonly see in my error console when visiting sites. besides that error comes from google, as well as the other error. So I don't think either of those have anything to do with your PHP. Do you get any PHP errors? Don't check your javascript error console for PHP errors
  6. $imagesubject2 = array(); while ($item = readdir ($dp) ) { if ( (is_file ($item)) AND (substr($item, 0, 1) != '.') ) { //Get file size $fs = filesize ($item); //Get file modification date $lm = date ('F j, Y' , filemtime($item)); //Find image $imagepattern = '/^([0-9]){1,}.jpg$/'; $imagesubject = "$item"; if (preg_match($imagepattern, $imagesubject, $imagematches)) { //Open file $imagesubject2[] = "$imagesubject"; } } } $i = 0; foreach($imagesubject2 as $sub){ echo "$i : $sub<br />"; $i++; } that should do the trick. if you want an explanation let me know
  7. if you want to display whats inside imagesubject2 outside the loop then echo it outside the loop.... I dont understand your question here
  8. or if you're feeling froggy <?php echo $pg = $_GET['pg']; ?>
  9. if you really must have it in 1 line $row = mysql_result(mysql_query("SELECT TopicName FROM ForumTopics WHERE TopicID = '{$_GET['TopicID']}'")); should be around what you need, but I like to store the results of queries, and the queries themselves into variables for error checking, debugging and the like
  10. Try removing the @ from infront of your mysql_fetch_assoc. That may be suppressing a warning or error that would help you in the debugging
  11. ok nevermind. I realize what happened. this line $table = (isset($_GET['tableName']) && !empty($_GET['tableName'])) ? "'".$_GET['tableName']."'" : 'STG_LPS_INCOME'; was messing up my oracle query, which I guess decided to destroy everything else on the page. I changed to this $table = (isset($_GET['tableName']) && !empty($_GET['tableName'])) ? $_GET['tableName'] : 'STG_LPS_INCOME'; and it worked fine. phew crisis averted
  12. How do you know that? Does the URL that is requested contain the ?tableName=xxxx value? What is the code on your page that is using the $_GET['tableName'] variable? Is there any chance of nested <form></form> tags as that would make your HTML invalid? And you do know that without an action="" attribute that the request is for the current page? yes there is no ?tableName=xxxx value. there is one line, that is as follows that uses the get $table = (isset($_GET['tableName']) && !empty($_GET['tableName'])) ? "'".$_GET['tableName']."'" : 'STG_LPS_INCOME'; nope no nested form tags. and yes I do realize that the action tag is missing, and this is what I want. I seem to be getting an unrelated error however which is leading things to fail. Hold on a bit let me tinker with it
  13. I'm so confused right now. I'm trying to do something very simple. I have a form, of type get, that is supposed to work. it looks like this $get ="<form name=\"getForm\" method=\"get\" action=\"".$action."\"> <input type=\"text\" name=\"".$getID."\" id=\"".$getID."\" /> <input type=\"submit\" value=\"".$value."\" /> </form>"; //added line breaks for clarity When I submit this its not sending anything. The variables are set, and it looks like its supposed to. On my specific page, it looks like this <form name="getForm" method="get"> <input type="text" name="tableName" id="tableName" /> <input type="submit" value="Change Table" /> </form> I create these gets with a function I have, that looks like this public function createGet($getID, $value = "Submit", $action = null){ if (!$action){ $get = "<form name=\"getForm\" method=\"get\"><input type=\"text\" name=\"".$getID."\" id=\"".$getID."\" /><input type=\"submit\" value=\"".$value."\" /></form>"; } else { $get = "<form name=\"getForm\" method=\"get\" action=\"".$action."\"><input type=\"text\" name=\"".$getID."\" id=\"".$getID."\" /><input type=\"submit\" value=\"".$value."\" /></form>"; } echo $get; } On a different page I use this function, with slightly different variables than I use in the one that isn't working, and it works perfectly. I'm so confused right now, and angry. Does someone see anything wrong?
  14. well if there were no code it wouldnt be doing anything. where is the code that reloads the index page?
  15. oh my bad I see what he was trying to do. change to foreach($_GET as $ind=>$val){
  16. print_r row so I can see what it looks like
  17. im not sure why he was using an object there, but try changing it to foreach($_GET as $ind){
  18. then lets see this code? what version of php do you have on your various machines
  19. yeah no problem, just post the header page so I know how it is scructured
  20. oh yeah my bad forgot about that echo ("<input type='radio' name='radio' value='".$row['answer1']."'> A: " . $row["answer1"] ."<br>");
  21. headers won't work if you output something to the page. Well actually there IS a work around, but most of the time if you are forced to use the work around, you should rethink how you are coding the page. Its just something about headers. check out the PHP manual if you want more information though.
  22. don't set the session to the value of what the user posts?
  23. im gonna assume that loginName is a varchar data type try $sql = "DELETE FROM onlineusers WHERE loginName='$logName'" you usually want to surround varchars with single quotes. also that header isn't going to work unless you get rid of the echo statement.
  24. Ahh I knew there was a much better way. Yeah use that
×
×
  • 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.