-
Posts
100 -
Joined
-
Last visited
Never
Posts posted by skatermike21988
-
-
Hello,
I have a community script that when a user is logged in it displays it on their profile, right now the only way for it to show them offline is to click the logout link. I want to be able to update the table and set online=0 when a user exits the website.
Any and all help is appreciated -
ok i'm just curious to if there is a way to pull data out of mysql if the row contains a word but is not a exact match.
What i am doing is making a search script for my site. And if someone search's for say BLAH and the row in the database contains Hi my name is blah. it will pull out that row. -
That worked, thank you very much
-
that is not in the script it is already removed..
-
Hello,
i am trying to find a way to hide this error
[code]
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in *****/index.php on line 75
[/code]
What i am doing is making a search form, the search works fine but when there are no results it comes up with error and displays this text i have it set to say underneath it:
[code]
Your Search Has Returned No Results
[/code]
so when nothing returns this is what i am getting
[code]
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in ***/index.php on line 75
Your Search Has Returned No Results
[/code]
All i want to display is the your search has returned no results -
This worked for me. It will display a random pic everytime the page is refreshed
[code]
$sql = mysql_query("SELECTphoto_id FROM photos ORDER BY rand() LIMIT 1") or die (mysql_error());
while($info = mysql_fetch_array( $sql ))
{
$photo_id=$info['photo_id'];
$data = mysql_query("SELECT * FROM photos WHERE photo_id='$photo_id'")
or die(mysql_error());
while($info = mysql_fetch_array( $data ))
{
$photo_source=$info['photo_source'];
Print "<td><a href='http://www.yoursite.com/displaypic?picid=$photo_id";
Print "&sid=$sid' target='_self'>";
Print "<img src='$photo_source' height='75' width='75'>";
}
}
[/code]
It pulls a random photo id from the database and then performs a query on that id pulling out the image source and displays a link with that id.
Hope this helps
**MODIFIED THIS CODE HAVE NOT TESTED** SHOULD WORK FINE THOUGH -
ok, i have solved this issue, now for the file that is copied, ok what it does is it takes that new folder that was created and stores it in a database, that url is specific to a registered user, now i need to get the page that was copied to when that url is typed in pull the data from the database from that url.
catch what i'm saying or is it confusing?? -
Ok, i have tried that code and these are the errors i am recieving, now i am not very familiar with this so i can't exactly go through and debug it myself but the errors are:
Warning: Wrong parameter count for fread() in /home/friends/public_html/test/set_url.php on line 51
Warning: fopen(../$url/index.php): failed to open stream: No such file or directory in /home/friends/public_html/test/set_url.php on line 52
unable to create the requested file -
Sorry i took so long for a reply, but here is my code:
[code]
$set=$_REQUEST[set];
if ($set=='url') {
$url=$_POST[url];
mkdir("../$url", 0707);
mkdir("../$url/include", 0707);
$file = 'http://www.friendshideout.com/test/copy/index.php';
$newfile = 'temp/index.php';
copy($file, $newfile);
$file2 = 'http://www.friendshideout.com/test/copy/include/db.php';
$newfile2 = 'temp/include/db.php';
copy($file2, $newfile2);
$file1 = 'http://www.friendshideout.com/test/copy/include/header.php';
$newfile1 = 'temp/include/header.php';
copy($file1, $newfile1);
$sql="UPDATE `users` SET `url` = 'http://www.friendshideout.com/$url' WHERE username='$username'";
mysql_query("$sql") or die (mysql_error());
echo "Congratulations Your New Url Is: http://www.friendshideout.com/$url";
}
[/code]
Hope that helps -
any idea why my php coding is turning into html once the file has been copied?
-
no errors are coming up
-
nope no luck :(
-
ok, i have it now where it makes the new directory and copies the file, but for some reason, my file is written in php but when it's copied it is becoming html
-
ok, i am wanting to make a script to create a new folder and copy a file over and have certain spots of the file edited to meet some specific things,
If anyone can atleast help me with the part of making the directy and having it chmod, and how to copy a file from one directory to the new one. I should then be able to handle it. -
Here is my code:
[code]
$sql="SELECT * FROM `fonts`";
$query = mysql_query($sql);
while($result=mysql_fetch_array( $query )) {
echo "<select name=font><option value='$result[font_name]'>$result[font_name]</option>";
}
[/code]
I have tried many things and so far it just display's the drop box but with no data. -
Hi guys i am workin on a script that includes gd, and the user can change their font and text displayed on their profile contact, well i am wanting to be able to insert the font names into mysql and have it displayed in a drop down box, this way when i add new fonts i don't have to go and edit my whole script.
I would also like for when a font is selected it will load the page that parses the gd next to the drop down and display's a preview.
ALL HELP APPRECIATED -
thanks worked pefect :)
-
I am working on a project of creating a community script, i am wanting to pull 2-3 random new or old people from my database useing mysql, kinda like myspace's "cool new people" and i am having a hard time getting it to work this is my code:
[code]
//Pull and Display cool peorple
$sql = mysql_query("SELECT display_name FROM users LIMIT 2") or die (mysql_error());
while($row = mysql_fetch_array($sql)){
$row_array[] = $row['display_name'];
}
$random_row = $row_array[rand(1, count($row_array) - 1)];
$data = mysql_query("SELECT * FROM users WHERE display_name='$random_row'")
or die(mysql_error());
while($info = mysql_fetch_array( $data ))
{
Print "<a href='http://www.profiles.friendshideout.com/?friendid=".$info['user_id'] . " ";
Print "&sid=$sid' target='_self'>";
Print "<img src='".$info['default_photo'] . "' height='75' width='75'>";
echo "<br>$random_row</a></td>";
}
echo "</tr></table>";
[/code]
When useing that code it is only pulling one person out and it is always the same.
Any help is appreciated. -
Thanks for the help guys i got it. pretty easy. didn't know there was a term for it. if i did it would have been one hell of an easier search :)
-
thank you will search. if i have no results i'll be back :)
-
I have googled for some time now and have yet to have found a answer to my question.
You know how on forums such as this one and in help desks etc. once you have reached so many replies it displays a link to go onto another page.
how do you do this.
i have searched and searched but have not found any results. -
Well what i am doing is i have a visitor tracking system and instead of it displaying the long url (like you would get if you searched yahoo, or google etc) for it to display the page title. the way i have it is it logs the user's i.p. how many times they have visited last time they have visited and referrer. and underneath it i have the top ten referrers but displaying a long link like:
http://search.yahoo.com/search?p=thescreenguy&fr=FP-tab-web-t402&toggle=1&cop=&ei=UTF-8
have it display the title of the page. -
ok how would i go abou cURL and the scrapeing with regex i am relatively new to php and am really trying hard to learn this stuff.
-
Hey guys,
i am just curious to know if there is a way to get the title of a refering page.
i am currently useing @$HTTP_REFERER to recieve the link and was wondering about recieving the title.
thanks for any help.
Checking When A User Exits The Site And Update Mysql Table Upon Exit (SOLVED)
in PHP Coding Help
Posted