I need to echo $random in $_GET['do'] == but I don't think it's echoing it.
Code:<?php $random = substr(md5(rand()),0,7); ?> if ($_GET['do'] == "<?php echo $random ; ?>")
How would I echo it?
I need to echo $random in $_GET['do'] == but I don't think it's echoing it.
Code:<?php $random = substr(md5(rand()),0,7); ?> if ($_GET['do'] == "<?php echo $random ; ?>")
How would I echo it?
Last edited by james438; 03-19-2013 at 03:33 PM.
Youre opening the php again within the echo
Also, I'm not sure what you're matching $_GET['do'] with so for arguments sake, I've matched it to $something.Code:<?php $random = substr(md5(rand()),0,7); if ($_GET['do'] == $something) { echo $random; }?>
Focus on Function Web Design
Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps
I should have said that you should ignore the tags right now. But here's what it actually looks like, and I need to echo the $random right after the == just like it is in the instance below:
Code:<?php $random = substr(md5(rand()),0,7); ?> <?php if ($_GET['do'] == ".....I need to echo $random here.....") { if (!$_GET['confirm']) { ob_clean(); header("Status: 410 Gone"); exit; } if (!$is_reported) { $sql = "UPDATE $adtable SET abused = abused + 1 WHERE adid = $_GET[adid] AND abused < " . ($spam_indicator - 1); mysql_query($sql) or die($sql); if(mysql_affected_rows()) { echo "<div class=\"msg\">$lang[MESSAGE_ABUSE_REPORT]</div>"; if($max_abuse_reports) { $sql = "UPDATE $adtable SET enabled = '0' WHERE adid = $_GET[adid] AND abused >= $max_abuse_reports"; mysql_query($sql); } header("Location: $script_url/?{$qs}reported=y"); exit; } } unset($_GET['do']); } ?>
Last edited by james438; 03-19-2013 at 03:33 PM.
Oh, in that case, you can just use the $random variable;Code:if ($_GET['do'] == $random)
Focus on Function Web Design
Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps
Just to clarify, you can not echo anything at that point in your code.
However, I think Beveryleyh figured out what you actually want to do:
correct?
Bookmarks