ignace
Moderators-
Posts
6,457 -
Joined
-
Last visited
-
Days Won
26
Everything posted by ignace
-
because you print_r() it all you need to do is: $about_us0 = $chunkedArr[0]; // will give you the first part print_r() is to loop over an array recursively notice the r in print_r
-
how to enable windows login dialog in php/apache
ignace replied to sunilvadranapu's topic in PHP Coding Help
what iis basically does is changing the header when you access a certain folder, in apache you don't have such tabs, but you can mimic it by setting the same header in your php script, here's an example: http://be2.php.net/features.http-auth -
i can have a big massage anytime <form action="search.php?advns=<?php echo $advns; ?>" method="post" enctype="application .. this may be a bit strange for you, but you are able to receive get on a HTTP POST request, the other way around however does not work! else { $mov="mov"; $gam="gam"; $app="app"; $mus="mus"; $ebook="ebook"; $exp="exp"; ?> <div id="backgeounsd"> <input name="advns" type="text" class="seachc" value="<?php echo $advns; /* you forgot the $ */ ?>" /> <td width="40"><img src="LeftTablepart.png"/></td> <td width="501"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="table"> <a href=" <?php echo $_SERVER['PHP_SELF']; /* you forgot to echo it */ ?>/realysite/search.php?DlID=<?php echo $row["ID"]; ?> "> <?php if($search !="" and $advns != 1){ /* you wrote and if ($advns != 1) */
-
why are you using recursion? is every line within your $filename a real path on the filesystem? i guess not as file(<html>) appears try: function processFile($filename) { $lines = file($filename); $returnArray= array(); foreach ($lines as $line) { list($title, $value) = explode(",", $line); $returnArray[]='<tr><td>Title:</td><td>'.$title.'</td><td>Value:</td><td>'.$value.'</td></tr>'; } } return $returnArray; }
-
$get = $_GET['deleten']; // if not set in the url a null value will be set for $get; if ($get !== "") // null !== ""(string) thus execute what is on the next line
-
Content display system? Template system? Help me please.
ignace replied to matthewhaworth's topic in PHP Coding Help
Ever had a look at the smarty library? http://smarty.php.net You sound a bit like me, being picky and everything and not liking bad techniques i really could find myself in the zend framework http://framework.zend.com, go and have a look, maybe it works out as great as it did for me btw being picky just means where perfectionists -
I am using the zend framework as well and have some good background in it, pm me and i will help you get a full setup
-
are you working with multiple database connections? cause if anyone would care to read a manual they would notice that mysql_query() actually have 2 parameters, so try adding the db connection resource (optional is only to be used when you in no way are able to write the parameter): $query = "INSERT INTO .."; $result = mysql_query($query, $dbConnection); if (!$result) die(mysql_error());
-
http://be.php.net/manual/en/book.pdf.php
-
or just write <input type="checkbox" name="check[]" value="1" /> in php you could access it in this manner: <?php echo $_POST['check'][0]; // 1 ?>
-
if ($_POST['user'] == $user_print) will never be correctly evaluated because at that point $user_print has not declared and is therefor converted to NULL so only when $_POST['user'] is NULL or equivalent the statement will pass
-
You just want to validate the filesize of the file on the remote against the size of the local file? $filesize1 = filesize($file1); $filesize2 = filesize($file2); if ($filesize1 !== $filesize2) { if ($filesize1 < $filesize2) { /* second is bigger */ } else { /* first is bigger */ } } btw, are your sure this is correct? $goforit = ftp_get($conn_id, $file, $file, FTP_BINARY); // should translate to ftp_get(1, "c:/users/file.bla", "c:/users/file.bla", 2); notice the bold markings
-
Basic: http://be.php.net/manual/en/ref.classobj.php Advanced: http://be.php.net/oop5.reflection
-
$lines = file("path/to/file"); foreach ($lines as $line) { echo $line . "<br />\n"; }
-
This is what you are looking for: <img src="image.php?file=2" width="64" height="64" />
-
stripslashes()
-
what you need is a bootstrap file which acts as a frontController: $page = $_POST['page']; $title = "Default Title"; $file = "index.php"; switch ($page) { case "development": $title = "Development title"; $file = "development.php"; break; default: $title = "Default Title"; $file = "index.php"; break; } if (!file_exists(PAGES_DIR . $file)) { $file = "index.php"; $title = "Default Title"; } include_once "header.php"; include_once PAGES_DIR . $file; include_once "footer.php";
-
you are in serious trouble: http://www.phpfreaks.com/forums/index.php/topic,37442.0.html
-
the code is from eCommerce i have been writing templates for it
-
table: users (id, firstname, lastname, ..) table: songs (id, user_id, name, ..) // get user id $userid = $_SESSION['id']; mysql_query("insert into songs values (null, '$userid', '.. // preferably you would be using prepared query strings instead of this
-
validate using: http://be.php.net/manual/en/book.ctype.php filter using: http://be.php.net/manual/en/book.filter.php
-
[SOLVED] Teach me a thing or two about PHP security?
ignace replied to unsider's topic in PHP Coding Help
you are already on the MUST be forum, can't believe you missed this great article: http://www.phpfreaks.com/tutorial/php-security -
if (mail(..)) { header("Location: thankyou.php"); }