wildteen88
-
Posts
10,480 -
Joined
-
Last visited
Never
Posts posted by wildteen88
-
-
Try:
[code]$query = mysql_query("SELECT * FROM AUDIT WHERE $metode LIKE '%{$search}%' AND $metode2 LIKE '%{$search2}%' ORDER BY '$sortby' ASC") or die("Unable to perform query: " . mysql_error());[/code]
I've never used the LIKE clause, so I'm going in blind sorry. With all the examples I've seen with the LIKE Clause they never use the ORDER BY clause prehaps you cant use it with LIKE. -
In order to edit a cookie you will have to reset it using the setcookie function. You cannot do $_COOKIE['cookiename'] = 'something';
to reset a cookie. -
Put all your javascript into a sperate rollover.js file then use this code:
<script type="text/javascript" src="rollover.js"></script> and place that between the two <head> and </head> tags. -
By form data do you provide input boxes for users to input data? Or do have pull down menus that have predefined data and when a user choses an option from the menu you would like it auto submit the form?
-
no problem. I thought you mean register_globals. I had read your post at least 10 times too. lol
-
FYI magic_quotes_gpc doesn't affect variable names. The only thing it does affect is the value a variable contains such as if a variables value contains quotes magic_quotes_gpc eacapes any quotes.
Now I think what you meant was register_globals rather than magic_quotes_gpc. register_globals should be off on both servers.
I tried your script provded above on my local server running PHP 5.1.2 and $username doesn't affect $_SESSION['username'] at all.
You must have something else that is set which is affecting variable names.
-
Please do not post your problem in different forums. You already have the same thread [a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=90303\" target=\"_blank\"]here[/a] which I am trying to help you on.
Topic closed -
Chnage this:[code]while ($row = @mysql_fetch_array($query))
{
$variable1=$row["DT_STRING"];
$variable2=$row["ACCOUNT"];
$variable3=$row["ACCOUNT_TYPE"];
$variable4=$row["CLIENT_ID"];
$variable5=$row["USER_ID"];
//table layout for results
print ("<tr>");
print ("<td>$variable1</td>");
print ("<td>$variable2</td>");
print ("<td>$variable3</td>");
print ("<td>$variable4</td>");
print ("<td>$variable5</td>");
print ("</tr>");
}
//below this is the function for no record!!
if (!$variable1)
{
print ("$XX");
}[/code]
to:
[code]// This is the proper way of checking whether your
// MySQL query returned any results or not
if(mysql_num_rows($query) >= 1)
{
while ($row = mysql_fetch_array($query))
{
$variable1=$row["DT_STRING"];
$variable2=$row["ACCOUNT"];
$variable3=$row["ACCOUNT_TYPE"];
$variable4=$row["CLIENT_ID"];
$variable5=$row["USER_ID"];
//table layout for results
print ("<tr>");
print ("<td>$variable1</td>");
print ("<td>$variable2</td>");
print ("<td>$variable3</td>");
print ("<td>$variable4</td>");
print ("<td>$variable5</td>");
print ("</tr>");
}
}
else
{
"Your search criterea returned no results";
}[/code]
Also change your mysql query part of the code to this:
[code]$query = mysql_query("SELECT * FROM AUDIT WHERE $metode LIKE '%$search%' AND $metode2 LIKE '%$search2%' ORDER BY $sortby ASC") or die("Unable to perform query: " . mysql_error());[/code] -
Change this:[code] <?php do { ?>
<tr>
<td>
<?php echo $row_rstArtists['artist_name']; ?> </td>
<td><a href="artists.php?artist=<?php echo $row_rstArtists['arist_pk']; ?>">View</a></td>
</tr>
<?php } while ($row_rstArtists = mysql_fetch_assoc($rstArtists)); ?>
</table>[/code]to:[code] <?php while ($row_rstArtists = mysql_fetch_array($rstArtists)) { ?>
<tr>
<td>
<?php echo $row_rstArtists['artist_name']; ?> </td>
<td><a href="artists.php?artist=<?php echo $row_rstArtists['arist_pk']; ?>">View</a></td>
</tr>
<?php } ?>
</table>[/code] -
You are using the assignment operater (=) rathar than the comparison operator (==). Also chnage your if statments to an if/elseif statment like so:
[code]if ($hungry == '0') {
$hunger = 'Starving';
}
elseif ($hungry == '1') {
$hunger = 'Famished';
}
elseif ($hungry == '2') {
$hunger = 'Hungry';
}
elseif ($hungry == '3') {
$hunger = 'Unsatisfied';
}
elseif ($hungry == '4') {
$hunger = 'Unsatisfied';
}
elseif ($hungry == '5') {
$hunger = 'Satisfied';
}
elseif ($hungry = '6') {
$hunger = 'Full';
}
elseif ($hungry = '7') {
$hunger = 'Bloated';
}[/code] -
Change this:
[code]<td width="60"><b>DT_STRING</b></td>
<td width="100"><b>ACCOUNT</b></td>
<td width="30"><b>ACCOUNT_TYPE</b></td>
<td width="150"><b>CLIENT_ID</b></td>
<td width="150"><b>USER_ID</b></td>[/code]to the following:
[code]<td width="60"><b><a href="?sortby=DT_STRING">DT_STRING</a></b></td>
<td width="100"><b><a href="?sortby=ACCOUNT">ACCOUNT</a></b></td>
<td width="30"><b><a href="?sortby=ACCOUNT_TYPE">ACCOUNT_TYPE</a></b></td>
<td width="150"><b><a href="?sortby=CLIENT_ID">CLIENT_ID</a></b></td>
<td width="150"><b><a href="?sortby=USER_ID">USER_ID</a></b></td>[/code]
Now change the following code:
[code]$query = mysql_query("SELECT * FROM AUDIT WHERE $metode LIKE '%$search%' AND $metode2 LIKE '%$search2%'"); [/code]to this:
[code]//Create an array that sotes the possible values $_GET['sortby'] can hold
$sortvalues = array("DT_STRING", "ACCOUNT", "ACCOUNT_TYPE", "CLIENT_ID", "USER_ID");
//Check that $_GET['sortby'] is set and that the value it holds is in the $sortvalues array
if(isset($_GET['sortby']) && in_array($_GET['sortby'], $sortvalues))
{
//set up the sortby variable that'll be used in the ORDER BY clause in the MySQL Query
$sortby = $_GET['sortby'];
}
else
{
// This is the defualt value if $_GET['sortby'] is not set or the value it
/// contains isn't in the $sortvalue array.
$sortby = "DT_STRING";
}
$query = mysql_query("SELECT * FROM AUDIT WHERE $metode LIKE '%$search%' AND $metode2 LIKE '%$search2%' ORDER BY $sortby ASC");[/code]
Hoep that helps. -
If you get a parse error in this format:
Parse error: parse error, unexpected T_[x] in [path/of/script/here.php] on line [line numer here]
Always check that you are ending your PHP lines with a semi-colon (;). Usually the line number gives it away. Do not look at the line PHP says the error is on as that is not where you missing the semi-colon, as the proper error is usually 1 or 2 lines above where the error occured. So if you get a parse error that says an unexpected T_VARIABLE on line 12 then look at lines 9 - 11 to make sure you are ending your lines correctly. -
If you want your magnifier to be rectangler, change line 171 to the following:
[code]this.style.width = (this.size+this.size*0.5) + "px";[/code] -
So the above code you posted above works on your remote server but it doesnt work on your local server, which is installed on your PC?
If so does your local server have register_globals turned on, if it does turn it off? and does your local server have [b]short_open_tag[/b] turned on too as [b]short_open_tag[/b] (<?) is set to off by defualt. -
Did you say you had a form? If so where is the code for your form, the html not the PHP as your php code looks ok. All I want to see is how your submitting your form.
-
Change line 306 to the following in search.php:
[code]<br>',nl2br($preview[$i]),'<br>';[/code] -
To all your servers current configuration state use the phpinfo function. Create a new file called phpinfo.php and put this in it:
[code]<?php
p.hpinfo();
//NOTE: make sure you remove the . between the p and the h
?>[/code]Now save your file and upload this file to your webshot. Now go to www.mysite.com/phpinfo.php
You should no get a big page full of all configuration settinsg for your PHP setup and a few server sided settings too. Now scroll down and see if you can see a big header saying CURL if there is then you have cURL available to you. -
Okay post lines 89 to 94 from [b]config.inc.php[/b].
-
There is an error in your MySQL Query. Could you post your code here so we can see your query code.
Also I would recommend you to put the following:
[code]or die("MySQL Query Error: " . mysql_error());[/code] after mysql_query(... YOUR QUERY HERE ...)
That way MySQL will tell you whats wrong with SQL Query.
-
sessions should work as soon as PHP is installed. How are you creating your sessions?
-
Change this:
[code]<a href="home.html" id="navlink">Home</a>[/code]to
[code]<div id="navlink"><a href="home.html">Home</a></div>[/code]Your CSS should now work. -
Are the files that you're adding
[code]<? include ("access_control.php"); ?>[/code]to in the same folder as access_control.php?
If they then that code is file, but if you add that code to a file that is not in the same folder as access_control.php you will need to do this instead:
[code]<? include ("../access_control.php"); ?>[/code]
NOTE you dont need to use that code in every file but only the pages you want password protected. -
Heres a tutorial [a href=\"http://www.phpit.net/article/create-bbcode-php/\" target=\"_blank\"]here[/a] for creating a BBCode function.
Also when searching for BBCode tutorials make your search more specific such as: [a href=\"http://www.google.co.uk/search?num=100&hl=en&hs=Raq&safe=off&client=firefox-a&rls=org.mozilla:en-GB:official_s&q=PHP+BBcode+tutorial&spell=1\" target=\"_blank\"]PHP BBCode Tutorials[/a]. You'll get a much more better results rather than just searching for BBCode.
If you want to learn how to create the buttons that insert the BBCode into a textarea then you might want to read [a href=\"http://www.thecodebehind.com/code/javascript/examples/javascript-textarea-buttons-bold-italic.aspx\" target=\"_blank\"]this[/a] tutorial. -
I would recommend you to rethink the way you use if/else statements, see the code below:
[code]if($firstName){//----> CHECK input
}
else{
$error.="Please, go back and fill out your first name<br>\n";//----> ERROR if no input
}[/code]You can chnage that to this:
[code]if(!$firstName) {
$error.="Please, go back and fill out your first name<br>\n";//----> ERROR if no input
}[/code]Use the [b]Not[/b] comparison operater (!) if you want to check that $firstname is not set. You can change all your if/else statments to the example provided above with the (not) ! operator.
Session ID Appended to Links?
in PHP Coding Help
Posted