kney
-
Posts
140 -
Joined
-
Last visited
Never
Posts posted by kney
-
-
try this
public function publicSite() { if ($this->getTitle()== 'Home' || $this->getTitle()== 'About Us'|| $this->getTitle()=='Registration' || $this->getTitle()== 'Sitemap' || $this->getTitle()=='Contact Us' ||$this->getTitle()== 'Useful Links' || $this->getTitle()=='Feedback') { return true; } return false; }
-
just to keep topic on top..
-
still no response...
-
Hi,
Here's my problem:
The first 5 or 10 tries it should say "file not found".
After the 10th try it should automatically say "file found".
BUT it should also time out after like 50 tries and it hasn't found the file.
But i don't know how to do this..
I currently have this code:
<?php function respond_xml($status, $message) { $out = new XMLWriter(); $out->openURI("php://output"); $out->setIndent(true); $out->startDocument("1.0", "ISO-8859-1"); $out->startElement("statuscheck"); $out->writeElement("status", $status); $out->writeElement("message", $message); $out->endElement(); $out->endDocument(); $out->flush(); } function main() { header("Content-type: text/xml"); if (!isset($_GET["file"])) respond_xml("ERROR", "File parameter missing"); else if (file_exists($_GET["file"])) respond_xml("OK", "File exists"); else respond_xml("NOT OK", "File does not exist"); } main(); ?>
This code works and gives a correct XML response when you type in for example "http://localhost:8080/php/script.php?file=test" it's says:
<statuscheck> <status>NOT OK</status> <message>File does not exist</message> </statuscheck>
Now, I need it to be able to check it every 5 seconds so i've use this code
header("Refresh: 5; URL=http://localhost:8080/php/script.php?file=test");
-
nobody can figure this out?
-
Just an example
You have certain newsposts in ur database with fields (newsID, date, title, content).
You will also have to have a table with the preferences (so wether you like something or not).. with fields (preferenceID, userID, newsID, like)
The standard value for like = 0..
whenever you press a like button it remembers the user who clicked it, the post itself and changes like to 1.. etc
i hope that helps
-
did you also use the session start on ur first page?
-
yep it's just
<?php // Gotta put this on top of every page btw session_start(); ?> <form action="startregprocess.php" method="post"> username:<input type="text" name="username"> telephone<input type="text" name="telephone" <input type="submit" name="submit"> </form> <?php srand ((double) microtime( )*1000000); $random_number = rand( ); echo $random_number; // just use the new variable on the other page $_SESSION["randomnumber"] = $random_number; ?>
and do this on the other page to get it
<?php session_start(); echo $_SESSION["randomnumber"]; ?>
-
I think you forgot something
<?php $sql = "UPDATE `partners` SET `approved` = 1, `approved_date` = NOW() WHERE `user_id` = '$id'"; // after the previous line, you have to do this next line to update ur table mysql_query($sql); ?>
-
Doesn't it work better like this?
$login="student"; $login="tutor"; if($login == "student"){ header("location: role.php"); }else{ header("location: record.php"); }
Dunno for sure, it's been a lot time since i've done some php
-
<?php $i = "blablabla"; if($i == "blablabla"){ echo "<font color='#FF0000'>Test</font>"; }else{ echo "<font color='#00FF00'>Test</font>"; } ?>
-
-
Hi,
I currently have this code:
<?php function respond_xml($status, $message) { $out = new XMLWriter(); $out->openURI("php://output"); $out->setIndent(true); $out->startDocument("1.0", "ISO-8859-1"); $out->startElement("statuscheck"); $out->writeElement("status", $status); $out->writeElement("message", $message); $out->endElement(); $out->endDocument(); $out->flush(); } function main() { header("Content-type: text/xml"); if (!isset($_GET["file"])) respond_xml("ERROR", "File parameter missing"); else if (file_exists($_GET["file"])) return respond_xml("OK", "File exists"); else return respond_xml("NOT OK", "File does not exist"); } main(); ?>
This code works and gives a correct XML response when you type in for example "http://localhost:8080/php/script.php?file=test" it's says:
<statuscheck> <status>NOT OK</status> <message>File does not exist</message> </statuscheck>
Now, I need it to be able to check it every 5 seconds so i've use this code
header("Refresh: 5; URL=http://localhost:8080/php/script.php?file=test");
Here's my problem:
The first 5 or 10 tries it should say "file not found".
After the 10th try it should automatically say "file found".
BUT it should also time out after like 50 tries and it hasn't found the file.
But i don't know how to do this..
How to check an array for a matching string and return true - Newbie help
in PHP Coding Help
Posted
Thanks ..
I didn't know how to use arrays anymore, that's why the 'crappy' reply