-
Website Blog
Thanks, im not a huge fan of Wordpress unless clients ask for it. I only stated a day or so incase he was starting from scratch. I agree once you have a few classes, functions etc things fly together very quick.
-
Website Blog
I am a big fan of custom coding... The reason is you only have code that is relevant to you, WordPress etc have to much coding for about 95% of websites that us it, which makes it heavier than is needed! You can always create a blog using php, its pretty simple to make, shouldn't take more than a day of coding depending how complex you are wanting to go. A basic blog with comment, metatags, pagination, custom urls etc should only take about 1 day in coding if you are decent at php. Otherwise if you do not know php the best would probably be WordPress because its free and very easy to customise!
-
Curl & Json - Help Needed Please :)
Hi guys, i have posted this on another forum but for some reason that forum didnt respond... This is the first time i have ever done this and to be honest there is very little out there that can even help regarding what i am trying to do. Can you guys please tell me what i am doing wrong as this is not working and as i do not know cUrl or Json this is a learning experience that is making me pull my hair out lol. Anyway i am wanting to retrieve data from 1 website to another. For instance, when ever someone logs in it then sends url to a website and then a message is sent back and inserted into the database. For a guess i am not even close to what is needed. Here is the code for the website that is sending the url out to receive the message back: <?php class api_connect{ public function getdata(){ $url = "www.domain.co.uk"; $token = "www.domain.co.uk"; $sendto = "http://www.domain-with-api.com/api.php"; $boundary = md5(microtime(true)); $post = ""; $post .= "--{$boundary}\r\n"; $post .= "Content-Disposition: form-data; name=\"post-data\"\r\n\r\n"; $post .= $token . "\r\n"; $post .= "{$url}\r\n"; $post .= "--{$boundary}--\r\n"; $head = "POST {$sendto} HTTP/1.1\r\n"; $head .= "HOST: {$url}\r\n"; $head .= "Content-Type: multipart/form-data; boundary=\"{$boundary}\"\r\n"; $head .= "Content-Length " . $strlen($post) . "\r\n"; $head .= "Connection: close\r\n\r\n"; $socket = fsockopen($sendto, 80); fwrite($socket, "{$head}{$post}"); end(explode("\r\n\r\n", check_api_website($token, $url))); json_decode(array('message' => $message,'islive' => $islive,)); $insertresults = "UPDATE usage SET message='".mysql_real_escape_string($message)."', islive='".mysql_real_escape_string($islive)."' WHERE id = 1 LIMIT 1"; $insertresults_doit = mysql_query($insertresults) OR die(mysql_error()); } } Here is the code for the website that is getting the url and sending the information back to the website: <?php function check_api_website($token, $url){ $token = trim(htmlentities($token)); $safetoken = mysql_real_escape_string($token); $url = trim(htmlentities($url)); $safeurl = mysql_real_escape_string($url); $checkwebsite = "SELECT message,islive FROM websitetokens WHERE url='".$safeurl."' AND token='".$safetoken."'"; $checkwebsite_result = mysql_query($checkwebsite) OR die(); $numberofrows = mysql_num_rows($checkwebsite_result); if($numberofrows > 0){ $website = mysql_fetch_array($checkwebsite_result); $message = stripslashes($website["message"]); $islive = stripslashes($website["islive"]); json_encode(array( 'message' => $message, 'islive' => $islive, )); $date = date('Y-m-d'); $time = gmdate('H:i'); $loginwebsite = "UPDATE websitetokens SET loggedin='".$date."',time='".$time."' WHERE url='".$safeurl."' AND token='".$safetoken."'"; $loginwebsite_result = mysql_query($loginwebsite) OR die(); } else { json_encode(array( 'message' => '', 'islive' => '1', )); } } Thanks
-
Stop Error Log On Apache
I know i have said this to him. His exact words is if its not broke then dont fix, i said it is broke that is why you need a fix. He then states its not broken as it still works, its just that php are warning that they are discontinuing it... lol... To be honest i think he is slowely getting bored of the site and eventually he will sell the site. He wont get a lot for it but maybe a few hundred because its a pr5 and has alot of traffic.
-
problems with search module
echo the $query See what its sending to the database.
-
Hi all :)
Hi everyone, I am a web designer turned developer over the last year. I expertise in HTML and CSS3 but moved into php which i am roughly 6.5/10 and with PHP OOP about 5/10 as still learning both. Ive been in the industry for about 10 years now and loving it. I would like to offer what little knowledge i have to people on here in exchange for picking your brains also Ill definitely see you guys around here as i cant stop talking lol... Oh im Will by the way
-
Stop Error Log On Apache
As the website is a hobby website and he makes no money at all, it costs him £30 a month infact for server costs. He has been quoted £800 and to be fair when i look at it, as its all oop and complex at times i would also quote him about the same. He doesnt have that money to spend on a hobby so as it works he just wants to stop apache generating errors. For instance alot of it is from broken links from old posts which google chuck at it and referring websites but most are from old functions which will not be around for much longer.
-
Stop Error Log On Apache
I have no access to the php.ini file, also he can only give me access to ftp public_html and database through phpmyadmin, The ex web design company do not offer anything else. You state error_reporting(E_NONE); should fix it Will this stop apache sending it to logs as error reporting is already set to hide all information anyway.
-
Stop Error Log On Apache
Hi guys this is my first post, which i wish it wasnt. Ive been a php developer for a while now but never have i had to do this, as being a developer my job is to fix and not hide bad coding. When i say bad coding at the time it was good coding but as its php4 and alot of it has depreciated its not the old programmers fault. Anyway my friend has asked me to make it so the website does not submit a error report as the website is storing a GB a month which is huge, when you look at it, its all things like split() function which is depreciated in php5.3, it still works but it sends an error to the log. The reason why its taking a GB a month is he has about 5000 page views a day, which each page gives of 3 reports, so thats 15000 lines of code a day. He states he has no money so cant get me to rewrite his site but can i turn of the reporting. I asked if i could get into his php.ini and he states i cant as he is a shared hosting platform. So my question is can i use for instance: <?php error_log(Off); ?> at the top off the page? If not how do i go about this? Thanks Will