
steveclondon
Members-
Posts
161 -
Joined
-
Last visited
Never
Everything posted by steveclondon
-
Register Global - in search of a replacement
steveclondon replied to MCrosbie's topic in PHP Coding Help
yes if you use $_GET or $_POST or $_REQUEST it will all still work. -
if this is the one your starting with a select statment instead of an update statement. $query_UpdateCustInfo = "SELECT * FROM Customer"; $UpdateCustInfo = mysql_query($query_UpdateCustInfo, $Conn1) or die(mysql_error()); if you want more help on this start a new post all these pages take time to view
-
Yes as they have pointed out above you should fix all errors and warnings that is why you have it on the test server. You should not have it on the main server you are going to use however.
-
You could give each user an id in the mysql database then have a page like so. member-page.php?user=44 then use a $_GET['user'] to lookup the user and pull the information about the users page out. If you wanted it so they could name there own page such as /stevens-great-page.html or something like that you will need to use Mod-rewrite that will rewrite the url from the html page name to the member-page.php page name. All of this can be done with one script on one page more or less.
-
mmm need to give alot more information than that. If you have the database model done correctly that is the major part of this anyway. Which bit you stuck on
-
Your php ini file. If you have wamp you can look for this by left clicking on the icon near your time for wamp. Then go to the config files. You should only have all errors and warnings showing on a test server
-
Hi, Its simple. Your making the mail into the $mailer->Body so all behind the = sign must be in either ' and end in ' or " and end in ". So when you want to add the Dear at the end you should get ride of the <?php sign and the " and have something like this. </p>Dear '. $first. '<br/>';
-
Would be a help to know if you get the table made first and if so what are the values of each field. If you do not get the table made then at least it is clear that this is the first query. Out of interest can you not have a main table with the user id that will then link to another table with this user data so you do not have to create the new table or is there some other reason such as the number of users you intend to have that means you are going for this route.
-
Just had a quick look and for a start you have a $_POST directly in your query. You should really set this value first as a normal variable then enter it along with ' ' or convert first to an int as you will normally find that mysql might think the value is a var. I would have a better look but alot of the html go in the way. If you can do a more simple code with just the php and basic html it would be easyier to look at as i don't know long. I take it that it is a list of check box each with an number value that if the user checks and posts this value will be deleted. Just looking at your code I would also add after the mysql_query($sql) or die(mysql_error()); I think you have an error in your sql because of the post and no quotes around that value. This should let you know as it will echo it to the screen.
-
Pop-up page for empty results search - the saga continues
steveclondon replied to bladechob's topic in PHP Coding Help
Yes that should be $resultab instead of $result. A good idea when doing this sort of thing is to seperate it as follows. $rows=mysql_num_rows($resultab); echo $rows //for test purpose get rid of when live if ($rows==0) { // do what you want here. } -
One thing to keep in mind with this is that even if you are on broadband you do not always get your own ip address. Providers normally give you an ip address on connection and this can change. Unless you know 100% for sure that you always have the same ip address on different connections I would not use this method. Also you can have more than one user using the same ip address.
-
Do you mean export to excel or just display in the browser in a table.
-
Is this general spam or can you press the post button more than once and it enter multple posts into the database. There are a number of easier ways to stop this from happening rather than use a time method which is a bit more involved. Also consider having a user login before they can reply to these as that will eliminate all the spam in the first place unless it is a user that is doing it.
-
I have just scanned through what you have written. I would have a more detailed look if you list your tables so I see the structure of the data. Could you not use the GROUP BY to get rid of the duplicates
-
don't know what you really want to do, explain a little more. surely if it is http: or an @ it will already be a link. Do you mean search other peoples sites your scripts????
-
I can't think of a good title, so my threads get locked
steveclondon replied to Ninjakreborn's topic in PHP Coding Help
I would say you have left out a closing brace. I use php edit you can select the first brace and it will high light in red the second. You can then check which ones missing which will be easyier than me checking here without -
you need to have a list of currencies in mysql with exchange rates each should have a batch id as these exchange rates will change. All exchange rates should be against the dollar, you can get these from xe.com. Then you need to test the currency that the user has and pull the latest batch id currency from the currency that they want to convert into. Then use this to calcuate your new currency and x the amount by this value. You will need to do some formating on the result after as you may well have the odd amount of the point after.
-
Products_query is your result from the query not an array. $products is the array.
-
No it isn't really php it is Javascript that you need. The user will select in the first and you need javascript to update the second. You will have to pre-load all of the towns when the page loads unless you use AJAX which is a combination of php and style sheet and javascript. This way by using an invisible frame you can use a get to query the database return only the towns you need and use javascript to pull the list into the next select. It is quite a long and difficult proccess if you haven't done it before.
-
I don't think you will have much to worry about as the two above have pointed out. The important part is where is the information comming from that goes into the switch. Can a user of the webpage alter this information and if the information is altered would this matter to what you are doing. ie alter as in $_GET, $_POST, $_COOKIE
-
oh and this also installs apache as well so everything you need all working. + if you want you can also add php 4 and switch between the two which is handy for doing some work
-
if this is a testing server you might try to download http://www.wampserver.com/en/ this will install php 5 along with mysql all in one go very easy on windows. It is quicker than me trying to go through it all
-
Show/Hide HTML form submit button in PHP
steveclondon replied to j3rmain3's topic in PHP Coding Help
Place this if statment in the bottom of your form and echo the submit button if ($ip ==ipAddress) { ie echo '<input type="submit" ................. } -
using "" as quotes when someone has said something..
steveclondon replied to brown2005's topic in PHP Coding Help
use the escape character. as in \" or use a different quote to echo ie eche ' " ' or echo " ' " -
there are a number of different ways to do that you can either split it by a string part 1 in 1 2 in the other etc. or you can use an array function perhaps to split it. Rather than me go through all of that here you should download the manual in chm format here: http://www.php.net/download-docs.php and then look up string functions. You need the str_pos fuction along with the strlen and the trim fuction if you going to go the string route or lookup array functions. Sorry I don't have time to go through all of this this morning, however you should find all this information now I have given you pointers in the php manual.