oni-kun
Members-
Posts
1,984 -
Joined
-
Last visited
-
Days Won
1
Everything posted by oni-kun
-
I'm not sure what you mean. Do you want to NOT display the 'you have ordered.....' part unless they actually do? <?php $FullPallet=$_POST["FullPallet"]; $QuarterPallet=$_POST["QuarterPallet"]; $DeliveryType=$_POST["DeliveryType"]; $DeliveryFrom=$_POST["DeliveryFrom"]; $DeliveryTo=$_POST["DeliveryTo"]; ?> You should put them in a POST to void user modification.. htmlspecialchar is smart to.. unless you want the user to be able to change something in the GET requests and mess with the order.. <form name="myform" method="POST" action="domestic.php"> And simply.. if (isset($_POST['FullPallet'])){ echo "Hello, You have queried an order of $FullPallet full pallets and $QuarterPallet quarter pallets. The delivery is from $DeliveryFrom and is going to $DeliveryTo. This is a ".$HTTP_GET_VARS['DeliveryType']."delivery." } else { echo "Pleas enter form."; }
-
You're using some XML HTTP Request object library in PHP? I'd start and use javascript, since user login -> user page can be direct login.php -> checklogin.php checklogin.php -> user.php Your PHP method doesn't look like it could without header()...
-
You can detect their real IP usually by the X_FORWARDED_TO or whatnot HTTP variable to check if someone who was banned before comes back via proxy.. but proxy wise, I'm on one now, I seemlessly use it without knowing, many people have things such as torbutton, or for example one from India cannot browse some sites without it. If you're worried, not let people view certain pages with proxies, or only allow one to sign up with a non-proxy address, then they can use a proxy. That seems fair and very helpful to them and you, right?
-
You can make the login POST the current page when logging in, or use a get variable such as .. login.php?ret=this. A cookie would also be a wise thing to look into, they are much simple. HTTP referrers are never reliable, and most of the time do not set, I've not really seen many sites use the referrer to send them back.. since it could be spoofed into something or not reliable at all..
-
In your code, you may want to impliment a trigger. such as ... if (!isset($_GET['nosb'])) { echo sidebar stuff } So http://govbuzz.com/index.php?page=362641&nosb=1 would not place the sidebar within the code, I've actually used this method as it's simpler than the rest.... I'm sure i've seen other sites use tricks such as this, for ease of implimentation.
-
In the IF you have to define each statement, you can't use OR operator to repeat them. if($_POST['Species'] != 'Alien' || $_POST['Species'] != 'Predator' || $_POST['Species'] != 'Marine'){ Or else it'd just appear as.. 'if("Preditor")' and that'd be invalid to parse.
-
I'm not sure quite what you're doing in your code, but you'd do this. if (isset($_POST['Login'])){ $pass = $_POST['Login']; if ($pass != $user['pass']) { //some way to pull the pass outta SQL echo "You have entered the wrong password!"; } }
-
I'm not sure in the page exactly but Wordpress uses a template system.. the functions such as: bloginfo('url'); bloginfo('name'); bloginfo('description'); Are basically what echo on the page the name of your site, the post name, and desc etc. So find where you're wanting to remove blog_name, and remove..... bloginfo('name') or similar, whatever wordpress defined to call its name.
-
Well lets try to fix your code, tell us all the results/errors you receive. <?php if(!$_SESSION['userid']) { echo '<p align="right"> <img src="http://www.awortinkos.com/realgame/styles/pm.png"><b> <font color="#FFFFFF">PM '. $newpm .'</font></b> <img src="http://www.awortinkos.com/realgame/styles/invite.png"> <b> <font color="#FFFFFF" face="Verdana" size="2">friends '. $newfr .'</font></b></p> </head> <body>'; ?> Wait.. Why is your PM code in <head>? It won't show..place it in body.. You can only do it something like this.. <?php if(!$_SESSION['userid']) { echo '</head><body><p align="right"> <img src="http://www.awortinkos.com/realgame/styles/pm.png"><b> <font color="#FFFFFF">PM '. $newpm .'</font></b> <img src="http://www.awortinkos.com/realgame/styles/invite.png"> <b> <font color="#FFFFFF" face="Verdana" size="2">friends '. $newfr .'</font></b></p>'; ?>
-
You're using single quotes for the HTML. If you wrap HTML in a single quote, only use double quotes such as.. '<font color="#FFFFFF">'; And not: '<font color='#FFFFFF'>';
-
Use a thumbnail script. such as it'd link like.. <img src="thumbnail.php?vid=304923"/> and problem solved!
-
Interesting and should be easy but... help... LOL
oni-kun replied to cowboysdude's topic in PHP Coding Help
Well, like this kinda? <a href="#" onclick="toggle('videobox'); SetVid('cat') ">Cat video</a> But all in all this isn't really a php problem.. If you're wanting to do it in PHP, redirect to video.php?video=cat, and you can do.. if $_GET['video'] == "cat" { echo '<embed bla video=cat.swf/>' } but it'll refresh the page, if no $_GET[''] is shown you can keep the vid box invisible.. aka not echo it. -
Interesting and should be easy but... help... LOL
oni-kun replied to cowboysdude's topic in PHP Coding Help
I don't get what you mean, How about writing it so the menu appears, and use javascript to show the video section as collapsed or 'hidden', when one clicks an item on the menu, it'll call onClick and activate the video box div with said variable.. 'onClick = "loadVid;var vid=bla;" ' -
if (!isset($_POST['e-mail']) || !empty($_POST['e-mail'])) { $e-mail = $_POST['e-mail']; } Basically like that, so it'll only list or assign the e-mail variable if it is not empty in the database, if it is empty then it'll skip the code completely.
-
You can use the header such as this, it'll be easier in the long run.. // refresh / redirect to an internal web page header( 'refresh: 5; url='.$_SERVER['PHP_SELF'] ); echo '<h1>You will be re-directed in 5 seconds...</h1>'; Of course the '5' may become a '0' in case you don't want it to wait. Use ob_start() at the beginning of your code if you wish to use this later on in a page.
-
Like this? .. if (!empty($address1) || !empty($address2)) { echo "Here they are.... $address1 + $address2"; } else { //do nothing, or display a warning that one is blank. }
-
Try this code. <?php If(isset($_SESSION['Current_User'])) { echo '<a href="contactus.php">Contact Us</a> |'; } If(isset($_SESSION['Current_User']) && !(isset($_SESSION['Staff']))){ $Get = mysql_query("SELECT UserID FROM staff WHERE UserID='".$_SESSION['Current_User']."'") or die(mysql_error(); If(mysql_num_rows($Get) > 0){ //FROM HERE $_SESSION['Staff'] = 1; }Else{ $_SESSION['Staff'] = NULL; } } If(isset($_SESSION['Staff']) && $_SESSION['Staff'] == 1) { echo '<a href="staffpanel.php">Staff Panel</a>'; } ?>
-
Session is not available in different browser
oni-kun replied to deecee2000's topic in PHP Coding Help
What are you meaning? Go into IE, clear cookies and go to file1.php FIRST, and then file2.php. If you're going to file2.php directly from IE than there is no session set! Your code is correct for sessioning... -
I'll assume by that you mean spam, Then no. You'll have to run checks your self to make sure that one is entering a legitimate submission, although this isn't the easiest thing. If you're getting that from a spambot, disallow bots and add a simple.. 'What is 4+2?' question, I did that on mine since CAPTCHA was becomming annoying to use..
-
Give us $stepd's contents? Stripslashes only removes the escape character '\' once. This should replace all and be UTF safe.. <?php preg_replace(array('/\x5C(?!\x5C)/u', '/\x5C\x5C/u'), array('','\\'), $string); ?> You can use str_replace() as well alongside without much effort.
-
I doubt the GD library could handle such complex things..
-
It should be like this, if you use the above suggestion. $chickens[0]=> 12 $chickens[1]=> 1 $key = array_search('12', $chickens); // $key = 0; $key = array_search('1', $chickens); // $key = 1;
-
Javascript is a CLIENT SIDE scripting language and cannot interact with PHP like this. You'd need to use this to redirect.. Birmingham.php: <?php header('Location: '.$_SERVER['SERVER_NAME'].'/seach.php?city=birmingham'); ?> Like so.. Which'll automatically redirect them.
-
First of all make sure your SMTP server is not in the black lists, also make sure your FROM: header is not too long.. I noticed on mine, when I had '[email protected]' it was marked as spam, because phishers would normally use long domains for fraud. As for your code not appearing.. $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n"; You need to add those headers to show it as an html form, so the mail client won't convert it to entities..
-
Well try this, you're just asking it to say NULL instead of actually nulling it out. foreach($_POST['Activity'] as $row=>$Act) { $Activity=($Act); $Position=($_POST['Position'][$row]); $StartDate=($_POST['StartDate'][$row]); $EndDate=($_POST['EndDate'][$row]); $involv = "INSERT INTO Involvement (Activity, Position, StartDate, EndDate) VALUES ( if isset($Activity){echo '$Activity';}, if isset($Position){echo '$Position';}, if isset($StartDate){echo '$StartDate';}, if isset($EndDate){echo '$EndDate';} )"; That'll not place it into the database if it is not set..