mga_ka_php
-
Posts
134 -
Joined
Posts posted by mga_ka_php
-
-
how do i track returning visitors?
how will i know if the user is a returning visitor? i stored their ip address but ip address always changes.
-
solve my problem. a friend of mine suggested to convert it to hex. then i get the hex of space and remove it. and it works. thank you for help guys. i appreciated your suggestions.
-
i've been playing around with htmlentities and str_replace but still no luck.
First, you should htmlentities the string and if the white space is not , just use array to str_replace.
-
i'm downloading the data from a site. by using curl
stip the xml tags and separate the each tags with a delimiter
ex. <name>my name</name><address>my address</address>.....
then will convert that to name:my name|#|address:my address........
then save that to our database.
if i'm going to get that data, i will save it as an array so i could get the key and value.
now as im researching the data. i found out that in the name, it has space before and after the name
so it will be like name: my name |#|
i couldn't remove that space
-
still didn't work. i'm getting this string from database to form like this
id-name-state-city-date
then use that as my url for my pages
got the id, name, state, city, date from a site then save it in our database
Yeah sorry I'm not sure, here's a shot in the dark...
<?php $s = "tims gsd d a a...a s asd f"; $s = html_entity_decode($s); $s = preg_replace('/[\s|\t| ]*/' ,"" , $s); echo $s; ?>
-
from database
still didn't work. this is giving me a headache.Where is this string coming from/generated?
-
still didn't work. this is giving me a headache.
<?php $s = "tims gsd d aa...a s asd f"; $s = preg_replace('/\s*/' ,"" , html_entity_decode($s)); echo $s; ?>
-
it didn't work also, i tried viewing the source and found out that the space is in
how do i remove that?
This should work:
<?php $s = "tims gsd d aa...a s asd f"; $s = preg_replace('/\s*/' ,"" , $s); echo $s; ?>
-
That's what i did, but there are still spaces left, i don't know why. is there a special character for space?
<?php
$s = "tims gsd d aa...a s asd f";
$s = str_replace(" ", "", $s);
echo $s;
?>
-
how do i remove space from a string? because i'm using str_replace, there are some spaces which couldn't be removed?
-
i'm getting information from a website using curl
the data is in xml format and use preg_match to get the information like <php>content</php>, it will get content.
and when i print it, it will display "content"
but when i try to post it in the database when i check the database it, it will be posted as <php>content</php>
what is the problem?
-
i want to directly convert via the sql statement
-
is it possible that i could get and convert the content of a column.
example.
id message
1 have a message for you last 12993234
the 12993234 is a timestamp for example.
i want to have a sql statement that will get that timestamp and convert it to a date
example: SELECT id, message, (statement here) AS date FROM table1
id message date
1 have a message for you last 12993234 2009-02-16
12993234 ---> 2009-02-16
the timestamp was converted to a date format of yyyy-mm-dd
is that possible? if possible how do i do that?
-
can rsync copy only new and modified files only?
i want to backup my website and copy only the updated and new files because we have an account which is almost 3GB and if i do full backup that regularly it will eat so much storage space and long load for both servers.
how do i accomplish that?
can you specify the parameters to be used.
Thanks.
-
figured it out.thanks.
what i did was
SELECT siteDomain 'Site', ( SELECT COUNT(userID) FROM users WHERE (userDateRegistered BETWEEN '1231733663' AND '1231910698') AND users.siteID=sites.siteID ) 'New Members', FROM sites
-
thinking about this sql statement
SELECT a.siteDomain 'Site' FROM sites a WHERE ( SELECT COUNT(b.userID) FROM users b WHERE b.userDateRegistered between '1231513284' and '1231553482' )
can i move the COUNT(b.userID) to SELECT a.siteDomain 'Site'?
-
still doesn't work.
if i remove the WHERE
result would be
Site | New Members
site.com | 50
site2.com | 10
site3.com | 25
result is good, it gets the total number of new members, all time
but if i add the WHERE, it will not show all the sites, it will only show the sites with new members
Site | New Members
site.com | 50
site3.com | 25
-
How do you correct this statement
SELECT a.siteID 'ID', a.siteDomain 'Site', COUNT(*) 'New Members'FROM sites a LEFT JOIN users b ON a.siteID=b.siteID
WHERE
b.userDateRegistered>='1231513284' AND
b.userDateRegistered<='1231553482'
GROUP BY a.siteID
have 2 tables, sites and users, i want to view all the sites with how many members
the problem with this code it only display the sites with >0 users
i want to show even the 0 users
Site | New Members
site.com | 0
site2.com | 10
-
anyone?
-
how do $_GET['query'] will have value?
i add echo $_GET['query'] into my index.php
then go to google then entered the search phrases then click my site and it doesn't have a value
how do i get that search phrase?
-
how do i track the search phrases used by users in search engine to go to my website?
-
how about & in new? ex. $dbConn = &New dbConn;
i'm debugging the others programmer work and im not that hight level programmer
-
what do you mean if you have @ in your variable? ex @$var1
-
do i need to install something in a server?
track returning visitors
in PHP Coding Help
Posted
but not all users enable their cookies?