-
Posts
3,584 -
Joined
-
Last visited
-
Days Won
3
Everything posted by JonnoTheDev
-
str_replace takes strings as parameters, not functions! $string = "abc.php"; $string = str_replace("a","x", $string); // will include xbc.php include($string);
-
Place the following in your http.conf virtualhost container for the domain or in a .htaccess file Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} ^sitename\.com RewriteRule ^(.*)$ http://www.sitename.com/$1 [R=permanent,L]
-
[SOLVED] $data =implode("','",$dbquery); ???
JonnoTheDev replied to djdellux's topic in PHP Coding Help
No, I mean post the error you are receiving from your code. How can we see what is wrong if you dont explain or post the error. -
take a look at ffmpeg and ffmpeg-php http://ffmpeg.mplayerhq.hu/ http://ffmpeg-php.sourceforge.net/
-
[SOLVED] $data =implode("','",$dbquery); ???
JonnoTheDev replied to djdellux's topic in PHP Coding Help
You need to print the error -
[SOLVED] php search username and echo that username's profile
JonnoTheDev replied to contra10's topic in PHP Coding Help
Do you mean a specific profile page i.e. profile.php -
Took me about 2 days and I was a master - only kidding. You never stop learning as projects will always throw something at you that requires R&D. Learning the basics from a good book and following a few tutorials wont take too much time and you should be able to knock up a dynamic website quite quickly. You will learn from the projects you take on and the difficulties you run into, but I started on live projects after only a week of book learning, made a hell of a mess, but got them working (to a degree) and researched more into the areas I struggled with. On following projects I was able to improve these areas. You will then start to build up a library of code that you can use in most projects.
-
[SOLVED] Sessions? read(), file_get_contents()?
JonnoTheDev replied to trinity's topic in PHP Coding Help
Sessions are for storing data without the need to pass through GET or POST requests so this is not really what you are after. file_get_contents() simply reads the contents of a file. If you are a beginner you should read the http://php.net functions manual to see what functions do, what parameteres they expect and what they return. Your syntax is bad: echo "<a href="FileDisplay.php?filename=<? echo $filename; ?>">Click here</a>"; Use echo "<a href=\"FileDisplay.php?filename=".$filename."\">Click here</a>"; You need a PHP beginners book mate. -
can someone point me in the right direction
JonnoTheDev replied to Jiraiya's topic in PHP Coding Help
Dont think you are really explaining fully what you are after but from your post the following is correct: $cashAmount = 10; $cashLimit = 100; print $cashAmount."/".$cashLimit; -
You need to elaborate. What is your current search query? What columns do you want to search? What columns do you want to return?
-
My second website. Let me know what you think.
JonnoTheDev replied to defeated's topic in Website Critique
Looks like one of those cheap template designs. Don't think that the colour scheme really works. The right column is a waste of space with random stock images and the navigation on some of the right column pages doesnt display properly. Corporate & professional aren't the words I would use. Take a look at http://www.mineralsmarketing.com/ A lot cleaner and consistent. -
Make sure the program file has the correct permissions. Doesnt matter about ownership. Use chmod.
-
Its because you are using the standard mail() function to send attachments and this is just a daft idea. For mime email use PEAR::Mail_Mime http://pear.php.net/package/Mail_Mime Alternatively use Swiftmailer: http://swiftmailer.org/
-
exec should work as long as you are using the full correct path. exec('/path/program', $output); Also has your CLI program got the appropriate permissions for php to execute it? If you are on a shared host then they may have disabled the use of exec().
-
Should be $_POST not $POST Rest is OK.
-
[SOLVED] setting a $_GET as a class constant
JonnoTheDev replied to mattjones's topic in PHP Coding Help
pass the GET variable into one of your class methods and then set it public function setX($x) { $this->businesstype = $x; } -
This function does not accept regular expressions. Use php.net manual for accepted function parameters. preg_match() is used for regular expression matching.
-
Run a count on the number of image records for that user in the database. If it equals 10 then dont display the upload field.
-
Why are you using CURL rather than loading the feed using simple_xml? simplexml_load_file("http://xurrency.com/nzd/feed");
-
[SOLVED] setting a $_GET as a class constant
JonnoTheDev replied to mattjones's topic in PHP Coding Help
Use static public $businesstype = $_GET['business']; -
The number of queries/records returned will be the reason. Have you got a index on invited_by and user_name?
-
Yes it could but whats wrong with just auto reloading the page using a header command after the image is replaced: // form submitted if(isset($_POST['submit'])) { // upload image and replace database entry // delete original image @unlink(); // reload edit page header("Location:edit-image.php?id=1234"); exit(); }
-
yes INSERT INTO table SET datefield=CURDATE()
-
This will work function isSpider($userAgent) { if(stristr($userAgent, "Googlebot") || /* Google */ stristr($userAgent, "Slurp") || /* Inktomi/Y! */ stristr($userAgent, "MSNBOT") || /* MSN */ stristr($userAgent, "teoma") || /* Teoma */ stristr($userAgent, "ia_archiver") || /* Alexa */ stristr($userAgent, "Scooter") || /* Altavista */ stristr($userAgent, "Mercator") || /* Altavista */ stristr($userAgent, "FAST") || /* AllTheWeb */ stristr($userAgent, "MantraAgent") || /* LookSmart */ stristr($userAgent, "Lycos") || /* Lycos */ stristr($userAgent, "ZyBorg")) { /* WISEnut */ return true; } return false; } if(!isSpider(getenv("HTTP_USER_AGENT"))) { // user tracking logic goes in here }
-
This is a real pain in the arse. Usually get this when people copy and paste text directly from microsoft word into a html text editor that saves into a database table. Never really found a solution, tested changing character sets and all kinds but nothing works completely. The problem using str_replace with a string like "“" is that php doesn't actually see the characters in that fashion. They only come out like that when printed to the screen. Hopefully somebody has the answer