![](https://forums.phpfreaks.com/uploads/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
nogray
-
Posts
930 -
Joined
-
Last visited
Posts posted by nogray
-
-
You can get a resize function from php.net
Just go to http://us2.php.net/manual/en/function.imagecopyresampled.php and look at the second example. -
I assume the $row[0] will return the ID, or you can use $row['You ID field here'] instead
Try the code below, hope it helps
[code]
<?php
$query = "SELECT * FROM category";
$result = mysql_query ($query);
while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
$main_cats .= "<option value='".$row[0]."'>".$row[0]."</option>";
$query1 = "SELECT * FROM subcategory WHERE maincatid = '".$row[0]."'";
$result1 = mysql_query ($query1);
$sub_arrays .= "subs[".$row[0]."] = new Array(";
while ($row1 = mysql_fetch_array($result1, MYSQL_NUM)) {
$sub_arrays .= "\"".$row1[0]."\",";
}
$sub_arrays = trim($sub_arrays, ",") .");\n";
}
?>
<html>
<head>
<script language="javascript">
var subs = new Array();
<?= $sub_arrays ?>
function fill_subs(val){
if (val != ""){
var sub_sel = document.getElementById('sub_select');
sub_sel.innerHTML="";
opt = document.createElement("OPTION");
opt.value = "";
opt.innerHTML = "Select";
sub_sel.appendChild(opt);
for(i=0; i<subs[val].length; i++){
opt = document.createElement("OPTION");
opt.value = subs[val][i];
opt.innerHTML = subs[val][i];
sub_sel.appendChild(opt);
}
}
}
</script>
</head>
<body>
<select onChange="fill_subs(this.value);">
<?= $main_cats ?>
</select>
<select id="sub_select" name="sub_select">
<option value="">Select</option>
</select>
</body>
</html>
[/code] -
Take a look at this
[a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=95246&hl=\" target=\"_blank\"]http://www.phpfreaks.com/forums/index.php?...topic=95246&hl=[/a]
-
You cannot set the value of the file input field, security risk. If possible, spammers will be able to steel your files just by visiting the site.
-
If you script is live and the subject line and the to address is taken from the form directly, you'll need to clean before using it in the mail function.
spammers have robots that can fill forms automatically and send mass emails from your server by injecting the headers in your mail (using the subject and the to lines).
You can go to [a href=\"http://www.securephpwiki.com/index.php/Email_Injection?seenIEPage=1\" target=\"_blank\"]http://www.securephpwiki.com/index.php/Ema...on?seenIEPage=1[/a] for more details. -
use exist()
-
You can't have two borders in one div, you gotta have 2 divs for 2 borders
-
You are creating the input field before the page loads, the javascript cannot find the forms because it haven't loaded yet.
You'll need to set your script as a function and call it when the page loads.
(btw you are missing an s in your form.appendChild(file)- should be forms) -
You are missing a : after Location in your header(), change it like the following.
[code]
header("Location: ".BASE_URL."/login.php");
[/code] -
I don't think $this works in a static function, try to use
page::$lockLevel
instead. -
you can do something like this
[code]
<script language="javascript">
function create_element(){
var form_tbody = document.getElementById('form_tbody');
var n_tr = document.createElement("TR");
var n_td = document.createElement("TD");
var n_input = document.createElement("INPUT");
n_input.name = "input_name";
n_input.id = "input_id";
n_input.type = "text";
form_tbody.appendChild(n_tr);
n_tr.appendChild(n_td);
n_td.appendChild(n_input);
}
</script>
<table>
<tbody id="form_tbody">
<tr><td><input type="text" /></td></tr>
</tbody>
</table>
[/code]
Just remmeber that you need to tbody if you are using tables. -
There are a lot of factors when it comes to filtering email.
It depends if the email in the Junk folder or the inbox. If the sender in a black list, or not, the IP address of the sender, the headers, the format of the message.
In your message, try to add
[code]
<html>
<head>
<title>Message</title>
</head>
<body>
YOUR Message
</body>
</html>
[/code]
Even though everything above the body tag get stripped, this should lower the spam filter points. -
you can try to add "display:block" in your dent class.
Maybe it'll work -
Hotmail usually disable HTML content unless you click enable HTML content (I think that's what it's called).
It's not your script, but hotmail filters. -
instead of using <span class="dent"> use <div class="dent">
Span doesn't work so well with text formatting. -
try to use style sheet
[code]
<table style="width:100px;">
<tr><td>text</td></tr>
<table>
[/code]
You'll need the px in the style sheet. -
It depends how you set it up, but the easiest will be something like this
[code]
<table>
<tr id="hidden_field_tr" style="display:none;">
<td><input type="text" /></td>
</tr></table>
<button onclick="document.getElementById('hidden_field_tr').style.display='';">Show</button>
<button onclick="document.getElementById('hidden_field_tr').style.display='none';">Hide</button>
[/code]
-
This should be just one line of JS, and always use document.getElementById() when you accessing objects in JS.
[code]
<input type="checkbox" id="tos" name="tos" onclick="document.getElementById('signed').disabled = this.checked;" /><br />
<input type="submit" id="signed" name="signed" value="submit" />
[/code] -
-
You are most likely uploading gif images, and using the imagecreatefromjpeg() function. You'll need to check if the image is jpg or gif and use the appropriate function.
-
Just add this to the header
[code]
$headers .= 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
[/code]
and you should be able to send html -
you can use a small if statement like
[code]
<?PHP
if (isset($_GET[article])){
php include("$_GET[article].html");
}
else {
echo "default content";
}
?>
[/code] -
You can use PHP to get the image size and print out the correct size.
[code]
<?php
list($width, $height, $type, $attr) = getimagesize("img/flag.jpg");
if ($width > 175) $width=175;
echo "<img src=\"img/flag.jpg\" width=\"$width\" />";
?>
[/code] -
the print() only shows the print dialog box. Otherwise a bad site could print tons of pages when visited.
Issue with exporting from Photoshop to html
in HTML Help
Posted
You need to create slices using the slice tool (these will be saved as images in table cells)
[center][img]http://www.nogray.com/slice.gif[/img][/center]
The click on File->Save for Web
Optimize the images and click save.
That should do it.