
per1os
New Members-
Posts
3,095 -
Joined
-
Last visited
Everything posted by per1os
-
how can i turn an arry of objects into a multidimensional array
per1os replied to emehrkay's topic in PHP Coding Help
To be honest with you, I would love to see working code of this. I tried doing a few category recursion scripts with no luck. I can drilldown to the 3rd one but after that its all posh. If you do find the answer please post it here as I would be interested in seeing the code. --FrosT -
moving a file to a directory by showing clicking a thumbnail
per1os replied to mrheff's topic in PHP Coding Help
Why is $_GET encapsulated in single quotes? not necessary and is probably causing problems. <?php $file = $_GET['filename']; $dir = $_GET['direcotry']; ?> That may be half of your problem, where does that get you? If no where what errors are coming up? --FrosT -
[SOLVED] Trouble matching up fields in different tables
per1os replied to ShopMAster's topic in PHP Coding Help
You want to echo, $num_results not $result. --FrosT -
[SOLVED] Is there a way to get { to work in this email?
per1os replied to silentg0d's topic in PHP Coding Help
I think he just wants it to display in the email text, not to process the variable. If so my code above should work. --FrosT -
You can always do something like this: <?php echo $copyRight = str_replace("<a href=\"theirsite.com\">Link Here</a>", "Link Title Here", $SystemInfo->CreateCopyright("PHP RealEstate", 'txt_content01')); print $copyRight; ?> On that note, this should not be used to remove copyright fully and if in the template it may check that string against the original so it may not work. --FrosT
-
On that note, you shouldn't change copyright if you did not create the script or pay for the copyright removal of the script. --FrosT
-
how can i turn an arry of objects into a multidimensional array
per1os replied to emehrkay's topic in PHP Coding Help
This is fun stuff, If you can create (write out your own) array definition that would be helpful than I can show you how to do it automatically. tarun, a multi-dimensional array is an array within an array, for example: $multDimArr = array("array1" => array("multiArr" => 1)); That is a multi-dimensional array. To access "multiArr" you would do this: $multDimArr["array1"]["multiArr"] which contains "1". --FrosT -
PEAR has the base code to do it. Without that base it is impossible, sorry bud your SOL. --FrosT
-
[SOLVED] Trouble matching up fields in different tables
per1os replied to ShopMAster's topic in PHP Coding Help
The result returned a resource id. To get data you need to use mysql_fetch_array or mysql_fetch_assoc IE: <?php $res = mysql_query($query); while ($row = mysql_fetch_array($res)) { //processing here } ?> --FrosT -
You have to request it through your host. You can check if PEAR is installed by a phpinfo.php file and looking there. If it is not you have to request it without SSH access to the server. --FrosT
-
You should post the end result here for everyone else to see, as I lost it. --FrosT
-
If you do not know the difference than you do not need to know. If you want to know search google for "frontpage sucks" http://www.google.com/search?hl=en&q=frontpage+sucks&btnG=Google+Search I am sure you will find plenty of good articles on why it sucks. All in all, learn html (not hard at all) and CSS and than code your own pages via Notepad. Notepad has never failed me once. EDIT: On top of that this is not a php related question, probably should be directed to a Frontpage forum or HTML forum. Even though the page me be "php" the flaw is in the design via html coding. --FrosT
-
if (isset($_POST["submit"'])) { Removed the extra single quote, try this. <?php if (isset($_POST["submit"])) { $firstname = $_POST["firstname"]; $lastname = $_POST["lastname"]; if (!empty($firstname) && !empty($lastname)) { Header("Location: inputsuccess.php"); } else {$error = true;} } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>This is (Recursive) Input Validation</title> </head> <body> <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <?php if ( $error && empty($firstname) ) { echo '<span style="color:red">'; echo "Error! Please enter a first name.</span> "; } ?> First name: <input name="firstname" type="text" value="<?php echo $firstname; ?>" /> <?php if ($error && empty($lastname)) { echo '<span style="color:red">'; echo "Error! Please enter a last name.</span> "; } ?> Last name: <input name="lastname" type="text" value="<?php echo $lastname; ?>" /> <input type="submit" name="submit" value="Submit" /> </form> </body> </html> --FrosT
-
the <?=$varname;?> should only be used outside the <?php tags, if you are working inside those tags all you have to do is this: <?php if (isset($_POST['email']) { $emailDisp = $_POST['email'] } echo '<form action="login.php" method="post"> <fieldset> <p><b>Email Address:</b> <input type="text" name="email" size="20" maxlength="40" value="'.$emailDisp.'" /></p> <p><b>Password:</b> <input type="password" name="pass" size="20" maxlength="20" /></p> <div align="center"><input type="submit" name="submit" value="Login" /></div> <input type="hidden" name="submitted" value="TRUE" /> </fieldset> </form> </p> '; ?> --FrosT
-
Yep listen to Paul, that should work good. Sorry for not catching that, just missed it. Good catch Paul. --FrosT
-
Try this and report the error: <?php mysql_query("UPDATE vbb_forums SET $lastpost_auth = lastpost_auth, $laspost_datetime = lastpost_datetime, $lastpost_thread = lastpost_thread WHERE fid = $fid") or DIE(mysql_error()); ?> --FrosT
-
It is impossible, but a first step is to toss frontpage. Seriously go with Dreamweaver or even Notepad work 1000x better than frontpage. For the most part you would either have to do a screen res check with javascript and display a stylesheet that fits it. Either way this is an HTML question, not really a php question as PHP really has nothing to do with it. --FrosT
-
If there ar template files, check there. If not that is located in the SystemInfo class under the Copyright function. If it is encrypted than you cannot change it without doing some manipulation, but if it is not encrypted look for the class Systeminfo (or whatever that variable was instantiated to.) --FrosT
-
[SOLVED] Trouble matching up fields in different tables
per1os replied to ShopMAster's topic in PHP Coding Help
the column Match must be a reserved word in MySQL either use this query: $query = "SELECT COUNT(*) FROM feedback where `match` = ".mysql_real_escape_string($_GET['chid']); or change the column match name to srchmatch or something similar. --FrosT -
<?php $sql = "SELECT id FROM tableName ORDER BY id ASC LIMIT 1"; $qu = mysql_query($qu); $id = mysql_fetch_array($qu); $id = $id[0]; ?> --FrosT
-
lol <?php if (mysql_affected_rows() == 1) { print '<form name="frmName" action=page.php><input type="hidden" name="jack" value="1"> <input type="text" name="txtMe" value="" /></form>'; }else{ print '<table><tr><td>Column here</td><td>other column here</td></tr></table>'; } ?> Simple as that my friend, note echo/print are interchangeable. --FrosT
-
The best bet is to use the mysql_insert_id(); function. See below for reading on that. http://us3.php.net/manual/en/function.mysql-insert-id.php --FrosT
-
[SOLVED] Trouble matching up fields in different tables
per1os replied to ShopMAster's topic in PHP Coding Help
First of all using get data straight in a query is never a good idea due to SQL Injection, always mysql_real_escape_string that data. Second Numbers should not have single quotes around them in mysql, it can produce weird results sometimes. If you know the field is an integer do not encapsulate it in quotes. Third, let's see if an error is being produced to do this you need something like below. <?php $query = "SELECT COUNT(*) FROM feedback where match = ".mysql_real_escape_string($_GET['chid']); $res = mysql_query($query) OR DIE(mysql_error()); ?> If that didn't work what MySQL error are you getting? --FrosT -
$_POST[$button_name]; Where is the $button_name being set in this? I do not see it called before hand, meaning that $button_name probably is nothing. You need to define that name on this page somewhere. If you do have it defined than remove the single quotes and just use $button_name. <?php require_once('mysql_connect.php'); if (isset($_POST['submit'])) { $x = 0; if ( ! empty ( $_POST[$button_name] ) ){ $x = $_POST[$button_name]; echo "$x"; } else { echo "empty"; } } ?> --FrosT
-
How I came to this was looking at arrays in php.net and found the function array_search looked at it and it told me what it did. php.net solves all your answers! http://us3.php.net/manual/en/function.array-search.php <?php // Part 1: $array = array(2,1,3,4,6,5,7,8,9,10); sort($array); $numToFind = 5; $index = array_search($numToFind, $array); $lower = $array[$index - 1]; $higher = $array[$index + 1]; print "The index of " . $numToFind . " is " . $index . " and the lower Num is " . $lower . " and the higher num is " . $higher . "!"; ?> I will look into the second question now once I figure out what you are trying to say. --FrosT