Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. You're talking about a minor difference in notation/handling here. Is it necessary? Really? Or you just like the look of it. If you need to do it, add a public property to your class. Then instead of assigning the query result to an array assign it to the caller's property. Voila. Of course if you don't understand this, maybe you don't want to get into OOP
  2. Just realize that burying a specific path inside a function limits its portability. If there has to be a path why not pass it in as an argument? Or are you referring to the include STATEMENT, and not a user-written function? If so, I think you can answer that yourself.
  3. Well if you don't know what it is how are we supposed to help you cause that is part of your string issue I think. What is that string supposed to output for you? Figure out what you want and write your own output string.
  4. Really? I have to teach you how to restructure a compound string? Instead of this: echo '<input type="hidden" name="channel" value="$_SESSION['channel_id']">'; Try: echo "<input type='hidden' name='channel' value='".$_SESSION['channel_id']."'>"; Note the use of the . to break it into 3 pieces so that the session var could be properly recognized. There are other ways but this is simple. Also note: When building complex strings IMHO it is better to wrap it in double guotes to enable the vars to be properly interpreted. Try this on the other problem string. What about the thingie I asked you about? What IS it?
  5. Well, not if he isn't up to date. For now he just has a bunch of other syntax problems and owes us some answers about certain things I asked about in his code.
  6. It's all about the use of quotes and double quotes. You have to break up the string in to pieces or else use escape chars to avoid unintended breaks to your content.
  7. See comments I added include_once ('classes/config.php'); include_once ('classes/sessions.php'); include 'uploader_conlib.php'; $config['notification_error'] = $lang_error; $page_title = $lang_upload_video; if ($_SESSION['user_id'] == "") { header("Location: $login_out_link");; // TWO SEMIS HERE die(); } $load_javascript = 1; $ahah = 1; $thickbox = 1; /////////////////////////////////////////////////////////////////////////////////////// // ADDED SPAMMER UPLOAD TRACKING LOGING // $member_uploading = $_SESSION['user_name']; $tracking_log_file = 'logs/uploader_log.txt'; $admin_email = $config['admin_notify_email']; $user_ip = mysql_escape_string($_SERVER['REMOTE_ADDR']); $referer = mysql_real_escape_string($_SERVER['HTTP_REFERER']); if ( $referer == '' ) die_spammer_alerts(); if ( !ereg ($_SERVER['SERVER_NAME'], $referer) ) die_spammer_alerts(); /////////////////////////////////////////////////////////////////////////////////////// if(isset($_SESSION['channel_id'])) { echo '<input type="hidden" name="channel" value="$_SESSION['channel_id']">'; // THINK YOU NEED TO WORK ON THIS } else { echo '<select class="upload-video-form-input" name="channel" onchange="javascript:ahahscript.ahah('[var.base_url]/uploader.php?sub_cat='+ document.form_upload.channel.value, 'sub_change', '', 'GET', '', this);"> [var.fields_all;htmlconv=no]</select>'; // THIS LINE IS DEFINITELY BROKEN. TOO MANY ' AND " CHARS HERE! }
  8. Is your code naturally double-spaced or are you doing that? Bad editor!
  9. Trust me - line 39 is not blank. Whatever editor you are using is not numbering things correctly. Look above and below and look for the error. You are looking in the uploader script? What is this var.base_url thingie? You wrap that in quotes once but the next thingie var.fields_all you don't. Should there be some consistency with whatever they are?
  10. You say you got a syntax error so you apparently have error checking turned on. Did you follow up on the message as to the script name and the line number giving you that error and correct it?
  11. Why are you fetching an object when the result is just a simple value? Try: //Get the results $inbox = $inboxQry->fetch(PDO::FETCH_ASSOC); $cnt = $inbox['unreadCount']; //Prepare the output based on results $html = "You have $cnt new messages"; echo "<div class='FooterText'><a href='Inbox.php">$html</a>";
  12. You don't understand normal English. I asked for an explanation without using CODE and all you give me are sites which I choose not to click on. What do these sites have to do with your script? Don't answer that. Just explain what is going on here.
  13. 1 - turn on error checking so you can see messages 2 - remove the quotes from the parms in the query statement.
  14. I looked at your code. I have no idea what you are trying to do. Can you explain in plain English what you are doing without using code to make your point? I really don't know what you want. It appears you want to do something with a query string as I said before, but where does this come into play??
  15. If you have to import it constantly, it certainly would behoove you to write a translation script to produce a proper db structure!
  16. OK - you wrote some code and more importantly, you posted it properly. Now - what exactly is the "problem"? Perhaps you could isolate the area of the code you are having difficulty with?
  17. And that is how the problem is solved by those who understand regular expressions! Note Psycho mistook your underscores for dashes so correct his code accordingly.
  18. So - English is not your native language. In that case I'm sorry for picking on you but I did not think that was the problem. You actually have pretty good command of the language - I just thought it was American Millennials laziness
  19. I don't know which is worse. Your English or your PHP. Did you even read your text prior to hitting the Post button? Ok - you want to modify the non-numeric values only. Got that. And you only want to change the values. So why do you start out changing the key first thing? Using is_numeric is going to fail (tried it) because having that dash in the value automatically makes it NOT numeric. If your pattern is consistently as you stated, you could do a trial replace from _ to a dot which would then be acceptable as a numeric value. THEN you could make your ultimate change from dot to null. PS - you do realize that when the foreach completes, the values in the GET array will not be altered with your current code.
  20. Didn't notice the ext. nor do I care. The poster needs to understand that not everyone willy-nilly clicks on attachments. That said - he/she should also show us the specific code that needs addressing by this forum and if he/she posts too much that will also be pointed out. I'm guessing that the poster did not write this code and basically knows very little PHP since the question appears to ask how to handle a query string from a url. A pretty basic question that any php coder should be able to handle. I await his/her response and we'll go from there.
  21. Did you write this code? What do you need help with specifically? Since you didn't post it I can't see it but the question is rather vague. Perhaps you could POST the code and elaborate on exactly what you are trying to achieve, along with your attempted code so far?
  22. You got that much from the OP's writing?? You ARE Good!
  23. PHP gets its input from form elements via the Get and POST arrays. You know that, don't you? Sorry - now I see that you are parsing this by reading some other script. So you are beginning to use the dom functions. Have you read up on examples of how to parse that document yet?
  24. How about reposting and using some punctuation, some proper code tags and breaking out the code from the text and EXPLAINING what it is you have done? Your current post is a mess to read and understand.
  25. And? Please don't make this so tedious.
×
×
  • 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.