How is the handshake code of CSS generated.

Dani AI

Generated

Clarification for : here "handshake" means the email verification (double opt‑in) that confirms a new registrant owns the address. CSS cannot do this — as noted it only styles pages — and the networking "handshake" mentioned is a different concept.

Minimal, safe workflow you can implement with PHP:

  1. On registration create the user row with status = "pending".
  2. Generate a secure, single‑use token and store only a hash of it plus an expiry timestamp.
  3. Email the user a verification link that includes the token (and optionally the user id).
  4. When the link is clicked, look up the user, check expiry, verify the token with a timing‑safe compare, set status = "active", then clear the token.

Small PHP example (concept only):

$token = bin2hex(random_bytes(16));             // send this in the URL
$token_hash = hash('sha256', $token);           // store this, not $token
// send link: https://your.site/verify.php?uid=123&token=$token

// In verify.php
if (hash_equals($row['token_hash'], hash('sha256', $_GET['token'])) && time() < $row['expires']) {
    // activate user, remove token
}

Practical and security notes: use prepared statements to avoid SQL injection; use HTTPS so tokens are not leaked in transit; set a reasonable expiry (24 hours); make tokens one‑time use; use a mail library (PHPMailer or similar) with an SMTP provider rather than PHPs mail() to improve deliverability; configure SPF/DKIM/DMARC for your sending domain; and check spam folders and mail logs when emails dont arrive. If you post your PHP code and DB schema in the PHP forum, contributors can point out specific fixes.

Recommended Answers

All 11 Replies

What do you mean by "handshake" code. I'm not an expert in CSS, but I've never heard of such a thing.

Okay my lecturer asked me to come up with a website that has a handshake(this happens when someone logs in then a link is sent to his email address so as when he clicks it,it will take him to the website).

There are networking handshakes, as EvolutionFallen discussed, but they are different from what you seem to be asking for. (A networking handshake really has nothing to do with emailing upon clicking a link). What programming language are you using in class??

CSS is just used to aesthetically style html markup.

Am using PHP.but am using tutorials learning from scratch.

OK so you will want to create an HTML page that has a link, and upon clicking that link, loads up a PHP page that sends out an email. I suggest reading up a bit more and then posting in the PHP forum with what you've tried so far and where you're stuck.

Ok I'll try that.what I want is that when someone registers to the web a link is sent to him or her for verification so that he can click on the link to take him to the website.

Yes, you're going to need PHP to do this. Not CSS.

Okay thanks.let me post this on PHP side.

Hi is there a tutorial I can get n read about this handshake.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.