AV1611
-
Posts
997 -
Joined
-
Last visited
Posts posted by AV1611
-
-
<?php $ctx = stream_context_create(array( 'http' => array( 'timeout' => 1 ) ) ); if(false === $str = @file_get_contents("http://example.com/", 0, $ctx)){echo 'Link Down';} else {echo $str;} ?> Well not sure if that's the best way to do it but it seems to work? I'll know for sure when the link comes back up
-
ok, that works good... now...
Here is the error I get when the link is down:
Warning: file_get_contents(http://DOMAIN.com/aaoxml/PortalClanStats.php) [function.file-get-contents]: failed to open stream: HTTP request failed! in /var/www/web2/web/indexnew.php on line 488
What I need now is instead of the error I get for it to just give me 'Link Down' if it's is "false"...
Help?
-
I have a website that pulls some data from another site with file_get_contents();
It works great ... most of the time... but when the site I'm pulling from goes down (rarely) then my script hangs for a very long time...
Is there a way for me to put ...say... a 10 second time limit on the file_get_contents() so it's just returns null or error or whatever then the rest of the page will load like normal?
Thanks.
-
haven't done it yet, but I already know implode will fix it thanks... I just forgot how to make it wokr
-
what am I doing wrong?
$LIST[0]=1; /for demonstration purposes
$LIST[1]=7; /for demonstration purposes
$result=mysql_query(select * from table where field IN $LIST);
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Array' at line 1
-
background-attachment: fixed;
-
how do I make a div container scroll and the background remain stationary?
-
I wasn't sure if it was a css issue or if it was simply calling a certain type image file via normal html so I went here. sorry.
I'll check out your answers and let you all know how it all turns out
-
Don't really how I get this done...
I have a nice background image on a site. I have a div centered over the background for content. simple.
I want to make the background color of the div be "opaque" so it looks dark but I can still kinda see the background image.
I want it to work in Mozilla & IE
1. possible?
2. How?
opaque gif doesn't seem to work
-
I'm not as good as many around here but I'd be more than happy to help out. PM if you want my contact info. As for JS, PHP is only limited in that it doesn't do client side so JS seems to be needed in a few rare cases...
-
I did this: http://www.phpfreaks.com/forums/index.php/topic,221929.0.html
and it's working fine now.
Now, here is the change I made:
Rather than having the smileys in the table under the shoutbox I put the table in a separate popup page. the hope is it works the same. the actual question is what do I have to do to make the img click apply back to the original page?
main page snippet:
<script type="text/javascript"> function insertSmiley(smiley){ var txtarea = document.getElementById('smileytext'); txtarea.value = txtarea.value+smiley; } </script> <script type="text/javascript"> function popitup(url) { newwindow=window.open(url,'terms','height=500,width=750,resizable=yes'); if (window.focus) {newwindow.focus()} return false; } </script>
popup:
<img onclick="insertSmiley('');" src="Smileys/grin.gif" alt="" />
-
I have spent the past few years trying to get proficient at PHP. I have gotten to the point where I can do most anything I need to now (albeit the code isn't always pretty ). I have avoided JS like the plague cause I don't like it. PHP is much easier to learn IMO.
Anyways, can I get a few suggestions for a complete noob. I am a quick learner but I am slow to get "traction" in the beginning until the light "clicks" if you know what I mean...
Thanks.
-
that is SOOOO cool...
-
<form method="POST">
<textarea></textarea>
<input type="submit" value="Shout!" />
</form>
then at the bottom a simple table with
<td><img.... /> :somecode: </td>
and so on.
The code and image are simple replace when the text is displayed. all posts are in database table, and all img name/code are in a table.
that's it.
-
Thank you so very much. I feel impotent. I just have no idea what to do with the code sample you provided. I don't even know JS just php.
Unless a kind person wants to help me understand how to implement the answer I'll have to go away... sigh...
-
1st, I know PHP and NOT JS!
I have a shoutbox I wrote in php. It works great. when the user does : P for example they get .
The bottom of the box is a textarea
Below the shoutbox is a table with every smiley and code in a td cell.
Now, the question.
I want to make it so if you click a smily image below it shows up in the textarea above.
No clue where to begin, but I 've seen similar before.
Help, and be gentle
-
I hate to tell you but if he's putting a file on your server then you've been compromised. You need to reinstall from scratch. Period. You MIGHT get lucky with a rootkit but prolly he's got crap in your system. It could be something like the ls command for example been patched to recreate or whatever.
You're screwed.
1. Linux or Winblow?
2. Virt domain or host domain?
3. Your server or hosted?
-
My way would work but Barand is sooo much smarter than me
Do it his way
Hey Barand! Long time no see!
-
I really suck at dates myself.
If I understand you want to search for a given month? or loop through each month. If the latter, that's separate I think.
Either way, There are several ways I suppose but I would prolly determine the unix timestamp for the 1st day and last day of the month (midnight respectively) and add something like
"... WHERE field >= $monthstart AND field <= $monthend..."
-
Perfect... thanks...
-
date('Y-m-d H:i:s', $timestamp);
there's a hint
-
How would I open a text file and simple count the number of lines in it? I don't care about the content in the line or if there is a blank line. I need to just count the number of line returns in the file.
-
So,
You want to convert the hex AABBCC to decimal XXXYYYZZZ then take the last set and subtract 128 and see if it's a positive number or not?
<?php
var_dump(hexdec("See"));
var_dump(hexdec("ee"));
// both print "int(238)"
var_dump(hexdec("that")); // print "int(10)"
var_dump(hexdec("a0")); // print "int(160)"
?>
-
I've done a similar project before.
You REALLY need the spec for the device to tell it what it wants to hear.
I know in my case I had to do some binary/hex junk.
Are you sure it ONLY requires xml? Do you have the correct xml?
results display question
in PHP Coding Help
Posted
You create the <table> tag and the first row before the query then put the query then close it after the query