joel2k8
-
Posts
22 -
Joined
-
Last visited
Never
Posts posted by joel2k8
-
-
Yeah.. the problem is solved, as i said in my last reply, i accidently put my text in the quote.
thanks again for the help.
-
Hmm.. nevermind it was me using getting text from an XML file and using it as the string to search.. still don't understand why that would stop it from working..
thanks for helping anyway!
I got it to work, before the code was:
strpos($filecont, $name)
I changed to:
strpos($filecont, "$name")
Now it works how it should, but for some reason i would of thought it would work with out the " ".
Nevermind, thanks for the help, problem is now soved!
If you still can't get it to work, posting example data would help.
-
Hmm.. nevermind it was me using getting text from an XML file and using it as the string to search.. still don't understand why that would stop it from working..
thanks for helping anyway!
-
Yes, i just want to see the string exist and if does do something.. though the code you gave me doesnt seem to work, but it is a php file that i am getting the information from:
test.php
<a href="http://google.com/">Google</a> bhjb njkm, knklmnnkl hello <a href="#">test</a> <a href="http://google.com/">Google</a> <a href="http://google.com/">Google</a> <a href="http://google.com/">Google</a>
then i try and check to if it exists by using:
$old = 'hello'; $filename = 'test.php'; $file = file_get_contents($filename); if(strpos($file, $old)) { //string exists }
it doesn't seem to work, does it have to be a txt file? i can write to the php file but can't seem to find the string..
thanks
-
Hello,
Okay for some reason i cannot do this, when i open a file in php and search for string, it doesn't seem to work, some codes i tried:
$filename = 'example.txt'; $searchfor = 'hello'; $fh = fopen($filename, 'r'); $olddata = fread($fh, filesize($filename)); if(strpos($olddata, $searchfor)) { //fount it } else { //can't find it } fclose($fh);
(above it just sample text, i was hoping you could give me sample code that will work)
I tried many others like strstr, stristr, preg_replace etc etc, doesn't seem to find it.. this is my text file:
sdfsdfsdfsdfsdf[b]hello[/b]sdvsdf dfadfsdfsdfsddfsdf sdfsdfsdfs sdffffffffffffffffffffdv vsvdsdsf
I don't want to find it by line, i want to simply open the text file and find the string..
thanks..
-
Alright well Hello,
I currently have a table that shows a background image and I have 1 TD with 100% width and height and in that TD I have a DIV that moves by margin-left and margin-top via JavaScript and the height is approx 20px by 20px, so basically I have a map with a character that moves when keys are pressed.
My problem is I'm having trouble setting limits (where the character cannot go inside the TD). etc if it reachs a X and Y then it would stop, but it's not that easy, I currently have this in a IF function when the keys are pressed:
var x; var y; var exclude = { x: [50, 50, 50, 50, 50], y: [50, 60, 70, 80, 90] }; if (exclude.x.indexOf(x) !== -1 && exclude.y.indexOf(y) !== -1){ // dismiss } else { //run main code.. }
But that code doesn' work correctly because I want the numbers in exclude.x to match the oppisite of exclude.y so 50 and 50, 50 and 60 but instead its like this 50 and 50 or 60 or 70 or 80 or 90.
I just want it to be set so it matches the number...
x: [1, 2, 3, 4, 5], y: [1, 2, 3, 4, 5]
Hope you can help I've been having trouble for awhile now, thanks.
-
Well hello everyone,
What I am trying to do is update a query using time or date instead off using Cronjobs.
Like if I want to update a query every 5mins what would be the best thing I could do?
I have tried things such as:
if ((date('s')) == 300) { mysql_query("UPDATE users SET money = money + 1000"); }
Yes it does work accept you have to refresh on the exact time to get the money, but I want to update the users without everybody refreshing because if they don't refresh it wont update :-\
I have tried different things but I'm not good when it comes to time and date.
Any suggestions?... thanks if you help me out
-
hello everybody,
If your in to RPG Games then this is the best place to look, me and the other owners off this game are really helpful and we are very supportive, this is a really good RPG Text Based game, you wont turn back.
Please Review and I hope you stay!
-
-
right so.. use the variable and incrment it once the pop has been fired once.. thus tell it not tofire anymore
example
x=0;
if(x==1)
{
DON"T FIRE THE POPUP
}
else
{
FIRE THE POP UP
x++;
}
//now x=1 and will not fire the pop again see
So how would i put that in my code, I just tried to understand what you mean, but I'm getting no where, if you could re-arrange the first code i posted then that will be a big thanks, sorry if I'm annoying.
-
well let me just explain it a bit more, my website is a RPG text based game and there is a file called header.php which is controlling all the images and all the pages, like on my mailbox.php it would say at the top:
include "header.php";
now if there is a user wondering around the site i would want a pop up message on any page saying "they have 1 new mail" because another user sent them a mail, but it just keeps showing the message not unless the user sees the message that they sent, which is i only want the message to appear once, even if they havnt read there mail, I just want the message to appear once not on every page they click on, hope you understand what i mean.
-
Its not working for some reason, it just keeps popping up on every link i click, Well I think ill find away around it adventurely, Thanks anyway!
-
well i just tried it and the pop up still keeps showing when i click on any link, etc if i click on a link the pop up will pop up and when i click "OK" and i go to click on another link the pop up will come up again, but if they read there mail the pop up will not pop up, what i want is when they have a mail the pop up box only shows once
-
OK, I will try it now, thanks
-
Well I need some help, I have a little JavaScript in my header file, Like if someone gets a mail it will pop up the box and if they do not click on "Mailbox" on the side menu they will keep getting the pop up message on every page they click on, what i want to do is when they get a message the pop up message only comes up once and they can click on any page without getting a pop up message and without clicking on mail, I just want to alert my users that they have a Mail, here is the script i use so far:
if ($ir['new_mail'] > 0) { echo '<script> alert("You have 1 new mail!") </script>'; }
I want to stop the pop up box keep coming up, I would only want it to come up once,
Please Help, Thanks!
-
Ok, Im looking for someone that would code me a PHP file for $6.00
This file is for a Game, The link below is a Game, I want the PHP File off that Game,
You might need to sign up for it, To see it
http://jaillords.com/viewuser.php
I've got a game and my PHP File is Different, I want some one to Re-Code my PHP, To look exact like the One Above, I will give you my viewuser.php, And then you can make it like this one http://jaillords.com/viewuser.php,
I've tried doing it myself but its to hard, Many Thanks if someone wants to do this, Thanks
-
Ok, That worked fine, Thanks alot haku
-
Ok thanks for that But I want it in My Form that I posted, I've just tried it, In my form and it Wasnt working
<form method="get" action="searchname.php"/> <input type="text" size="13" name="name" value="User Search" class="SearchField" /> <input type="image" src="images/search.png" name="go" alt="go" class="go" title="go" /> </form>
Thats the Form i would want it in :/
Thanks Anyway
-
Ok Sorry, I'll try and Explain the Hard Way
What i want to do is, When a Person goe's on my Website and See's my Text Box (Form)
They would already see writing in the Text Box, Because Thats what I put in My Code (value="User Search")
This is what i want to do,
When a Person Clicks the Text Box the Writing Dissapears, It just takes it away and then you can write in what you want, But what it doe's now is when a Person clicks the Text Box, The writing Doesnt go away, I want it automatically go away when a person Clicks the Text Box,
Now do you understand, Sorry About first Post, I was in a Hurry :/
-
Anyone no the Code?
-
Hello People,
Im having trouble with my php form, It works and everything
The thing is that i want to do, Do you no the Text Box, Its automaticaly got text in the box, But i want it so when a person clicks inside the text box, The text dissapears, Please Help, Thanks
Heres my form:
<form method="get" action="searchname.php"/> <input type="text" size="13" name="name" value="User Search" class="SearchField" onfocus="if(!this._haschanged){this.value=""};this._haschanged=true;" /> <input type="image" src="images/search.png" name="go" alt="go" class="go" title="go" /> </form>
The value makes it so theres already text in the box, But i want it so when a person clicks the box the text dissapears, Thanks
PHP Socket Server Help!
in PHP Coding Help
Posted
Hi I recently created a socket server in PHP and a client in actionscript, what the client does is send the X and Y and there ID to the server and then the server sends it back to the clients connected, my problem is it works but the X and Y start messing about and it duplicates sometimes, i'm pretty sure it is to do with the PHP server, this is my code:
Server:
This is my ActionScript 2, but I'm pretty sure this is not the problem:
If you are good with sockets and such then you should easily be able to spot the problem on why it's buggy, I cannot see what is wrong and really need the client and server to communicate properly.
It's OK when you connect alone, but when someone else joins it will start being glitchy and not going to the correct X and Y and then there will be duplicates and such..
If you do not understand I will try and get a demo up and show you what I mean.
Thanks.