woodsytime
Members
-
Joined
-
Last visited
Reputation Activity
-
woodsytime reacted to Skateside in HTML Email Table issueAlso add "display:block;" to your images to prevent extra space around them in Hotmail
-
woodsytime reacted to BlueDreamer in HTML Email Table issueRemove the P tag and apply border="0" to your IMG tags
-
woodsytime reacted to zed in JQuery FadeOpacity not working in I.E.this may help
http://stackoverflow.com/questions/1284163/jquery-ie-fadein-and-fadeout-opacity
-
woodsytime reacted to James Riley in Converting MySQL date to PHP format?it was attempting to convert the string "2010-07-01 14:26:00" into an integer using php's Integer Casting, this results in 2010, in unix time this represents the time Thursday, January 1, 1970 12:33:30 am UTC (2010 seconds from the epoch)
-
woodsytime reacted to James Riley in Converting MySQL date to PHP format?date() takes a unix-timestamp as it's argument, not a SQL date string, what you need to do is convert it with strtotime()
echo date('jS M',strtotime($mySQLdate));
-
In your for loop you're using heredoc sytnax, the PHP parser doesn't end a heredoc if there is any tabs/whitespace in front of the end statement, so you need to do something like...
for ($j = 0 ; $j < $rows ; ++$j) { $row = mysql_fetch_row($result); echo <<<_END <pre> Title $row[0] Embed $row[1] Date $row[2] Comment $row[3] Id $row[4] </pre> <form action="video-add.php" method="post"> <input type="hidden" name="delete" value="yes" /> <input type="hidden" name="id" value="$row[4]" /> <input type="submit" value="DELETE RECORD" /> </form> _END; }
-
woodsytime reacted to MikeyB in PHP Include RSS Feed ErrorHeya,
What you are giving include() is a URL, which is incorrect.
What you need to do is edit rss2html.php;
$XMLfilename = "http://www.thedailymash.co.uk/rss.xml";
$TEMPLATEfilename = "http://www.rss-specifications.com/template.htm";
$FeedMaxItems = 1;
... And use;
include("rss2html.php");
MikeyB
-
woodsytime reacted to miha213 in Joomla Installation problem with EasyPHPSry..
I found solution on http://www.easyphp.org/forums/16/146773/146879/re__mysql_error_2002_in_easyphp5_3_2_but_not_in_5_2_10_on_windows_7#msg-146879 for conncting with mysql use IP 127.0.0.1 instead of domain localhost.
And this is it!!!
If you want:
"This is due to a change to the way PHP communicates with MySQL in PHP 5.3.
You will either need to use 127.0.0.1 to connect to your database or edit:
C:\Windows\System32\drivers\etc\hosts
And remove the hash (#) in front of:
# 127.0.0.1 localhost
Save the file, then it should work. "
-
woodsytime reacted to pat24 in Joomla Installation problem with EasyPHPHi
Never used easy php before always used xampp and never had a problem with joomla.
Xampp comes with all you will need
http://www.apachefriends.org/en/xampp-windows.html
Pat
-
woodsytime reacted to traxor in How important is it to develop for Linux and FreeBSD OS / Browser combos?Ubuntu & FreeBSD are renowned for having poor text rendering and support for websites so it's up to you. What I tend to do is launch the site working in all the main browsers and operating systems (Firefox, Safari, Chrome, IE7+, Opera on Windows & OSX) and then monitor my analytics. Head over to http://www.google.com/analytics/ and set yourself up an account if you don't already have one. Let it track your site for a good 2 or 3 weeks then click on "Visitors > Browsers Capabilities > Browsers and OS".
When you've determined whether linux users visit your site, you can then decide whether it's worth spending the time on building your site to work on said OS'.
-
woodsytime reacted to KieranA in How important is it to develop for Linux and FreeBSD OS / Browser combos?This totally depends on the site, if you plan properly you'll be able to decide on this yourself. I tend to think of it like this: If a user from one of these browsers visits on your site and purchases something then that conversion probably pays you off for the time you've spent on tweaking it.
-
woodsytime reacted to Connetu_C in PHP include with images not working?Of course! How about this:
switch ($service) { case "virus_removal": case "internet_setup": case "computer_security": case "website_design": case "hardware_software_installation": case "pc_mot": case "data_backup": case "data_recovery": case "video_phone_pc": case "trouble_shooting": echo '<img src="/resources/images/services/$service.png" alt="alt text" />'; break; default: echo '<img src="/services/services_intro.png" alt="alt text" />'; break; }
You might also find it more concise (purely personal taste) to write:
$known_services = array("virus_removal", "internet_setup", "computer_security", "website_design", "hardware_software_installation", "pc_mot", "data_backup", "data_recovery", "video_phone_pc", "trouble_shooting"); if(in_array($services,$known_services)) { echo '<img src="/resources/images/services/$service.png" alt="alt text" />'; } else { echo '<img src="/services/services_intro.png" alt="alt text" />'; }
-
woodsytime reacted to Connetu_C in PHP include with images not working?When you look at the HTML source code generated inside the browser, what URL do you see for the images? Where do the images actually reside?
The fact you can't see them is probably caused by the images not existing at the URLs - you need to put your images in a publicly-accessible directory in your domain (e.g. /images) and alter the URL prefixes in the PHP appropriately (since I don't know where they actually are, I had to guess). And yes, apologies, that should have been $service and not $services.
I also note that previous you were using "services/service_intro.png" and "resources/images/services/" as relative paths. This isn't advisable (in case you move your script or reuse the code for other paths). I'd suggest altering these to the appropriate absolute paths (which are always relative to the hostname and not the current page) which begin with a /.
-
woodsytime reacted to notbanksy in PHP include with images not working?I think you've misunderstood the function of the include command. It's there to allow you to include the contents of a text file. If you want to display an image, just do this:
echo '<img src="services/services_intro.png" alt="alt text"/>';
or
?> // close the php tag for now to make life easier <img src="resources/images/services/<?php echo $service; ?>.png" alt="alt text"/> <?php // open the php tag again for the rest of your code
Hope that helps
-
Sure. It's a shorthand version of an IF statement known as a ternary operator. It's the same as putting
if(isset($_GET['service']) { $service = preg_replace('/\W/si', '', $_GET['service']); } else { $service = 'intro'; }
The if test in the ternary operator is between the = and the ? so it checks to see if the expression there is true or false.
If it's true, it runs the code between the ? and the : and assigns the output to $service.
If it's false, it assigns the output from the code between the : and the ;
See the ternary operator documentation here
-
$service = isset($_GET['service']) ? preg_replace('/\W/si', '', $_GET['service']) : 'intro';
If you want to you can reduce all your repeat code too
switch ($service) { case "boilers": case "central_heating": case "radiators": case "water_pressure": case "bathroom_installations": include ('services/' . $service . '.html'); break; default: include ('services/services_intro.html'); break; }
-
jQuery Load Content - nice and easy capable of some powerful and impressive (add animations etc) results.
Documentation: http://api.jquery.com/category/ajax/
Just about the best demo and tut: http://net.tutsplus.com/tutorials/javascript-ajax/how-to-load-in-and-animate-content-with-jquery/
-
woodsytime reacted to craftygeek in Getting Dynamic Content to Load into one page from another page?I think you'll have to pass on the info in the URL, if you set the index links to open something like services.html?service=boiler then get the service value from the URL with javascript & load content appropriately.
Have a look at this to get started:
http://www.netlobo.com/url_query_string_javascript.html
-
AJAX perhaps? I'd use jQuery myself, if what you ask is what I imagine.
-
woodsytime reacted to craftygeek in How do I use URL query string parameter to load content dynamically?You need to do something like:
if(isset($_GET[service])){ $service = $_GET['service']; include('file/path/' . $service . '.html'); }
you could pull out the contents of the file, but the include should do the trick.
The if statement gives you some error protection in case you have a condition where service is not set in the URL...you may want to set a default in an else statement to cover this eventuality.
-
woodsytime reacted to craftygeek in How do I use URL query string parameter to load content dynamically?With you trying to print $service it might be throwing an error & not getting any further with the script.
try this:
<div id="content_right"> <?php if(isset($_GET['service'])) { $service = trim($_GET['service']); } else { $service = 'boilers'; //sets default value } echo $service . '<br />'; include('services/' . $service . '.html'); ?> </div> <!-- END of DIV Content_Right -->
-
woodsytime reacted to Wickham in PHP Contact Form - Error 404 Object Not FoundAn email has four sections, the To, Subject, Message body and From so the PHP mail function has to have four sections separated by commas, which your code does have, but an email cannot be sent unless it has a From email address; it will just be rejected by the ISP.
I think it's difficult to send emails from your computer localhost; it's better to test with a real form and a real email online (you could use the same email address for $EmailTo and $EmailFrom or use another of your own email addresses).
-
Yes you need ok.htm and error.htm in same directory as mailer.php
-
woodsytime reacted to Wickham in PHP Contact Form - Error 404 Object Not FoundThe 404 error might refer to $EmailFrom = "Enquiry"; because the mail code
mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");
has $EmailFrom but Enquiry isn't a field name in the form. It needs to be an email address, not text Enquiry.
The error also says localhost, so are you trying to send the email from localhost on your computer? It's better to upload everything and test online.