Jump to content

teddyb

Members
  • Posts

    19
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

teddyb's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Your script sends a message when the form is first requested too?
  2. http://php.net/manual/en/function.trim.php
  3. You either want to md5 the password after checking it (better) or have <?php if ($password != "d41d8cd98f00b204e9800998ecf8427e") { //run query }
  4. i think your problem lies with the fact that the md5 of the empty string is d41d8cd98f00b204e9800998ecf8427e so $password contains that string after <?php $password = md5(clean_up($_POST['password'])); also isset will return true for the empty string
  5. You could do it using the form like <html> <head> <title></title> </head> <body> <form action="http://www.abc.in/smsapi/sendsms.php" method="get"> telephone:<input type="text" name="sendto"> message:<input type="text" name="msg"> <input type="submit" name="" value="Send Message"> </form> </body> Or if you want it to go to your own script which then makes the request you would have something like this If curl isnt installed: <?php if (isset($_POST['sendto'])) { $sendto = $_POST['sendto']; } if (isset $_POST['message']) { $message = $_POST['message']; } //Do some validation on input $api_address = "http://www.abc.in/smsapi/sendsms.php" get_headers($api_address.'?'.'sendto='.$sendto.'&msg='.urlencode($message)); if it is <?php if (isset($_POST['sendto'])) { $postdata['sendto'] = $_POST['sendto']; } if (isset $_POST['message']) { $postdata['message'] = $_POST['message']; } //Do some validation on input $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://www.abc.in/smsapi/sendsms.php"); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata); curl_exec($ch); curl_close($ch); I havent tested this code but it *should* /hopefully/ work
  6. woops sorry, i renamed a variable and forgot to rename it somewhere else <?phpforeach ($number_of_results as $class => $number_of_class) { echo $value . " Class " . $class; echo "<br />"; } Should be <php foreach ($number_of_results as $class => $number_of_class) { echo $number_of_class . " Class " . $class; echo "<br />"; } i initially had the foreach as $key => $value but decided they were terrible variable names
  7. You could do this <?php $output = array(); if ((!isset($_POST['state'])) && (($_POST['country'] != $r['country']) || ($_POST['city'] != $r['city']))) { $details = $_POST['city'].', '.$_POST['country']; update_user_actions(1, $details); $output[] = "City and Country Changed"; } else if ((isset($_POST['state'], $_POST['city'])) && (($_POST['state'] != $r['state']) || ($_POST['city'] != $r['city']))) { $details = $_POST['city'].', '.$_POST['state']; update_user_actions(1, $details); $output[] = "City and State Changed"; } if ((isset($_POST['credentials'])) && ($_POST['credentials'] != $r['credentials'])) { $details = ''; update_user_actions(2, $details); $output[] = "Credentials Changed"; } if ((isset($_POST['specialties'])) && ($_POST['specialties'] != $r['specialties'])) { $details = ''; update_user_actions(3, $details); $counter++; $output[] = "Specialties Changed"; } if ((isset($_POST['personalweb'])) && ($_POST['personalweb'] != $r['personalweb'])) { $details = $_POST['personalweb']; update_user_actions(4, $details); $counter++; $output[] = "Personal Web Changed"; } if (empty($output)) { echo "No modifications made"; } elseif(count($output) == 1) { echo $output[0]; } else { echo "Profile Changed"; } But its not the best way of doing it, but it does mean you dont have to restructure your entire script
  8. KDM, that will most likely not work as it will come accross the first <? in <?xml version="1.0" encoding="UTF-8"?> and go into interpret mode
  9. <?php function documentType(){ echo <<<HEREDOC <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ` ` "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> HEREDOC; } ?> you included the bracket for closing the function in your string
  10. what does update_user_actions(); do? does it echo what the users just updated or does it just make db modifications?
  11. exit() stops execution of the script so whatever echos / html you have after it wont be done, you need to either echo the closing tags before it or in it like exit('</body></html>'); or have a condition in such a way that you dont need to exit but the condition around outputting the form fails on the 2nd request
×
×
  • 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.