Michan
Members-
Posts
115 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
Michan's Achievements
Member (2/5)
0
Reputation
-
Thank you very much for your time, this has helped a lot
-
Thank you very much for this. It tidies it all onto a single line, but converts all of the <, >, ", ', &, etc into their HTML codes. Is there a way to remove the HTML returns without converting all of the HTML codes? Many thanks again!
-
I already have line breaks in there, I'd just like to remove the additional whitespace as it's causing problems in Javascript.
-
Hi, I seem to be stuck. I've tried replacing \n and \r, but it doesn't seem to have any effect on the code, which looks something like this: Line 1<br /> Line 2<br /> Line 3 How would I fix this with a function so it would display in HTML as the following? Line 1<br />Line 2<br />Line 3 Many thanks in advance, - Mi
-
System I built for an Event Calender (HELP plz)
Michan replied to marcusfaye87's topic in PHP Coding Help
Edit: Double post -
System I built for an Event Calender (HELP plz)
Michan replied to marcusfaye87's topic in PHP Coding Help
For this chunk: if ($eventDate['year'] > $currentDate['year']) { // Event is upcomming $eventsArrayUpcomming[] = $eventData; } elseif ($eventDate['year'] == $currentDate['year']) { if ($eventDate['month'] > $currentDate['month']) { // Event is upcomming $eventsArrayUpcomming[] = $eventData; } elseif ($eventDate['month'] == $currentDate['month']) { if ($eventDate['day'] > $currentDate['day']) { // Event is upcomming $eventsArrayUpcomming[] = $eventData; } elseif (if $eventDate['day'] == $currentDate['day']) { // Event is today $eventsArrayToday[] = $eventData; } elseif (if ($eventDate['day'] < $currentDate['day']) { // Event has passed $eventsArrayPassed[] = $eventData; } } elseif ($eventDate['month'] < $currentDate['month']) { // Event has passed $eventsArrayPassed[] = $eventData; } } elseif ($eventDate['year'] < $currentDate['year']) { // Event has passed $eventsArrayPassed[] = $eventData; } You could simply convert the event year, month, and day to a timestamp and match it with time(). From what I see, you don't need to convert it to the year, month, and day. $eventDate['date'] = mktime(0, 0, 0, $eventDate['month'], $eventDate['day'], $eventDate['year']) if (date('jmY', $eventDate['date']) > date('jmY', time())) { // Event is upcomming $eventsArrayUpcomming[] = $eventData; } elseif (date('jmY', $eventDate['date']) == date('jmY', time())) { // Event is today $eventsArrayToday[] = $eventData; } else { // Event has passed $eventsArrayPassed[] = $eventData; } -
Alright, then give this a try: RewriteRule ^([^/]+)(/([^/]+))?.html$ /sitewonders/index.php?pg=detail&catId=%3&catTitle=%1 Good luck!
-
Why would you want to get rid of the $_GET part of it? That's the only way of reading data sent through pages using $_GET. You could always put something like this at the start of the page which is receiving the data: <?PHP $variable = $_GET['variable']; $variable2 = $_GET['variable2'];
-
Try this: RewriteRule ^aboutus.html$ /sitewonders/index.php?pg=detail&catId=1&catTitle=2
-
Maybe you can show us some code?
-
Hi, I'm having problems trying to retrieve certain values from a function. The function is below: function getpage($pageid,$number,$comic,$total,$thispage) { $getpage = mysql_query('SELECT pageid FROM pages WHERE page='.$comic.' AND previouspg='.$pageid); $page = mysql_fetch_array($getpage); $pageorder[$number] = $page['pageid']; if($number != $total) getpage($page['pageid'],($number+1),$comic,$total,$thispage); if($pageid = $thispage) $thepage = $number; } After running it (and getting some results; I've tested it with an echo), how do I get $thepage and $pageorder (an array) from the function? I've tried return $thepage; and return $pageorder; but have had no success there ($thepage and $pageorder were empty). Any help would be greatly appreciated! Thanks in advance, - Mi
-
[SOLVED] Problem using responseText in different <div>s
Michan replied to Michan's topic in Javascript Help
Thank you so much; it works! -
echo "<tr><th>Image</th>"; echo "<td>"; echo "<img src='cars/".$row['image']."' width='100' height='100'/>"; echo "</td></tr>"; That's the easy way. If you're still having problems, can you post whatever is on that line? Thanks.
-
You could simply use width and height in the <img> tag, if the size reduction is for the user interface rather than the bandwidth.
-
Hi, I'm stuck on a bit of code. I have more than one <div>, and depending on which "comic" you choose, I'd like to load content into the specified <div>. How would I get about doing it? The code pretty much explains itself below. <script type="text/javascript"> var xmlHttp function selectcomic(str,div) { xmlHttp=GetXmlHttpObject(); if (xmlHttp==null) { alert ("Your browser does not support AJAX!"); return; } var url="comics.php"; url=url+"?getresult="+str; xmlHttp.onreadystatechange=stateChanged(div); xmlHttp.open("GET",url,true); xmlHttp.send(null); } function stateChanged(div) { if (xmlHttp.readyState==4) { document.getElementById(div).innerHTML=xmlHttp.responseText; } } function GetXmlHttpObject() { var xmlHttp=null; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { // Internet Explorer try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; } </script> Comic: <a href="" onclick="selectcomic(\'1\',\'div1\'); return false">Comic 1</a> <a href="" onclick="selectcomic(\'2\',\'div2\'); return false">Comic 2</a> <a href="" onclick="selectcomic(\'3\',\'div3\'); return false">Comic 3</a> <div id="div1">None selected!</div> <div id="div2">None selected!</div> <div id="div3">None selected!</div> Thanks in advance!