FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Hopiing for some leads as to what may be wrong in this code
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Hopiing for some leads as to what may be wrong in this code [message #182251 is a reply to message #182248] Thu, 25 July 2013 08:28 Go to previous messageGo to previous message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma:
Senior Member
On 25/07/13 00:27, Twayne wrote:
> Hi all,
>
> I have a seemingly strange thing happening here. I have a contact form
> on one website that works perfectly and that same form with
> appropriate changes, results in an error message during a check of a
> random number (created with mt_rnd() ) on the other site. Both sites
> are located on the same remote servers.
>
> Win 7, PHP 5.3.5, XAMPP local server, standard Unix remote server:
>
> Please consider the following:
>
> Complete form consists of three .PHP pages; no HTML. Entry form, check
> page, mailto() page; pretty standard stuff in that way:
>
> ================
> WORKING CODE ON REMOTE SERVER:
>
> Setting the code on landing page:
> $_SESSION["d"] = $d;
> --------------------
>
> $code= $_POST["code"];
> if($_SESSION["d"] !== $code) {
> echo "<br />You did not enter the correct code: Script halted,
> ALL data destroyed.<br /> you'll have to go back to the website and
> start over.<br />";
> die("Script HALTED, data destroyed");
> session_destroy();
> exit();
> }
> RESULT:
> page throws no error either with local or remote server: Message is
> sent successfully.
>
> ===============================
>
> NON-WORKING CODE ON REMOTE SERVER BUT WORKS ON LOCAL HOST:
>
> Setting the code on previous page:
> $_SESSION["d"] = $d;
> ----------------------
> Page with problem:
> $code= $_POST["code"];
> if($_SESSION["d"] !== $code) {
> echo "<br />You did not enter the correct code: Script halted,
> ALL data destroyed.<br /> you'll have to go back to the website and
> start over.<br />";
> die("Script HALTED, data destroyed");
> session_destroy();
> exit();
> }
>
> RESULT:
> [Gets stuck on the second page of the form where PHP
> sanitize/validation happens; never makes it to last page with the
> mail() function]:
>
> using code : 487-535175 <----------- WHICH IS CORRECT CODE #
I wonder if that's being evaluated as a numerical expression..
> You did not enter the correct code: Script halted, ALL data destroyed.
> you'll have to go back to the website and start over.
> Script HALTED, data destroyed
> ================
>
> Can you spot any differences there? The local server throws NO error,
> notices or warnings. But the Remote Server stops cold on the second
> page, indicating the code is wrong. But it's not; I can see the code;
> it's correct. But it seems to never be seen as correct by my Remote
> Server while my Local Server accepts it perfectly.
>
> What really gets me is it works on one site and not the one I'm trying
> to perpetuate the code to. OH, and both sites are on the same Remote
> Servers at Netfirms.com. Separate accounts of course.
> I'm not using rewrites, no php changes on the Remote Server; both
> sites are on the same server.
> Any thoughts or ideas what I might be doing wrong or where else I
> should be looking?
>
> TIA,
>
> twayne`
When I have had similar issues running phpinfo() on both sites usually
reveals a different php envoironment and gives a clue as to where it's
being set as well.


--
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to lead are elected by the least capable of producing, and where the members of society least likely to sustain themselves or succeed, are rewarded with goods and services paid for by the confiscated wealth of a diminishing number of producers.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Adding (Add - Subtract) values from two different tables to another table
Next Topic: fetch items from a row
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 30 23:38:05 GMT 2024

Total time taken to generate the page: 0.06216 seconds