premiso
Members-
Posts
6,951 -
Joined
-
Last visited
-
Days Won
2
Everything posted by premiso
-
A month or so ago, thanks.
-
Not sure, but I am pretty sure that "\r\n" need to be in double quotes in your last $headers .= statement, like you have it above. At least that is the main error that sticks out at me.
-
I would think that if another program is using it it should "lock" the file or set it to readonly. But I do not know how dreamweaver works. But why did you not state that in the first place? You need to be alot more clearer on exactly what you want. Even your 2nd response is vague. Please be more elaborate and descriptive. I could write solutions, but I do not want to write 50 when you only need one. Right now I am guess/assuming what you are asking.
-
Haven't we gone over this like 3 or 4 times before? No, it just escapes it so it will not show up like \' in the DB. As long as magic quotes are turned off and you are not double escaping it. EDIT: Saw the stripslashes post. No, you should never use stripslashes on data coming out of a database. If you have to, it means you did not insert it properly/double escaped it. Read up on Magic Quotes as that is usually the cause of double escaping. I suggest it to be turned off.
-
I think he meant like this bud. echo '<div id="bldlvl' . $i . '" style="background-color: yellow; width: 100%; clear: both; border-top: 1px gray dashed; display:none;"><p>' . $aftermath->listings('buildings',$i,'edit') . '</div>'; To actually use the function to print it out, not print the function to the screen. As far as "buildings" and "edit", I think you want them encapsulated in quotes. So i took the liberty to do that, but I may be wrong. EDIT: Neil beat me to it, oh well
-
*ehrmmmemmmrmmm clears throat erhmhmmmm* Wow you must really be hurting to post something huh? lmao. That is just too funny. Yes, I know they are faster. In order to see a difference, however, you have to loop through about 50,000 rows to get a benchmark that you would even be able to notice a difference. But notice, I did not say "more efficient" only "A bit cleaner with less code".
-
You would select it by however you would determine the same event, then order it by date and pull the first date then the second date and use that to determine the time intervals. You can use MySQL to determine that with it's built in date functions (google DATE MYSQL for more information on them). Hope that helps a bit.
-
Error log crashing server due to file size?!
premiso replied to your.syndrome's topic in PHP Coding Help
Try it. As long as your host allows for that it should work. -
Error log crashing server due to file size?!
premiso replied to your.syndrome's topic in PHP Coding Help
Find that in your php.ini and turn it to "off". You may even be able to do this with .htaccess as long as the server allows it. Or follow what was posted above to to clear it out. -
It should, you would access it with $_GET['rrn']
-
Neil hit the nail on the head. However you do not "need" the hidden input. <input type="submit" name="submit" value="Submit" /> </form> That would allow your original code to work. You just were not defining a name for that submit button so it was never populating the $_POST['submit'] data..
-
Yes there is......lol.....pray that your laptop never breaks again! >
-
I am not trying to get into a pissing match at all. But in all honesty, the code you gave him is just poor code. Why do 3 ifs like that, when you can do if/elseif/else ? Even to try and "show", you still should show them the proper way, not some hodged podged way that only a newbie would use (sorry no offense intended). if ($user == 'admin') { header('Location: http://www.whatever1.com/'); elseif ($user == 'client') { header('Location: http://www.whatever2.com/'); }else { header('Location: http://www.whatever3.com/'); } exit; You also left off quotes around the variable checking, which does throw a NOTICE undefined constant error (not major but it is better practice to encapsulate the non-constant string in quotes). Like I said, my intentions were not to put you down. Another variation, just because I feel like it, is they could also use a switch: switch($user) { case 'admin': header('Location: http://www.whatever1.com/'); break; case 'client': header('Location: http://www.whatever2.com/'); break; case 'guest': default: header('Location: http://www.whatever3.com/'); break; } Now granted my initial way, I prefer to do cause it is easier for me, and I do understand that it can be confusing for a new user and yes I probably should of just written an else/if or a case/switch instead. It seems like you were more worried about being #1 to post than posting the proper method. I do that too. Just kinda making you aware of it. Showing them improper coding does not help them, just like me posting way advanced stuff that they might not understand.
-
What was that? almost 2 weeks for a loose wire, wow. That is lame. As long as it works though, at least you got a working laptop back!
-
Ok here is the low down. Read and read carefully. POST data is stored on the users browser. The only way to clear it is to redirect them from the page that uses the post data to another page. So let's say I have pageSubmit.php which posts data to postProcess.php In the postProcess.php I need to use the header and redirect the user to a thankYou.php page. Doing this redirect will clear out any post data in the browser. That is the straight forward logic. Now, can a user's browser have a functionality to save post data and re-fill it in? Sure can. Make sure that is not what is happening. As long as you are not storing any of it in sessions, and you do the header redirect after the post data was processed this should wipe out any and all post data so if the back button is pushed it does not ask to re-submit the page.
-
Anyone can learn ActiveX, sadly enough. As arrogant as it sounds, if person A is dumb enough to install something without knowing what it is, I have no mercy for them. This is why I setup my parents computers and I train them on how to properly use it. Mainly because I hate cleaning up on spyware. Now anytime something pops up to install they call me up and ask me if it is ok. I know not everyone has that, and it is just me being arrogant. But if you do not want to get taken advantage of on the computer/internet you have to put forth some effort and learn how to use it properly. 90% of people are too lazy to take that time to ask someone, hire someone or to even pay attention on how to. As far as this being a "hacking" attempt, could be. It could be legit that he is on an intranet and just wants to allow people access. Either way, if he is dumb enough to try this as a "hacking" attempt, let him try and fail. If he wants to put forth the effort to make an ActiveX control just to try and "hack" people, well more power to him. Just when he gets caught, which chances are pretty high as he seems to not know the first items of how to do any of this, at least then he is fined/behind bars. It is the ultimately the end-user's responsibility to educate themselves and protect themselves. His "hacking ploy" will only work if they explicitly allow it. (end rant).
-
That is very redundant. $levelRedirect = array("admin" => "http://yoursite.com/admin", "user" => "http://yoursite.com/user", "guest" => "http://yoursite.com/guest"); if (!in_array($userLevel, $levelRedirect)) $userLevel = "guest"; header ('Location: ' . $levelRedirect[$userLevel]); A bit cleaner with less code
-
Is there a way to replace a string...<h1>(unknown characters)title</h1>
premiso replied to atticus's topic in PHP Coding Help
Ok slow down there big shifter. It can be solved, but you are adding stuff to it by the minute. First it was a simple <h1> and then it is <h1><a href> and now it is <h1 class>. Here are some guidelines I suggest you follow when creating a topic. 1. State the problem clearly: I want to replace the title that is contained within <h1> tags, where the h1 tag can have attributes and there is the possability of inner tags also being inside these tags. 2. Show an example(s) of different data with desired output: For example: <h1>This title</h1> should be <h1>replaced title</h1> <h1 class="bob">this title </h1> should be <h1 class="bob">replaced title</h1> <h1><a href="thispage.php">this title</a></h1> should be <h1><a href="title.php">replaced title</a></h1> 3. Show what you have tried: I have tried using str_replace here is some code. I do not think preg_replace will work, but I do not know enough about regex to make it work: <?php $string_replace = str_replace($title, 'another title', $buffer); ?> I would appreciate any help. That is a much better mock up, as giving your original post this was solved. Now before I go hog wild on helping you any further with regex answer these questions for me: Do you know the title you want replaced? Can you find that out at all? This is important as it can be very helpful to solving your issue easier. Is there more than 1 possibility of <h1> being on the page? Let me know and I will post on items that may help you/solve the problem. -
Is there a way to replace a string...<h1>(unknown characters)title</h1>
premiso replied to atticus's topic in PHP Coding Help
<?php $string = "Replace this title <h1 class>Title</h1> <h1>heretoo</h1>"; $replaced = preg_replace("~<h1(.+?)?>(.+?)</h1>~s", '<h1$1>test title</h1>', $string); echo "Original: " . htmlentities($string) . "<br />"; echo "Replaced: " . htmlentities($replaced) . "<br />"; ?> preg_replace will work because it suits/uses patterns, str_replace is the simple one. Try the above and see what happens. -
Sessions have nothing to do with it. Unless you explicitly the the sessions. If you do set the sessions: foreach ($_SESSION as $key => $val) { unset($_SESSION[$key]); } Will remove any item from session. The header redirect to the thank you page should clear out all post data, using that function before the header call will also remove any session data. EDIT: If you use sessions for checking logged in, this will essentially log them out, so you may have the few session variables that need to stay in an "exempt" array and as long as $key is not in that array you are good.
-
They will allow it to run on their pc if the end user let's it. Simple as that, if it really is legit, people will know to allow it and the source is trusted. If not they will just deny the Activex controls.
-
"Can you do *insert thing*?"
-
It would be an ActiveX Control that the end user calling the page would need to allow to install. Look into those if this is what you want to do.
-
[SOLVED] creating a php script to log everyone off by CRON JOB
premiso replied to wmguk's topic in PHP Coding Help
Yep, you just have to look into mysql and shell scripting.