Jump to content

westonm

Members
  • Posts

    10
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

westonm's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks much guys - got it working now. Using backticks on KEY let it do the update.
  2. Barand - Thanks this seemed to help, it passed the full value of the variable. Didn't update the table but I am a step closer now, at least it is not giving me an error. I have always had a problem with single and double quotes and when to use them or not. Actually had to leave the single quotes on KEY and not put them on %s. I think it needs them on KEY since that is a reserved name. Thanks again, now I can find the next problem.
  3. Sorry - I thought the basics idea would be enough - The actual code is function updtRegist($keyin, $database_Class63, $Class63) { require_once('Connections/Class63.php'); mysql_select_db($database_Class63, $Class63); $updateSQL = sprintf("UPDATE 'directory' SET 'USERNAME'='','PASSWORD'='','Registered'='Yes' WHERE 'KEY'=%s", GetSQLValueString($keyin, "text")); $Result1 = mysql_query($updateSQL, $Class63) or die(mysql_error()); } The calling code is $rtnval2 = updtRegist($keypass, $database_Class63, $Class63); Why can't I do a line feed here? This is just the function and the calling code.
  4. I have been having a problem with a very simple function for about the last 6 hours and it is getting real frustrating. I am quite sure it is a very simple something I am overlooking but I don't see it. If someone could point me in the right direction I would greatly appreciate it. The code is in the attached file: The problem is that I am passing a value of "MaynardWestonA" which is a key to a SQL table. In the function I want to update the record for "MaynardWestonA" but it keeps seeing only "Mayna" in the function- it is dropping the rest of the variable and consequently not finding the record. function updtRegis($keyin) { UPDATE directory SET username='', password='', registered='Yes' WHERE key = $keyin ; } The main program calls the function as follows: $keypass = 'MaynardWestonA' ... rtnvalue2 = updtRegis($keypass); UpdateSnip.txt
  5. Using the magic_quotes functions didn't help. I think I will take another approach and use session variables - maybe I will have better luck getting them to work. I guess we can mark this as solved.
  6. To Pikachu2000 - That could be the problem - All of the other pages in the site were developed with Dreamweaver and has a function to take care of it. I haven't understood exactly what it did but I guess I need to get into that to understand what it is not doing. I had thought the stripslasched function would do the same thing, but maybe not. I am on a shared newtork and do not have access to change php.ini settings, so will have to live with how it is set up now.
  7. Ok sorry - let me try to get this right - here is code Script 1 <form action="dataProcess.php" method="POST" id="Email"> ... <input name="Rtn" type="hidden" value="<?php echo $rtn; ?>" /> Script 2 ... $rtn = ($_POST[Rtn]); ... if ($rtn == "A") { header ("Location: http://www.***.com/foundation/MeetBoard.php"); exit(0); } else { echo "Fall to else "; echo $rtn ; echo gettype($rtn); } The output is coming from the else clause in the if stmt. it reads Fall to else\A\string So it is getting the value of "A" but has the backslashes that I think are preventing it from compaing .
  8. Ok sorry - Am copying the code; Script 1 <form action="dataProcess.php" method="POST" id="Email"> ... <input name="Rtn" type="hidden" value="<?php echo $rtn; ?>" /> Script 2 ... $rtn = ($_POST[Rtn]); ... if ($rtn == "A") { header ("Location: http://www.***.com/foundation/MeetBoard.php"); exit(0); } else { echo "Fall to else "; echo $rtn ; echo gettype($rtn); } Output Fall to else \'A\'string When it works, the else clause will send me off to the home page. Yes I am getting the variable to the second script - The else clause is doing the output of the three lines, showing me it is in the else clause, the value of the $rtn variable and the type. The value of $rtn is showing the backslashes and I am thinking that is why it won't equal to the comparison value of "A".
  9. I can't type very well either - it is actually $rtn = ($_POST['Rtn'])
  10. I am thining this will be pretty simple for someone to help me with, I have been hassling with it for several hours and really feel dumb that I can't get it to work. Here is the problem - I have one script wherein I have a form that passes a variable using Post method. I have previously assigned a value "A" to a variable $rtn the input is: <input name="Rtn" type="hidden" value="<?php echo $rtn; ?> /> In the script that I am calling I first get the value of the variable: $rtn = (_POST['Rtn']); then there is other stuff goin on and I come to an if stmt: if ($rtn == "A" { do some stuff } else { echo $rtn; } It will never get into the do some stuff - it always falls through to the else the output is \'A\' I have tried to use double quotes, single quotes, used stripslasches and addslashes funtions, trim, and various combination of all of these. Nothing I do seem to get me into the first part of the if stmt, to do some stuff.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.