-
Posts
171 -
Joined
-
Last visited
Never
Everything posted by bibby
-
[b]content[/b] is used for psuedo elements ::before and ::after [code] <style> p::before{ content:'test-'; } </style> <p>1</p> <p>2</p> <p>3</p> [/code] returns: test-1 test-2 test-3
-
I don't think visibility is a property of tr
-
.style.visibility is less browser compatible than .style.display ([none|inline|block])
-
'document.getElementsByTagName(...).1' is null or not an object error
bibby replied to ERuiz's topic in Javascript Help
get[b]Element[/b]ByTagName() , not the plural -
But [b]NOT[/b] using var , even from within a function, puts it in the global scope.
-
[code]<input type="button" value="Google" onclick="window.location='http://www.google.com';">[/code]
-
Use javascript to valiate basic things, like wether en email address is really an email address, or if the number you products you want to order is an actual interger. Use ajax to validate specific things, like if your particular email address is in a database. [code] <script> function validate() { var e = document.getElementById('thing').value; if (e == '') {alert('dude, its blank');} else if (isNaN(e)) {alert('dude, thats not a number');} else {alert('ok, looks good.')} } <input type="text" id="thing" name="thing"> <input type="button" onclick="validate();" value="check"> </script> [/code]
-
That's certainly going to break! You can't make requests that fast. Each one is going to listen for a ready state. If you had 1000 items, you'd make 1000 server requests in 10ms! Of course, it'll break by the second one. You should find a way to preallocate those values.
-
There are a lot of things that you need to look into separately, but nothing you have asked for seems impossible: [quote]Im sure this will be a php/mysql/javascript answer, but i think the clever stuff will have to be done in Javascript...[/quote] Yeah, if the side frame is never to refresh, but remain aware of it's changing surroundings, then javasctipt is the answer. [quote]What I am wanting to do is have 2 frames, one containing some navigation stuff, one containing the main site displayed. [/quote] [i]meh[/i], I don't like that you're using frames, but it should work. The reason why I say so is that you'll need some ajax anyway for your context menu, so why not refetch the whole display frame? [quote]What i am looking to do is automatically check the page which is loaded (read the html) and allow me to use the right click (custom context menu?) on hrefs and images within hfrefs to send their value to a database.[/quote] Sending values without refreshing will need some ajax. This expects some sort of return (which is the new context menu?), or a brand new display frame. You can set events to fire on right-click , but mac users might hate you. To have the left-frame aware of what's going on, research setAttribute() & getAttribute(), or use a dummy input to store the filename clicked: [code] <script> function addToBucket(url) { document.getElementById('bucket').value=url; // or whatever.setAttribute('active')=url; //now do things according to plan processChanges(); } function fetchFromBucket() { return document.getElementById('bucket').value; // or whatever.getAttribute('active'); } function processChanges() { var activeUrl = fetchFromBucket(); /** // do whatever you need to based on this condition **/ } </script> <input type="hidden" id="bucket"> <a href="file1.php" onclick="addToBucket(this.href);"> <a href="file2.php" onclick="addToBucket(this.href);"> [/code]
-
Here's a little something I've been playing with. [code] <html> <script> document.onmousemove= function (e){followMouse(e); } function followMouse(e) { var posx = 0; var posy = 0; if (!e) var e = window.event; if (e.pageX || e.pageY) { posx = e.pageX; posy = e.pageY; } else if (e.clientX || e.clientY) { posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop; } mark(posx,posy) } function mark(x,y) { var d = document.getElementById('coords') d.value=x+' x '+y; d.style.left=parseInt(x+20)+'px'; d.style.top =parseInt(y+20)+'px'; } </script> <input type="text" id="coords" style="position:absolute;top:0px;left:0px;"> </html> [/code]
-
Let's break down the tasks : Javascript is going to do the listening for changes in the dropdown. If you preload all the possibilities, js could replace your dropdown too, but if you want to fetch it dynamically all the time, you'll want to make an ajax request to something like buildNewDropdown.php?conditions=2
-
Ajax with MySQL in PHP: display for Buyers and Sellers.
bibby replied to AnotherPoetsCry's topic in MySQL Help
I'm hoping that you are using more than one table for that. I'm seeing 3 [i]objects[/i] here, users, things, and transactions. [code] #table users , allows sellers to also be buyers userID | Role | email..|ect.. #table things, allows sellers to sell many things thingID| sellerID | pricePerThing | numberOfThings #table transactions transID | sellerID | buyerID | thingID | agreedPricePerThing | negotiatedNumberOfThings [/code] Dig ? -
No No No. The error is here. $sql = "SELECT LEFT(websites_url, 1) AS [b]'websites_url_letter'[/b], websites_url FROM websites WHERE websites_url_letter='$letter' ORDER BY websites_url ASC;"; Drop those quotes.
-
How about..? [code] select user, points, count(*) number_of_times from test where 1 and user = 3 group by points order by points desc limit 3 ; #(or limit x) [/code]
-
If you had 3 columns, [ user, friend, referral ] , you could draw them out sorted any way you want. [code] Select * from people order by referral asc , friend asc [/code] I imagine person C's record would be [code]#user | friend | referral # C B A[/code] I guess I don't really understand the exact result you are trying to get, but here's some bonus queries anyhow. [code] # friendliest people select count(*) friends , friend from people group by friend order by friends desc #most referrals select count(*) referrals, referral referring_person from people group by referral having referrals>1 order by referrals desc [/code]
-
I agree that 150 is too many. Anything that you anticipate reusing could be stored in arrays.
-
Parse Error - Unexpected T_Constant_ Encapsed_String
bibby replied to php191919's topic in PHP Coding Help
[b]Response.AddHeader "Location", "/";[/b] You have no operator. [b]Response.AddHeader = "Location", "/";[/b] ? -
It's not a bad thing if it's the right thing.
-
[code]ALTER TABLE table ADD UNIQUE KEY (fieldname)[/code] This is not auto_incrementing.
-
Execute one MYSQL database from different pc’s
bibby replied to david12's topic in Microsoft SQL - MSSQL
If it's a linux server, keep an eye on the load with the w command. Start the first and second, and see how the stress is before turning on any others. The trouble with so many is that they all crash together. -
I couldn't help you with views or procedures, but structure is easy. CREATE TABLE copy SELECT * FROM original WHERE 0;
-
run "describe table"; And check the data type of the column. It's probably varchar(255) or tinytext. It returning the first 255 because it only has 255.
-
creating a mysql database with php problem
bibby replied to fireice87's topic in Microsoft SQL - MSSQL
are you using that in an [b].html[/b] file, or [b].php[/b] ? It's got nothing to do with your DB. It's a file not found error. Am I reading this right , "[b]/[/b]C:/xampp/htdocs/" ? Whappup with the slash? -
[b]You said:[/b] [QUOTE] $sql = " SELECT * FROM property LEFT JOIN image ON image.ID_property = property.property_id WHERE property_id = ".$_GET['property_id']." GROUP BY property_id;"; [/QUOTE] Ok. The thing with left join is that it's going to return the whole of the other table no matter what. What you are doing is duplicating a lot of data and eliminating most of it. What the query is asking for is [b]property.*[/b], which for all I know is 25 columns. So, if there were 10 images found, you get 225 more cells than you bargained for. You should probably make that process two separate queries, one for the property row, and one the get imageIDs. At best, you wouldn't gain much by making it one query, as compared to the hit to the resource it could take if there were more cells. something like this [code]<? if ($_GET['property_id']) { $id=$_GET['property_id']; $getProperty=" select * from property where property_id = '$id'; "; if($query=mysql_query($getProperty)) { if( ($n=mysql_num_rows($query)) > 0 ) { //property array $property=mysql_fetch_assoc($query); print_r($property); $getImages="select image_id from image where 1 and ID_property="; if($query=mysql_query($getImages)) { //image array while($image=mysql_fetch_row($query)) print_r($image); } } else echo "no property rows returned"; } else echo "getProperty did not run. <!-- ".$getProperty." -->"; } else echo "give me a property_id"; ?>[/code]
-
Using a web service to connect a SQL and Oracle database
bibby replied to creativkook's topic in Microsoft SQL - MSSQL
Will the host ALLOW your remote connect? better find this out. anyway, it could be better to transfer another way. Must it be real time? Or could it make nightly data pickups?