damn, i feel stupid. that's what the issue was. i assumed because i was using percentages it would have adjusted for that. i was wrong!
damn, i feel stupid. that's what the issue was. i assumed because i was using percentages it would have adjusted for that. i was wrong!
Hello all,
I'm new to CSS layouts and am trying to create a two column layout within a wordpress page. The left and right column line up as expected until I add border-left and padding into the mix found within div#mediaPhotos. After adding it, the right div is still on the right but isn't aligned with the top of the page. It's found all the way at the bottom. Here's the HTML:
<div id="mediaContent">
<div id="mediaVideos">
a bunch of text and videos can be found here
</div> <!-- end id=mediaVideos -->
<div id="mediaPhotos">
a bunch of text and images are found here
</div> <!-- end id=mediaPhotos -->
<div class="mediaCleared"></div>
</div> <!-- end id=mediaContent -->
Here's the CSS:
div#mediaContent {
height:100%;
width:100%;
}
div#mediaVideos {
display:inline-block;
height:100%;
width:70%;
float:left;
}
div#mediaPhotos {
display:inline-block;
width:30%;
height:100%;
float:right;
border-left: 2px dotted #51303f;
padding: 15px;
}
div.mediaCleared {
clear: both;
}
Thanks guys
I found the problem! The line <script language="javascript" type="application/javascript">
should be <script language="javascript"[B] type="text/javascript"[/B]>
imagine that...
I forgot to mention, line 16 is the <body onload="startUp();">
line.
okay, to try and resolve the issue i've altered the code and made it even simpler...
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel=stylesheet href="css/main.css" type="text/css" media="screen" />
<title>Web site</title>
<script language="javascript" type="application/javascript">
function startUp(){
alert("Test");
}
</script>
</head>
<body onload="startUp();">
This again works in FF but IE produces this error:
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; MS-RTC EA 2; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)
Timestamp: Wed, 17 Mar 2010 19:02:26 UTC
Message: Object expected
Line: 16
Char: 1
Code: 0
URI: http://server/index.php
What object is IE expecting that no other browser seems to care about?
Rather than using <body onload="startUp();"> try this in a global area of your javascript.
window.onload = startUp;
thanks for the suggestion. I tried it but it still doesn't work. I'm no longer receiving an script error, but nothing happens. it does still work in firefox though.
IE tells me there's an error on line 17, which is the onload method of the body tag. So here's the code...
<script language="javascript" type="application/javascript">
function startUp() {
setFocus();
}
function setFocus(){
document.frmSearch.txtSearch.focus();
document.frmSearch.txtSearch.select();
}
</script>
And here's how it's called:
<body onload="startUp();">
I tested this in Safari, Firefox, IE 8, Opera, and Chrome. Works in all except IE 8.
The best way to deal with this is to make sure you store only one kind of apostrophe in your database no matter what the user enters. So before storing the value in the database do a str_replace() to strore appropriate apostrophe.
Also in the search module, take the user input and do a str_replace() to change the possible apostrophe to the desired one. Then use this in your query.I hope this helps.
It does help, thank you for your input. This was where I was going to go with it but was hoping there maybe have been something a little more direct.
Hello all,
I have a feeling this is easy to deal with (at least I hope so) but couldn't find much on google, probably because I'm not 100% sure how to word it. Here goes...
We all know how there's different representations for apostrophes. There's the ’ character and then there's '. This is affecting the search application on my website. If someone searches for John's Music, but it just so happens John's Music is entered into the database using the alternate apostrophe (John’s Music), no results will show. How can I correct this issue?
Thanks
You are the man. I just didn't understand what you mean by initializing the array in the original reply but seeing it makes perfect sense. Thanks so much.
No good. I can't initialize the array outside of the while loop for none of the values will be set unless there's another way to initialize an array in php...
and i want the errors displayed so i know what's going on with my code. if i try to set the first key in the array with the variable $intSearchCounter, which increments by 1 after each run through of the loop, that's when i get the error and NO RESULTS RETURNED, just the error. Testing where my code went wrong, I replaced $intSearchCounter with 0 just to see what would happen and it only gave me the last result in the query which i fully expected. I just wanted to see where the code went wrong. Basically, it appears as if the array is ignoring $intSearchCounter but I don't know why this would happen.
if you're trying to give the page an ajax feel (without actually doing the ajax), i'd look into doing an iframe and setting it to not be visible via CSS. This way, you're technically sending the data to another page but it appears as if you aren't... there's lots of tutorials out there if you google iframes php form submission. i've done it before so i know it's possible. i haven't in a while though or i'd post some code. so the user knows they submitted the form, i'd have some javascript change something on the page to say thanks for submitting and disable all of the form's input fields. just trying to give you another option, hope it helps.
So here's the code:
function procRestSearch($searchQuery){
//Don't forget to have $searchquery defined before calling this function
$intSearchCounter = 0; //Used to set the arrays
$searchResult = mysql_query($searchQuery);
while($searchRow = mysql_fetch_array($searchResult, MYSQL_ASSOC)){
//Change/Add/Delete the variables below to match what data needs to be returned
$strRest = array($intSearchCounter => array('restID' => $searchRow['rest_id'],
'restName' => $searchRow['rest_name'], 'restAddress' => $searchRow['rest_address'],
'restAddress2' => $searchRow['rest_address2'], 'restCity' => $searchRow['rest_city'],
'restState' => $searchRow['rest_state'], 'restZip' => $searchRow['rest_zip'],
'restCC' => $searchRow['rest_country_code'], 'restAC' => $searchRow['rest_area_code'],
'restPhone' => $searchRow['rest_phone_no'], 'restFAC' => $searchRow['rest_fax_no'],
'restManager' => $searchRow['rest_manager'], 'restAsManager' => $searchRow['rest_assistant_manager'],
'restWebsite' => $searchRow['rest_website']));
$intSearchCounter++;
}
return $strRest;
}
the problem is when I call this function I get a Notice: Undefined offset: 0 in... error. However, if I replace $intSearchCounter with a static value, such as just replacing it with 0, it works but then I only get the last result from the query returned. What am I doing wrong?
There are a few different ways you can approach this.
You can still use your original concept, when validating the data for display, if the close value is less than the open, then obviously it is the next day. That seems to be the easiest, as long as the data has to stay in the db.There are other ways but I think the above concept is sound.
thanks for the input. i'll stick with my original idea.
this isn't exactly what you're looking for (it compares ms sql express to the others and uses an older version of mysql) but it's a start. I've used mysql and ms sql a bit and although ms sql is easier to manage due to it's GUI, I find mysql a better option for me most of the time. I don't mind getting down and gritty at the command line. I mostly develop web apps though with PHP, so mysql is the obvious choice. I have used it in a few VB.NET projects though and it worked very well.
Good luck and hopefully that link helps a bit.
Hi all,
I want to store the hours of restaurants in a database (sounds simple, right?). I don't want a text field where hours are entered as a lump of data, but was thinking of making a column for each day of the week and filling in the hours this way. I was planning on doing something like this...
hours_sunday_open
hours_sunday_close
hours_monday_open
etc, etc,
Then I realized, what if the restaurant is open from say 4PM on Friday and doesn't close until 2am Saturday? This method won't work so well.
Any idea how I can store the open/close times taking the above problem into account?
It is not an option to just have a varchar or text column labeled hours. I'd much rather list each day separately for search purposes.
Thanks
i found the location. i don't know if this is just a vista thing but the files are located in c:\programdata\mysql\mysql server 5.1\data
I have mySQL 5.1 installed on a Windows Vista machine. I'm really curious as to where the file lives that holds the databases I created. I'm assuming it's in the mySQL install directory but I just don't know where (C:\Program Files\MySQL Server 5.1\?). Does anyone know?
i don't know how much of a hassle this would be for you, but an easy fix might be to just create a new account and transfer all of your files over. it sounds like your keychain is corrupt and off the top of my head, i'm not sure how to fix it.
It keeps freezing and gives an error something like Kernel Trap followed by gibberish numbers. This is just lately. WTF is wrong with it ?
this could be tons of different things. firstly, try booting off of your OS X install CD and run Disk Utilities, then repair the file permissions. if you need step by step directions let me know and I'll post them.
also check to see if you knocked the ram loose. i would suggest reseating it anyway. ram issues can cause the computer to turn on and literally do nothing... black screen, no beeps, etc.
however, the fact that you said it turns itself off then back on makes me think it's a bad power supply or bad connection. def check the power supply connection and reseat that as suggested. was your power supply making any funny noises prior to you turning the computer off an cleaning it?
you don't need to disable the cdrom in device manager.
as for changing bios settings, most modern computers will boot from either cdrom drive without having to enter the bios and change any settings. did you try just putting the cd into the burner and seeing if it boots? i'd also try blackeagles suggestion of cleaning the cd with some soap and water and a lint free cloth. if setup is always failing in the same spot, it sounds like the cd might be messed up.
if you do have to enter the bios to change the boot order, let us know what type of computer you have. every motherboard manufacturer tends to use a slightly different bios and ways of getting into it and changing settings varies. also, you can usually enter a "boot menu" which allows you to avoid changing settings in your bios and only temporarily changes your boot order, opposed to changing it in the bios which will save your settings until you manually go back into it and revert to your old boot order.
I tried that with the PC Security Suite that I purchased but it keeps telling me I don't have enough memory and when I go to delete programs and files that I don't use or need it doesn't change the amount of memory. When I restart the computer all the files are still there even after I have deleted them.
if your PC is really that bad, you're probably going to have to reformat it, although you said you don't have any of the software needed to do that.
i'm a big fan of spybot search and destroy, adaware personal edition, and malwarebytes. they are all free programs you can get at downloads.com. just search for them. they don't remove viruses, but they'll take care your spyware problems.
if you're looking for a free antivirus solution, avast and avg are great products. i prefer avast over avg. try installing these applications in safe mode if you can't do so when booted into windows normally.
sounds like your cd drive might be busted, the cables bad/loose, or possibly if you're burning the CD from an image, the drive you're using doesn't like that brand of blank CDs. I've had that happen on several occasions and once I used a different brand of blank CD, all was good.
one last bump in hopes that someone has any ideas.
hey frank,
the dns server is 208.67.222.222 and .220.220. We use Open DNS's servers. this isn't a dns issue. if you read what i previously posted the server can still ping websites (such as google.com) even after the problem starts. i did ping the dns server though and i get 4 replies.
windows 2000 doesn't include a built-in firewall. it's also not an ipsec issue. that's turned off.
thanks for trying to help but so far you're only suggesting things that i said i already checked.
Hey frankie
This is not a LAN problem, it's a problem with the server. I don't know how else you really want me to explain it... it's all pretty spelled out in the first post.
I'll give it another attempt though. I can make connections to the server. I can control it using Symantec PCAnywhere, I can browse shares on it by going to \\servername\sharename, and I can ping the server using both it's hostname, netbios name, and ip address. However, if I'm on the server trying to make any connections to other network devices (browsing shares, the company's intranet site) or try to go on the Internet (browsing to google.com for example), it does not work. I receive a "This page cannot be found" error message. If I try to browse to a network share (by going to Start, Run, typing in \\servername\sharename) I get "\\servername\sharename cannot be found". The only thing I can do from the server is ping other devices on network and websites.
This issue occurs all the time, until the server is rebooted. It will work correctly for about 24 hours. After that, all outbound connections fail.
The static IP address is a private address. When I connect to it via PCAnywhere, I connect using the office's VPN to my desktop, then PCAnywhere into the server from my desktop, which is on the same local network as the server. I assigned the server the IP address and I ensured …
hi, check out this one..
thanks so much for the link cguan. i gave that a try saturday and i thought it resolved the issue, but unfortunately, the problem started happening again today! are there any other ideas out there? i'm ready to tell the client they're going to have to call the vendor and reformat the server if nothing else comes up :(
i've swapped out the LAN cable and already tried resetting IE. If no other ideas are posted, I'm going to try and repair winsock which I was reading can get corrupted and cause whacky issues. I'll let everyone know how that goes. I won't be able to do that until Saturday though so any other suggestions are greatly appreciated!
hey all,
thanks for the replies. as far as i can tell, windows 2000 doesn't support the power management features that are recommended I check. I did check the device manager and there are no power management options under either of the NIC cards. I did check through the control panel applet and the system is set to never sleep, hibernate, or go on any sort of standby mode. All power saving features are disabled.
The machine has a static IP address.
On another note, I have found that even after all outbound connections go down, I can still ping out from the server. I tried pinging the gateway, the server's own IP address, and another machine on the network. All worked fine. If I open IE or PCA though to try and make some outbound connections, both of these fail.
So this is one of the strangest issues I've seen...
I have a Windows 2000 Server box with SP4 plus all recent Windows updates. I'm not sure when this started (the server is a backup and isn't often used), but after being on from anywhere between several hours to a day or two, the server won't be able to make any outbound network connections. Loading Internet Explorer just results in the "This page cannot be displayed" error, trying to browse to a network resource returns "The path was not found", if we try to connect via PCAnywhere to another machine on the network, the connection times out. However, if any inbound connections are made to the server, such as remotely controlling the server via PCAnywhere or browsing to a shared network resource hosted on this machine, all is fine. Once the machine is rebooted, the problem clears up for a few hours to a day, then suddenly starts up again.
As for event log entries, the only one I've seen is an entry logged by the browser service saying it cannot retrieve a list of browsers from the browser master.
My first thought was that this is a virus or malware. After performing several scans with multiple Antivirus and anti-malware apps, no malicious software has been found. I've also swapped out the NIC. This hasn't fixed the box either. The network firewall isn't blocking the server and IPSec is not enabled on this machine.
I would …
To be honest, I'm not really sure why I use the extract function... the book I picked up that I taught myself PHP/MySQL from used it in every example, so it just stuck with me. As for not declaring x, I did so in the header of the page, I just didn't put it in the code here. Thanks so much for helping me out, I was completely befuddled. Looks like it's time to find out what exactly what the extract function does...
that works beautifully! do you know why what i had wasn't working? it worked in my head... also, i know \n creates a new line, but why is it necessary to put that after each html tag at the end of each echo statement? is that just to keep the page cleaner? sorry for all the questions, i'm just trying to learn from my mistakes.
I gave that a try and the same thing still happens. The results don't appear like they should. Thanks though for trying!
I'm pretty much a newb when it comes to PHP and MYSQL (taught myself, so I make a lot of mistakes :confused: ) So here's the code...
$query = "SELECT DISTINCT(t_tag) FROM tags ORDER BY t_tag desc LIMIT 50";
$results = mysql_query($query) or die(mysql_error());
while ($row = mysql_fetch_array($results)) {
extract($row);
$tag[$x] = $t_tag;
$x++;
}
echo "<table border=1>";
for ($i=1; $i<=$x; $i++) {
$total_tag_usage = mysql_result(mysql_query("SELECT COUNT(t_tag) AS NUM FROM tags WHERE t_tag = '$tag[$i]'"),0);
echo "<tr><td>" .$t_tag[$i]. "</td><td>" .$total_tag_usage. "</td></tr>";
}
echo "</table>";
What I want to accomplish is pull each unique tag from the database (from the tags table, in a column named t_tag), and place the number of times that tag has been used next to it in a table. As of now, the code above looks as if it's spitting out random numbers and it breaks up each tag letter by letter into a cell in the table. For example, if I have the tag "Apple", it's broken up into 5 different cells on the table, one for each letter with the neighboring cell in the same row displaying a random number. I think what I'm trying to do can be done with a single SQL statement, unfortunately, I was unable to write one that works. I figured since this was php code, I should post it in the php forum. Sorry if it should have gone in the SQL forum.