-
Posts
14,780 -
Joined
-
Last visited
-
Days Won
43
Everything posted by .josh
-
really? I see. So I guess when you were searching for "chat room scripts" you took a wrong turn, wound up here, and thought "Hey, I'll make a post here?" I suppose I'm being somewhat of an ass here, but you have to admit that asking a general question like "yeah hey, anybody know where I can find blah script..." just begs for it.
-
[quote author=Daniel0 link=topic=121991.msg502505#msg502505 date=1168545596] Edit: Crayon, I thought rude comments about searching the web/on Google was not allowed ;) [/quote] I don't consider it any more rude than invoking R T F M. I didn't make the acronym up.
-
[url=http://www.google.com/search?hl=en&safe=off&client=firefox-a&channel=s&rls=org.mozilla:en-US:official&hs=ORQ&sa=X&oi=spell&resnum=0&ct=result&cd=1&q=chat+room+scripts&spell=1]STFW[/url]
-
in your validation script, start a session and create session variables for the form values. On your form page, also start a session and include the session variables as the value of your elements. If the session variables do not exist (as in, first time to the form page, not filled out, etc..) then it will simply show up as blank. Example (I even threw in a bit of custom error messages): form.php [code] <?php session_start(); // if there are errors... if ($_SESSION['error']) { // for each error... foreach($_SESSION['error'] as $error) { // echo out the error echo "$error <br />"; } // end for each error // unset the error array so that if user messes // up more than once, it won't keep stacking errors unset($_SESSION['error']); } // end if there are errors // if there is info if ($_SESSION['info']) { // for easier var handling... extract($_SESSION['info']); // no need for this session var anymore unset($_SESSION['info']); } // end if there is info // echo out the form, using the user's info as values // if there is none, it will simply be blank echo <<<FORMENT <form action = 'validate.php' method = 'post'> Name <input type = 'text' name = 'username' value='$username'> <br/> Something <input type = 'text' name = 'something' value='$something'> <br/> <input type = 'submit' value = 'submit'> </form> FORMENT; ?> [/code] validate.php [code] <?php session_start(); // if vars are posted... if ($_POST) { // for easier variable handling... extract($_POST); } // end if posted vars /* if nothing was posted, or page was directly accessed all error messages will be generated, user will be kicked to form and all messages will be displayed */ // check if username filled out if (!isset($username) || trim($username) == '') { $error[] = "name not filled out"; } // end if name not filled out // check if something filled out if (!isset($something) || trim($something) == '') { $error[] = "something not filled out"; } // end if something not filled out // if an error was generated... if($error) { // create a session var to carry the posted vars back to form $_SESSION['info'] = $_POST; // create a session var for error messages to display on form $_SESSION['error'] = $error; // redirect back to form header('Location: form.php'); exit(); // end if errors } else { // form filled out successfully. Do something here like echo something. echo "thank you for filling everything out, or whatever."; } // end if form filled out successfully ?> [/code]
-
or use single quotes instead of escaping double quotes [code=php:0] echo "<img src='x.jpg' width='20' height='20'>"; [/code]
-
the way you are doing session vars is depreciated. instead, do it this way: page1.php [code] <?php session_start(); $_SESSION['blah'] = 'something'; header('Location: page2.php'); exit(); ?> [/code] page2.php [code] <?php session_start(); if ($_SESSION['blah']) { echo $_SESSION['blah']; } // end if session var exists [/code] you do have this part right tho, as far as killing a session: [code] session_unset(); session_destroy(); [/code]
-
blam! http://www.breitbart.com/news/2007/01/10/D8MIN5CO0.html
-
Really? I didn't come across any posts that said that. Granted, I was researching into the wee hours of the night on this, so I may have missed a sentence or 2... I'll go back and re-read the posts. Or if you feel up to it, possibly you could provide some quotes or something?
-
Finally, something you have said that actually makes sense..
-
yea..other than the fact that it will probably cost like $5,000 for the phone, $500 a month (not counting the $20 a minute internet surfing charge), it looks pretty nice.
-
Can you be more specific? What is this "smart dose" that which you speak of? Are you asking how to do an if statement? [code=php:0] if (condition) { // condition is true } else { // condition is false } [/code]
-
i agree with redbull: if this is a recent thing and you haven't made any changes/installs, the first thing I would do is a virus scan.
-
Man, I've been researching and experimenting with this for hours and nothing seems to work. I can tell you some things I've learned about this stuff though: [code=php:0] $com = new COM("powerpoint.application") or die('Unable to instantiate PowerPoint'); [/code] This returns an overloaded object. If you don't know what that means, basically it means that if you make a call to an undefined property or method, you can assign a "wildcard" method or property to handle it. Now, this line here: [code=php:0] Reflection::export(new ReflectionClass($com)); [/code] as you probably know, calls a method in the reflection class, passing as its argument an instantiated reflectionclass object (which actually extends the reflection class, btw.) Perhaps an easier way to read it would be like this: [code=php:0] $blah = new ReflectionClass($com); Reflection::export($blah); [/code] or better yet, since ReflectionClass extends Reflection, you could do this: [code=php:0] $blah = new ReflectionClass($com); $blah->export($blah); [/code] Now, as to your problem of it not showing $com's info: The class you actually want to be using is ReflectionObject, not ReflectionClass. ReflectionClass reverse-engineers a class, but $com is an (overloaded) object. But guess what? Every time I tried to do this: [code=php:0] $com = new COM("powerpoint.application") or die('Unable to instantiate PowerPoint'); Reflection::export(new ReflectionObject($com)); [/code] Apache crashed on me. Don't know why or how or what. It just kapooted. According to the manual, it should work. My research into why it was crashing has come up blank. I then tried this alternative: [code=php:0] $com = new COM("powerpoint.application") or die('Unable to instantiate PowerPoint'); // get properties of object print_r(get_object_vars($com)); // get methods of a class: manual says you // can use an object instead of a class name for this print_r(get_class_methods($com)); [/code] But still no dice! The manual also claims that you can loop through a COM object's stuff with a foreach or a while loop, like so: [code=php:0] $com = new COM("powerpoint.application"); foreach ($com as $obj) { echo $obj->Name . "<br />"; } // or... $com = new COM("powerpoint.application"); while ($obj = $com->Next()) { echo $obj->Name . "<br />"; } [/code] still no dice! I still get all kinds of errors thrown at me! I know that the $com object is indeed call powerpoint (well actually, I used word.application, but whatever). For instance, I can do this: [code=php:0] echo $com->Version; [/code] and it will print out the version. I can also go to my task manager and it will indeed show a Word process going on. (btw: don't forget to do $com->Quit(); I conveniently forgot that line in the beginning and I had like 30 instances of Word running before I realized it, LoL). I have searched and searched and searched and I'm starting to come to the conclusion that retrieving a list of properties/methods of a COM object is impossible with php. You have to know ahead of time that info. I don't see why you shouldn't be able to get it, but I just can't find anything. I suspect that it may have to do with the fact that it's an overloaded object. I can kind of sort of picture in my head how it's kind of sort of impossible to come up with a list of methods/properties for something that kind of sort of has variable/infinite methods/properties, due to it being overloaded. Does that make sense? I think it might somehow be throwing itself into some kind of infinite loop and well..that's why apache crashes. But I can't confirm it. It's just my half-baked theory. LoL, I want to get to the bottom of this. I have learned a ton about COM and Reflection from this venture :)
-
well, you know...curiosity...
-
Look hvle, you are obviously missing the point. The point is, I don't care how stupid your question was, you are not allowed to remove the content of your posts and ask for them to be deleted. Had you bothered to read the FAQs, rules and other random posts around here about this very subject, you would have known it. Don't get mad at me just because you have failed to take responsibility for your foobar moment. You've been here for about 6 months and have made almost 500 posts. You should know the rules by now, so I will not apologize for my warning to you, nor will I accept your half-assed sarcasm. Grow up.
-
...or the old lady who sued McDonalds for giving her hot coffee.
-
yes, what do you mean when you say "it's not executing." are you getting your die message? If so, change it to this: [code] $rs = mysql_query ($sql, $con) or die ("query: $sql <br/>" . mysql_error()); [/code] look at the query string that is actually being sent. maybe you'll figure out a mistake from it. Or look at the error; maybe you'll figure out the mistake then. If not, please post that stuff here.
-
Or better yet, how about being in the middle of driving and you hear your cell phone go off. I think it's bad enough when people drive and talk. Now just imagine when they reach for their phone but grab their taser instead and <ZAP!> Causing them to <CRASH!> into some other car and uh, kill them or just slightly maim them, or whatever.
-
I zapped myself with a taser once...
-
no. People came here and asked questions and then later thought to themselves that their post made them look bad, so they deleted them. We would rather people learn that if asked properly, there is no such thing as a stupid question.
-
well your browser reads top to bottom, left to right, so it displays your javascript before your webpage, because you have your javascript before your webpage. you can: a) Move the javascript down to the bottom of the page, after the rest of your content b) leave it at the top but wrap it in a function and then call the function down at the bottom, after your content c) include the js alert box script inside an onload attribute in your body tag like so: [code] <body onLoad="javascript:alert('Contact The Management Office')"> [/code] p.s.- moving to javascript forum.
-
No, as in, nobody can help you. Why? Because you've posted a vague, grammatically incorrect question, and have supplied no code. I suspect that English probably isn't your first language, so I don't necessarily fault you for that. But you need to try a bit harder to explain your situation and post some code.
-
do you know anything about php? Not meaning that in an offensive way. If you don't (and I suspect you don't, because most of what you wish to do here is beginner stuff), you're going to have to start with the basics, before undergoing a project such as that. Once you learn the basics (like syntax, basic sql, etc..) then you can move up to doing some regex to extract the data from the site and put it in your db. You have to learn to crawl before you can learn to walk.