HuggieBear
Members-
Posts
1,899 -
Joined
-
Last visited
Everything posted by HuggieBear
-
What version of PHP are you using? Regards Huggie
-
I'm not sure I know what you mean, but there's a constant called SID that you can refer to once you've started a session... [code]<?php session_start(); echo SID; // This obviously only works once you've started a session. ?>[/code] Regards Huggie
-
The code all looks ok to me, with the exception of the html... Can you provide a sample dump of your database and the full code and I'll give it a try for you? Regards Huggie
-
mail() sends one email but not the other...why?
HuggieBear replied to simcoweb's topic in PHP Coding Help
[quote author=simcoweb link=topic=111936.msg453942#msg453942 date=1161199221] This line: [code=php:0]$toAddress="" . $row['email'] . ""; /* change this! */ [/code] is populated by a query/array. This represents the email address of the person/member the visitor wants to contact. The email confirmation the visitor receives shows the proper 'from' email address so I know it's populating that correctly. Why it sends one and not the other is the mystery. Anyone? [/quote] As you're not specifying $row['email'] anywhere, I'm assuming this is only part of your code, is this whole block inside a while loop? Regards Huggie -
When you say 'adding to the order form', are you storing this information somewhere, like in the database? Regards Huggie
-
Your problem is in your form... Change this: [code]<input type="text" size="20" style="font-size: 10px;" />[/code] To this: [code]<input type="text" name="email" size="20" style="font-size: 10px;" />[/code] You didn't put the name in the form, so this line: [code=php:0]$email=$HTTP_POST_VARS['email'];[/code] is looking for a field named 'email' and it isn't getting passed one. Regards Huggie
-
This isn't a php question, it's an HTML question, but I believe you can use the [color=green]<base>[/color] tag. [code]<base href="http://www.mydomain.com/images">[/code] Here's a [url=http://www.wdvl.com/Authoring/HTML/Head/base.html]further reference[/url] to it. Regards Huggie
-
This will never work unless you set $numrows outside the while loop first, as this condition [code=php:0]while ($numrows > '0')[/code] will always be false. Also, it helps if you tell us what you're trying to do ;) Regards Huggie
-
I need to modify a script (xml parser) to parse a new XML format.
HuggieBear replied to adrianTNT's topic in PHP Coding Help
Apart from the commented out section at the bottom of the page, I can't see any 'tag-specific' code in there, so I'd have thought that it should just work with the new XML too. Regards Huggie -
I think you're right about the semi-colon... I think this: [code=php:0]tep_draw_hidden_field('PBX_IDENTIFIANT', 'xxxxxx'); [/code] Should be: [code=php:0]tep_draw_hidden_field('PBX_IDENTIFIANT', 'xxxxxx') . // notice the period, instead of semi-colon [/code] Regards Huggie
-
Destruction is right about the 'id' column, it doesn't exist, as for the mysql_fetch_array(), there's nothing wrong with the way you have that. It will return both a numeric and associative array. I don't know what the performance overhead on that is, but I always use mysql_fetch_array($result, MYSQL_ASSOC) as opposed to on its own. I believe it's faster to retrieve as just a numeric array, but I can't remember (MYSQL_NUM). Also, your code looks ok, so can you post your form. Regards Huggie
-
[quote author=bfisher link=topic=111907.msg453803#msg453803 date=1161182085] but since I'm on IIS, I can't use the $SERVER_ADDR global variable. [/quote] I'm assuming you mean [code=php:0]$_SERVER['SERVER_ADDR'] [/code] Why can't you use that? Regards Huggie
-
Try something like this for your table... [code] <?php // Open the table echo "<table width=\"300\" cellspacing=\"0\" cellpadding=\"3\" border=\"1\">"; // Loop through each instance in the array foreach ($a as $key => $value){ echo "<tr><td width=\"300\" align=\"center\">{$a[$key]['some_ID']}</td></tr>\n"; // Echo the table rows } // Close off the table echo "</table>\n"; ?> [/code] Regards Huggie
-
You need a foreach loop... [code]<?php foreach ($a as $key => $value){ // Do something with some_ID echo "{$a[$key]['some_ID']}<br>\n"; } ?>[/code] Regards Huggie
-
getting error when trying to get row count for pagination
HuggieBear replied to simcoweb's topic in PHP Coding Help
ok... That makes sense, disregard what I posted in the early hours of this morning, I thinks it's only serving to confuse matters further. ;D Take the code that you have on page [color=green][url=http://www.plateauprofessionals.com/category-page2a.php?categoryid=4]category-page2a.php[/url][/color] as that code is almost right, and then just change the link at the bottom from this: [code=php:0]echo "<a class=\"body\" href=\"".$_SERVER['PHP_SELF']."?page=$i\">Page $i</a> "; [/code] To this: [code=php:0]echo "<a class=\"body\" href=\"".$_SERVER['PHP_SELF']."?categoryid=$cat_id&page=$i\">Page $i</a> "; [/code] and I think we'll finally be there. Regards Huggie -
I was looking at the code at the top of the page, I know I'd seen it somewhere. Regards Huggie
-
That's not the problem, there's two functions, one called [color=green]validatename()[/color] and the other called [color=green]validate_name()[/color] Regards Huggie
-
What do you mean 'pass a result into this'.... The code you've pasted isn't a function. I'm not sure exactly what you're after with this. Regards Huggie
-
Can you provide all of the code for the page that's causing issues. Regards Huggie
-
Look at $_FILES and [url=http://uk.php.net/manual/en/features.file-upload.php]handling file uploads[/url] in the PHP manual. Regards Huggie
-
[quote author=xsist10 link=topic=111865.msg453647#msg453647 date=1161162066] To set cookies you need to start a session. Put this at the top of your code before cookie creation: [code] <?php session_start(); ?> [/code] [/quote] I thought this was the case but when I re-checked the documentation I couldn't find anything about it. Regards Huggie
-
Try this then... [code] <?php error_reporting(E_ALL); setcookie("test","this is a test"); foreach ($_COOKIE as $k => $v){ echo "$k - $v<br>\n"; } ?> [/code] Regards Huggie
-
Your back button isn't going back, it's reloading the page... Try this: [code] <input class="databut" type="button" value="Back" onClick="history.back()"/> [/code] Regards Huggie
-
Sessions are going to be needed for that one, but don't worry, it shouldn't be too much overhead getting that done. Regards Huggie
-
getting error when trying to get row count for pagination
HuggieBear replied to simcoweb's topic in PHP Coding Help
[quote author=simcoweb link=topic=111171.msg453610#msg453610 date=1161156875] Unfortunately it's not paginating correctly. It just wants to display 5 results when there's 14 in the category. :( [/quote] I might be completely loosing the plot here, and if I am then somebody please shoot me as this is driving me insane, but the whole point of the pagination is that it only shows 5 results on the page, not 14! If you click on your [url=http://www.plateauprofessionals.com/category-page2a.php?categoryid=4]link[/url] up at the top of this page, it works fine, then when you click page 2 it doesn't work, but the link to page 2 is incorrect, as it doesn't contain the 'categoryid' in the URL. Try this link to [url=http://www.plateauprofessionals.com/category-page2a.php?categoryid=4&page=2]page 2[/url] and then this link to [url=http://www.plateauprofessionals.com/category-page2a.php?categoryid=4&page=3]page 3[/url]. Have you made the modifications to the links that I suggested so that they include the 'categoryid' in the URL? Regards Huggie