sqlnoob
Members-
Posts
173 -
Joined
-
Last visited
Everything posted by sqlnoob
-
depends how many choices the user has. otherwise you could try it with a switch statement or an if-else construction like: $userpassword = $_POST["password"]; if ($userpassword == something) echo "<a href='somelink.htm'>back</A>"; else echo "<a href='anotherlink.htm'>back</A>"; to give you an example
-
Error message to appear inside textbox instead of outside
sqlnoob replied to mikebyrne's topic in PHP Coding Help
OK I see but why do you really want it in an textarea. Does it come with a form so that the person sends it to somewhere? else it wouldn't make sense, you'd just echo it if you didn't need it in a form -
easyhtml it's free and it works fine for html editing
-
Error message to appear inside textbox instead of outside
sqlnoob replied to mikebyrne's topic in PHP Coding Help
like: <INPUT type="text" size="40" name="Description" value="<?php echo $row['Description'];?>"> -
Error message to appear inside textbox instead of outside
sqlnoob replied to mikebyrne's topic in PHP Coding Help
does it really have to be a textarea? Is the description that long? or could it fit inside a textfield? -
why are you so hellbend on doing that? just check if a session, or cookie for that matter is present at the start of the script, if it is not present, then just echo an error message, else show what you normally be showing on the page. It's php remember the server is only spitting out raw html, not the php in the source, so you should be relatively safe.
-
ok well tried it another way and it works now, but it's not exactly the way I want it
-
ok good to hear good luck with your dissertation
-
would this work for you? $insertGoTo = "project_app_complete.php"; if (isset($_SERVER['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $thisinsertGoTo = $insertGoTo . $_SERVER['QUERY_STRING']; } header(sprintf("Location: %s", $thisinsertGoTo));
-
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING']; from w3school: Definition and Usage The stripos() function returns the position of the first occurrence of a string inside another string. If the string is not found, this function returns FALSE. so you're using the first line to see if there is a string am I right? and you use the second line to send a header so that the user goes there, am I right? so why not seperate the second line from the if construction and rename the variable like $thisinsertGoTo = $insertGoTo . $_SERVER['QUERY_STRING']; and then header(sprintf("Location: %s", $thisinsertGoTo)); I'm too much of a noob to know wether this is valid or not
-
ok so it's this bit that's causing the trouble for you right? $insertGoTo .= $_SERVER['QUERY_STRING']; what would happen if you defined it as a new variable and gave it another name and then place it after the } of the if part, but before this header(sprintf("Location: %s", $insertGoTo));[/b] would that work for you?
-
ok so you only want it to insert 8 records, 1 for each player instead of 16 (2 for each player) and also echo a link to another page. Am I right about that assumption?
-
do you want to concatenate? http://www.w3schools.com/php/php_string.asp is the first example there what you're trying to do?
-
I don't see your problem ??? you do this: $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING']; do you want to do this? $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?" . $_SERVER['QUERY_STRING']; I'm not sure what you're trying to do.
-
I think it's because the rowumber for the date is wrong or it could be that you echo it too early anyway try to numrow it -1 instead of 0, maybe that helps. I'm a noob, so don't count your hopes up on my help. Afterall I could be wrong.
-
ah yes I see the date is one row too high
-
I'm doing my site as a hobby, not as something I plan on making a living from, eventhough there's a support page that suggests otherwise. you can see it at www.shugo.nl (registration doesn't work yet) and I'm still busy debugging it but perhaps it will give you an idea on what you want to do for a project.
-
all in all I have 4 css files, about 20 or so htm files and 12 php files. A php file containing no more than 200 lines of code and on average about 50 or 75 lines. My host allows me to have lots of megabytes on his server and use of 10 databases. I only use 1 database and the files total about 250KB in size. so you can say my site is very small for a game site
-
well I don't think my site does all the basics for instance I don't even use sessions, only cookies (I know bad practice). I don't do anything with headers. Basicly it only relies on use of 3 sql tables, 1 containing the data about the players, a 2nd containing data about the territories and a third that contains messages. The first 2 tables are only updated and I never insert anything in those two, only in the table containing the messages (which I don't even update). The attacked.php page is the biggest php page of all, with the most calculations, but the remainder is pretty basic. A simple cart site with sessions has more lines of code than what I have. I make use of mktime() and performs calculations on values I get from the sql tables and I make use of if-else constructions and switch , but that's about it.
-
I myself am quite new at this too. I'm developing a small game website. You know like an mmo. Only my mmo, is more like mo. It's not massive. I'm doing it small, maximum of 32 players. OK so you want to develop a website. What is it that you want to develop? any thoughts?
-
oh btw the password is retrieved from a variable on the page, not from an sql table so while it's indeed a nice code, it wouldn't work for me in this situation. But anyway thanks for trying to help. I'm definitely learning this way.
-
actually it isn't a login page the page "persona.php" has a form with a password field if I submit it to persona.php it supposed to echo an error message if the password is wrong, or echo data from an sql table if the password is correct
-
it doesn't submit at all if it did, it supposed to echo something when in fact it does not
-
define "best"
-
you sure that you stored as a php file and that php is installed where you stored the php file? also can you show me the table where you get the info from