Search found 16 matches

by kasuals
Tue Aug 16, 2011 12:09 pm
Forum: PHP coding => General
Topic: Adding offsite plugin to php page prior to page loading
Replies: 3
Views: 500

Re: Adding offsite plugin to php page prior to page loading

If you are trying to execute Javascript before the PHP page has loaded, then I'm sure you're out of luck without AJAX or output buffering. Try something like this: <?php echo '<script type="text/javascript">alert("1");</script>'; flush(); sleep(5); echo '<script type="text/javascript">alert("2");</s...
by kasuals
Tue Aug 16, 2011 8:59 am
Forum: Your Scripts
Topic: class variable erro
Replies: 1
Views: 1522

Re: class variable erro

Old thread, but I'm bored so:

isset — Determine if a variable is set and is not NULL

http://www.php.net/manual/en/function.isset.php

All it is doing is making sure that $msg is not empty, and if it's not empty that print $msg.
by kasuals
Tue Aug 16, 2011 7:51 am
Forum: PHP coding => General
Topic: Display special characters
Replies: 2
Views: 848

Re: Display special characters

Thanks I have now tried chr("✔") Don't get an error but it comes up blank even when trying out different codes, any more ideas?? I am really struggling with this Multi-byte conversion is used to convert character encoding from one type to another: http://www.php.net/manual/en/function.mb-con...
by kasuals
Tue Aug 16, 2011 6:46 am
Forum: PHP coding => General
Topic: Code Help For Newbie
Replies: 0
Views: 428

Re: Code Help For Newbie

if (mysql_num_rows($result)) { $row = mysql_fetch_array($result); $x1 = $row['URLKeyword']; $x2 = $row['catid']; I haven't touched my coffee yet this morning -- so I'm just going to point you in the direction. You will need to return the query in the form of an array before attempting to access it ...
by kasuals
Tue Aug 16, 2011 5:51 am
Forum: PHP coding => General
Topic: Display special characters
Replies: 2
Views: 848

Re: Display special characters

chr("&#10004;")

Haven't executed your code, but I know chr will need that in quotes.
by kasuals
Tue Aug 16, 2011 5:14 am
Forum: PHP coding => General
Topic: Reference to Instance Variable
Replies: 1
Views: 578

Re: Reference to Instance Variable

No problem, I used to think of them as pointers too.
by kasuals
Mon Aug 15, 2011 6:51 pm
Forum: PHP coding => General
Topic: Password Protected Web Page
Replies: 0
Views: 415

Re: Password Protected Web Page

Depends on how it's implemented. If the username and password are passed from a webpage form then you can just search for the username and password function and disable them with comments. If the page is hosted on an apache webserver and it's an .htaccess file, you just need to move it to something ...
by kasuals
Mon Aug 15, 2011 5:48 pm
Forum: PHP coding => General
Topic: Reference to Instance Variable
Replies: 1
Views: 578

Re: Reference to Instance Variable

I'm assuming you want an array of references to arrays, and able to modify the array selected by reference. I'm pretty sure you just need to pass $arrays[$frame] by reference after building $arrays. I gutted your code a bit: <?php class myClass { private $_content_html = array('test' => 'TESTING', '...
by kasuals
Mon Aug 15, 2011 5:22 pm
Forum: PHP coding => General
Topic: Radio Buttons and Mail()
Replies: 0
Views: 419

Re: Radio Buttons and Mail()

Have you tried $_POST['legalwork'] instead of $_REQUEST?
by kasuals
Mon Aug 15, 2011 5:14 pm
Forum: PHP coding => General
Topic: Need help grabbing info from other server
Replies: 0
Views: 428

Re: Need help grabbing info from other server

Code: Select all

$content = file_get_contents("http://uberstrike.cmune.com/Profile.aspx?cmid=563853");
...
regex function to iterate through stats here
...
profit
by kasuals
Thu Aug 11, 2011 6:40 pm
Forum: PHP coding => General
Topic: Class/Object levels (resolved, typo)
Replies: 2
Views: 544

Re: Class/Object levels (resolved, typo)

I figured it out. self::$Instance->LogFile will work, when I rewrote it in the post I had missed the > in my code but got it right in the example. Hooray for syntax blindness.

I feel stupid. Thanks for your help anyway.
by kasuals
Thu Aug 11, 2011 9:02 am
Forum: PHP coding => General
Topic: decoding Chinese characters from URL?
Replies: 0
Views: 466

Re: decoding Chinese characters from URL?

I'm assuming by the age of the post, that Google has another satisfied customer.

If you still haven't found a resolution, is this basically what you were looking for?

http://www.php.net/manual/en/function.m ... coding.php
by kasuals
Thu Aug 11, 2011 8:35 am
Forum: PHP coding => General
Topic: php regex help!
Replies: 11
Views: 1110

Re: php regex help!

patrik123 wrote:haha ok nice!

I didn't see you used preg_match instead of _all.. so thats solved now :)

Still don't know what \w and /i is though.. searched google but it doesn't give good results with answer.. :(
\w indicates match to a word.

/i is a mode and makes the REGEX match case insensitive.
by kasuals
Thu Aug 11, 2011 8:04 am
Forum: PHP coding => General
Topic: 3 page form submits on each page
Replies: 1
Views: 384

Re: 3 page form submits on each page

Unless something has changed, I don't believe PHP can reliably execute code when a page is closed. I've always had to use JavaScript to handle an OnClose event. This could have changed in the last few releases. *Edit* My workaround back in the day was to hide the variables in the XHTML after the PHP...
by kasuals
Thu Aug 11, 2011 7:20 am
Forum: PHP coding => General
Topic: php regex help!
Replies: 11
Views: 1110

Re: php regex help!

Without actually writing out the REGEX myself, give this online tool a try:

http://txt2re.com/index.php3

It's lazy, and I don't usually advocate using it too much since you don't learn anything.
by kasuals
Wed Aug 10, 2011 11:04 pm
Forum: PHP coding => General
Topic: Class/Object levels (resolved, typo)
Replies: 2
Views: 544

Class/Object levels (resolved, typo)

I've written my own ErrorHandler class that extends a LogHandler. I've used the Singleton design to keep anyone from attempting to create more than one ErrorHandler object. (In my program, ErrorHandler::Kill() should have been called by me anyway.) So here's the code I'm using to test to see if the ...