-
Posts
1,216 -
Joined
-
Last visited
Everything posted by WebStyles
-
going back to my original question: (sheer curiosity now that it's 'solved' in many different ways) what exactly were you trying to do ?
-
slashes for links should be forward slashes and not back slashes. echo '<br />'; will insert a line break, but since you're using css, you may not see it. type in that code, execute it then go check the page's source code to see if the break is there. or put it inside one of the divs, before your link: echo '<div class="gameimage"><br /><a href="'.$values[3].'"><img src="'.$values[1].'"></a></div>'; hope this helps
-
nope, there's nothing wrong, (although file_put_contents is the preferred method for writing to txt files). You problem must be with your path to the file or permissions. try a local file first: $LoginFile = "test.xml";
-
that code makes very little sense. what exactly are you trying to do? (in plain english)
-
Encrypt variable is url so I can see it but nobody else
WebStyles replied to sjjs1985's topic in PHP Coding Help
imagine you add another code (salt) to the name before generating the md5 hash... Then how do you track them? You'll either need to store the hash corresponding to each user in a database, or every time you need to find out who is who, you'll need to brute-force your own database to figure it out... This will consume quite a few resources (depending on how many users/traffic you have) so I guess you'll be storing the hash along with each username. now if you get hacked (like you say above) chances are your database will be compromised and the hacker will not only have access to the usernames, but also the corresponding hashes. Again, I don't see the point. I'm assuming youhave the usernames in a database, and that each user has a unique id... why not just use that? you can add a weird hash in the middle for misdirection or something, and even split the user's unique id in 2 just to make it a little bit harder... imagine the user id is 1234 and the hash is b5505263bce3830e4fc57ef8187f77c2 you could split the user id into parts: 12b5505263bce3830e4fc57ef8187f77c234 so you know the first and last characters are your user's id, you could split it into four parts, three parts, drop it in the middle somewhere, etc... It will be easy for you to grab it, and it wont make much sense to an average user. (Still, a hacker will probably figure it out) -
Parse error: syntax error, unexpected T_STRING in
WebStyles replied to fabiez's topic in PHP Coding Help
you need to escape your quotes: print "<td onmouseover=\"showmenu('requests')\" onmouseout=\"hidemenu('requests')\">Requestz"; -
Encrypt variable is url so I can see it but nobody else
WebStyles replied to sjjs1985's topic in PHP Coding Help
I also don't really get the point. if you'll be encrypting simple english names, even though md5 hashes are one-way, it's actually pretty easy to crack them. A name like 'Tom' can be cracked in a few seconds simply by brute force and letter combinations. Also, most common english names already exist in most brute-force dictionaries. -
How to put Form information into a html table
WebStyles replied to MjM8082's topic in PHP Coding Help
same thing: <input type="radio" name="gender" value="Male" /> <input type="radio" name="gender" value="Female" /> On the next page, use: echo $_POST['gender']; -
check out file_put_contents also, check your file's permissions and make sure it's writable by the user that's executing your scripts.
-
select distinct `author` from `table_name` order by `author`
-
if(strpos($user_name, "admin")!== false || strpos($user_name, "moderator")!== false || strpos($user_name, "owner")!== false)
-
PHP Comments System (In dire need of help!)
WebStyles replied to Conphoid's topic in PHP Coding Help
I would do something like this (table structure) COMMENTS: id,comment,author,date,time ANSWERS: id,commentID,answer,author,date,time making sure that the id from table COMMENTS has the same values as commentID from table ANSWERS -
PHP Comments System (In dire need of help!)
WebStyles replied to Conphoid's topic in PHP Coding Help
your idea seems fine, a table for comments, and a table for answers, linked by commentID. all you need is to have stuff in the right order: while(READING EACH COMMENTS){ 1. print first comment 2. check for answers. if they exist print them all. } -
if($_POST) will probably always return true. If you're wanting to detect if something was posted, try something like: if($_SERVER['REQUEST_METHOD']=="POST")
-
Display data from + and - 7 days using curdate.
WebStyles replied to kingsbest's topic in PHP Coding Help
ORDER BY WHAT ? should be ORDER BY FIELDNAME DESC -
I really don't see how that method of calling a flash file will work, nor what the point is (just trying to hide the path to the file?)...
-
if it's always after the first word you could use strpos to detect where the first space is.
-
All you need is date to output the number of days in a given month. example: <?php $month = "february"; echo date("t",strtotime($month)); ?> hope this helps
-
try something like this: $html = file_get_contents('http://home.com/feed/feedfile.aspx'); preg_match_all("/\<product\>(.*?)\<\/product\>/si", $html , $strng); // Reg_ex echo "<table border=\"1\"> <tr><th>Link</th></tr>"; foreach($strng[0] as $url) { echo "<tr><td>"; echo $url; echo "</td></tr>"; }
-
try something like this: $query = "select * from Information where genre like '%$trimmed%' or bandname like '%$trimmed%' order by genre";
-
that depends on how you're creating the files (why not use a database?). You're reading through a directory and adding each file content to an array, if the files are in the correct order in the directory (i.e. from oldest to newest), then all you need to do is reverse the array before displaying. check out array_reverse
-
Info not adding to database despite a success Message
WebStyles replied to davidjones1990's topic in PHP Coding Help
Just want to point out the following: You're including scripts/connectToMysql.php at the top, so whatever happens you're always connecting to a mysql database, even though you only need this when someone wants to add the result to their profile. Maybe it would be a good idea to put your connection in a function, and call that function before it's needed instead of always connecting. -
Info not adding to database despite a success Message
WebStyles replied to davidjones1990's topic in PHP Coding Help
try this: After this line: $bmiResult = '<span class="profileUsername">Your BMI is: ' . $bmiAlt . '</span><br />'; add: $_SESSION['bmiAlt'] = $bmiAlt; then change this line: $update = $bmiAlt; to: $update = $_SESSION['bmiAlt']; that should grab the correct value to be stored in the database. hope this helps. -
Info not adding to database despite a success Message
WebStyles replied to davidjones1990's topic in PHP Coding Help
when you create the button to add to database you're generating a form like this: <form action="index.php" method="post" enctype="multipart/form-data"><input name="postBmi" type="submit" id="postBmi" value="Yes Please!" /></form> but $bmiAlt does not exist in the form, you need to add a hidden element with it's value or store the calculated value in a session variable. -
escape quotes or change to single quotes: <select name='sex'> <option value='male'>male</option> <option value='female'>female</option></select> or <select name=\"sex\"> <option value=\"male\">male</option> <option value=\"female\">female</option></select>