cbolson
Members-
Posts
139 -
Joined
-
Last visited
Never
Everything posted by cbolson
-
One more thing though, will search engines index the static urls (even though they don't actually exist physically)? There is a good chance that they will, unless you specifically tell them not to. If the robots can find the url and find that it has content as long as you haven't told them otherwise (via headers, robots.txt, htaccess etc) they will index the page.
-
Hi, no, you just need to start the session once Chris
-
Bear in mind that I answered to the new thread that you had started. I wasn't aware of the previous discussion. Can you do a table structure and data dump so that I can recreat it and see why it isn't working as expected. Chris
-
onfocus and onblur events don't work correctly
cbolson replied to ktsirig's topic in Javascript Help
Hi, This line: if (given_text='') should be like this: if (given_text=='') Chris -
If I am not wrong it is grouping by the first threadid that it finds. Try this: $sql = "SELECT postId, MAX(postDateTime) FROM posts GROUP BY threadId ORDER BY postDateTime DESC"; Chris
-
ARGH! (Session arrays + redirects = headache)
cbolson replied to gerkintrigg's topic in PHP Coding Help
From what I can see from your source code (forgive me if I am wrong) you are just adding the product to the cart by a simple href link like this: shop_cart_add.php?prod=1 I can't see anywhere that it is passing the textarea contents to the next page. Why don't you put it in a form (ie the product id and the engraving textarea) so that it can be posted "properly"? Chris -
What you are suggesting is known as blackhat SEO - ie you are trying to trick the search engines into thinking that your page has more content than it really has. A few years ago this was a well known trick (along with white text on white background, off-page margins, tiny font etc) but the search engines soon worked it out. At least as far as Google is concerned, not only does it see what you have done but it reflects negativley on your index position - ie Google (and probably most other search engines) frown upon this sort of method. If you want the search engines to pick up on your keywords, you need to include them properly in the content. Chris
-
ARGH! (Session arrays + redirects = headache)
cbolson replied to gerkintrigg's topic in PHP Coding Help
Well, I am not really sure what your problem is. When I go to the url that you posted I can click on the "Add to basket" button and I am taken to the shopping car with the item in it. If I then go to another product and do the same (ie click on the button) I am taken to the shopping cart again, now with the 2 items that I clicked in it. It seems alright to me (apart from the missing images). Is this not what you want to happen? ah, hang on... should the product and the engraving show up as 2 seperate items in the shopping cart? Chris -
Hi, I normally use a single table with column for each table. The fields are defined with _en, _es etc. Adding a new language is just a matter of adding a new column with the same format. I actually have a script that does this automatically - ie when I want to add a new language it loops through the tables, finds the fields that end with "_en" (I only use this system for language fields) and adds a new one with the new ending. So for example to add german to the web, if it finds a field such as "title_en" it will add "title_de". Chris
-
opps, sorry, I was getting mixed up with an ALTER. sorry too much other stuff going on at the moment
-
Use WHERE, same as you would with a SELECT query. eg. INSERT INTO _your_table SET (fields...) VALUES (data...) WHERE group_id=2 Chris
-
Hi, you can do it like this: $result = mysql_query('select count(id) AS total from user WHERE age > 33'); $count = mysq_fetch_array($result); echo $count["total"]; Chris
-
Hi, You say: How do you *know* that it contains text? Have you done echo $row["comments"]; on the page to test it has a value? Chris
-
Hi, If you really *have* to do this you could loop through all the $_GET values (ie the ones sent via the url) and add them the the $_POST array like this: foreach($_GET AS $key=>$val){ $_POST[$key]=$val; } Seems rather against the purpose of the $_POST variable though Chris
-
Sorry, The problem was with thejum.js file. You have opening and closeing javascript tags within the actual javascript file which is preventing it from working (I mistakeleny assumed that you had added them manually to the snippet that you posted earlier) Remove the very first line: <script type="text/javascript"><!-- And last line: //--></script> from jump.js and see of it works now Chris
-
Do you have an url available where we can see this error? Do be able to identify the problem we would need to see *all* the files. Chris
-
Hi, The problem is not in the jump.js file, rather it is with one of the others. Copying your code and removing the other js scripts the pop-up window opens correctly. Chris
-
Help linking query results to another page?
cbolson replied to The.Pr0fess0r's topic in PHP Coding Help
Hi, You will need to do a new database query on that page using the id that has been sent in the "WHERE" clause. Basically like this: $sql="SELECT your_fields FROM your_table WHERE id=".$_GET["id"]." LIMIT 1"; Chris -
ARGH! (Session arrays + redirects = headache)
cbolson replied to gerkintrigg's topic in PHP Coding Help
Hi, you don't actually say exactly in what way it is not working (php error, empty basket, not redirect etc.) I assume your product_id column is a unique auto-increment column. You can save yourself some trouble and code by using mysql_insert_id() after mysql_query($q); to get the id of the item that you have just inserted. You can't trust getting the items in reverse order as somebody else might add an item at the same time and mess up the system. So you could just use this (having inserted the product): $go='shop_cart_add.php?prod='.mysql_insert_id(); header("Location: ".$go); Now, if you find that the page is not reloading, the php function header("location: ....") must be called before anything is output to the browser, including whitespace. Chris -
Hi, Worth noting that your only problem with the snippet that you had posted was that the " (double quote) was in the wrong place. You had: echo "<div class = mydiv"> . $row['bookingref'] . "</div>"; it should have been: echo "<div class = mydiv>" . $row['bookingref'] . "</div>"; Personally I would do it like this to maintain the correct double quotes in the html that is displayed: echo '<div class ="mydiv">' . $row['bookingref'] . '</div>'; ie wrap the php in single quotes and use the double quotes for the html. Chris
-
Hi, You could try something like this: $query = "SELECT DISTINCT(type), MAX(date) FROM products WHERE date > curdate() ORDER BY date DESC"; Not 100% sure about it but worth a try Chris
-
Hi, you could try something like this: SELECT t1.area_name, COUNT(t2.gender) AS num_male, COUNT(t3.gender) AS num_female FROM tbl_areas AS t1 LEFT JOIN tbl_members AS t2 ON (t2.area_id=t1.area_id AND t2.gender='male') LEFT JOIN tbl_members AS t3 ON (t3.area_id=t1.area_id AND t3.gender='female') GROUP BY t1.area_id I can't see that you need the other table for this particular result set. Chris
-
Hi, Have you tried something like this: <p class="searchbar"> <span style="float: left; width:30%;"><a href="">View unanswered posts</a> | <a href="">View active topics</a></span> <span style="float: left;width:40%; text-align:center;"><img src="./styles/hestia/imageset/bars/donationbar.png" alt="Donations received so far" style="margin:0px auto;"/></span> <span style="float: right; width:30%;"><a href="">View new posts</a> | <a href="">View your posts</a></span> </p> Chris
-
Hi, probably because you are not resetting the $break at the beginning of each loop. Try this: for($i=0; $i<=7; $i++) { $break=""; .... Chris
-
using basename($_SERVER["PHP_SELF"]) "should" just get the filename with no slashes. Chris