khr2003
-
Posts
112 -
Joined
-
Last visited
Never
Posts posted by khr2003
-
-
I do not understand why you use ' so often. check this code and see if it working:
while($row = mysql_fetch_array($result)) { echo "<div class="rbroundbox"> <div class="rbtop"><div></div></div> <div class="rbcontent"><div class="mydiv"> $row['hotelname'] $row['address1'] $row['address2'], $row['county'].'</div>'<p> </p>'<div class='urdiv'>'<br/> <img src=http://www..com/Website/images/$row['logo'] alt='logo' rel='lightbox[mando]' border='1' height='100' width='100'> </div><div class='hisdiv'><br/><font size = '6'> <strong><b>Hotel Bids € </b></strong></font><font size = '6'><strong>$row['hotelprice']</strong></font size><br /> Includes: $row['addons']<br />Reference Number: . $row['bookingref']. <br/><br /> <input type='image' src='BookThisHotel.PNG' name='image' width='121' height='24' onclick=\"window.location='bookview.php?em=$row['email']&id=$row['bookingref']&te=$row['telephone']&nh=$row['hotelname']\"> <input type='image' src='ViewHotel.PNG' name='image' width='90' height='24' onClick=\"window.open('viewhotel.php?id=$row['id'], 'mywindow', 'width=400, height=200')\"> </div></div><!-- /rbcontent --> <div class=\"rbbot\"><div></div></div> </div><!-- /rbroundbox -->"; }
-
it really depends on how you setup your login system. If you are using cookies then you can add a cookie with a username and a password in the else condition, so when your program checks for a member it will find this cookie and use it as a user.
if you are using sessions to authenticate your users when they log in, you might want to read how to initiate sessions and how to add variable to this sessions array. check this link: http://au.php.net/manual/en/book.session.php
-
if the array is numeric you can add an if condition inside the foreach loop:
foreach ($array as $key => $value) { if($key != $array[0]) { add your code here } }
did not test but it should work (maybe with some modifications )
-
Try to use this approach in order to get rid of (\" or \')
echo <<<END This uses the "here document" syntax to output multiple lines with $variable interpolation. Note that the here document terminator must appear on a line with just a semicolon. no extra whitespace! END;
-
You can redirect the form in many ways other than including the redirecting link in the url.
How about using:
header("Refresh: 1;url=URL_HERE")
-
see these links for the explanation of the functions:
http://www.w3schools.com/PHP/func_string_htmlspecialchars.asp
http://www.w3schools.com/PHP/func_string_trim.asp
as of the second question I do not understand how it related to trim() or htmlspecialchars() functions since you use these functions before inserting data into mysql while the line you posted is to display the form straightaway from the php code.
anyway try this code and see if its working:
echo "<form action='nov.php' method='post'><input type='hidden' name='content' value='$content'><input type='submit' name='submit' value='Back to edit'></form>";
-
since parse_ini_file produces an associative array (like this key => value) you have to change foreach loop accordingly to be like:
function get_value_of($section,$item) { $ini_array = parse_ini_file("IDLE_names.ini", true); //print_r($ini_array); foreach ($ini_array as $key => $value) { if ($value == $section) { foreach ($value as $xkey => $xvalue) { if ($xkey == $item) { return "$xvalue"; } } } } }
This function might not work properly but you get the idea
-
You can use fread function, however some servers disable it due to security threats or you can use other function of reading a file, like:file_get_contents()
or use curl, some of its functions might be disabled by some hosting services but you can change that through the php.ini file.
-
if (!($t % 3)) $class = 'whatever';
else $class = 'blah';
Can you explain what the modulus symbol does?
so that I may understand the other implementations for it.
...pleeease!
Basically it divides the number $t reach in every loop, if the number is divisible by 3 (whith no reminder) then you can do whatever you like otherwise processed.
-
I guess it is confusing. You question is not very clear. Usually IDs consists of numbers (and letters sometimes) however in some occasion you might use letters only as an ID.
My guess the id is pacman in this case, if this helps
-
This is a javascript issue and not a php. PHP is a server-side language (that means you have to submit something to the server, your page will be refreshed and you get the data), javascript is a client-side script meaning you can perform certain actions and see the results immediately. You may want to add an input button with its value the special characters you have and then apply a javascript code that will do what you requested.
I might give you the code if you wanted.
-
Simple
I had this issue in one of my websites (but with a different code), the problem was in the host computers. Every time I removed it it came back and I tried everything but nothing worked. After 4 months I changed my cpanel password to a very complex one, and then problem solved .
echoing js window.open function
in PHP Coding Help
Posted
or this code: