Reaper0167
-
Posts
270 -
Joined
-
Last visited
Never
Posts posted by Reaper0167
-
-
thanks,,, any ideas about the checkbox validation part of the script
-
hey,, thanks guys. I just have one more post in the javascript section, if one of you have some time,, i would really appreciate it
-
haku,,, is that right what you posted,, never seen anything like that before.... I mean the way the curly brackets are place in and out of the php tags.
-
I'm using an if statement,,,
if no one is logged in,, echo the form,,,
else echo welcome message.
-
I forgot to mention that I am echoing out the form..... I'm getting an error....
<?php echo '<form name="form1" method="post" action="login.php"> <body onload="changeType()"> <input name="password" type="password" value="Password" id="password" onfocus="if (this.value == "Password" && this.type == "text"){ this.value = ''; this.type = "password"; this.focus(); }" onblur="if (this.value == '' && this.type == "password"){ this.value = "Password"; this.type = "text"; }" > <input name="password" type="password" id="password" /> <input type="submit" name="submit" id="submit" value="Login"><br> </form>'; ?>
-
my text field validation works,, but check out the checkbox validation....What am I doing wrong?
<script type="text/javascript" language="javascript"> function validate(form2) { var valid = true; <!--******************************************************************************************************************--> if (!form2.username.value || !form2.username_conf.value) { document.getElementById('username_error').innerHTML = 'You must enter a username and confirm it.'; valid = false; } else if (form2.username.value != form2.username_conf.value) { document.getElementById('username_error').innerHTML = 'Usernames do not match.'; valid = false; } else { document.getElementById('username_error').innerHTML = ''; } <!--***************************************************************************************************************--> if (!form2.password.value || !form2.password_conf.value) { document.getElementById('password_error').innerHTML = 'You must enter a password and confirm it.'; valid = false; } else if (form2.password.value != form2.password_conf.value) { document.getElementById('password_error').innerHTML = 'Passwords do not match.'; valid = false; } else { document.getElementById('password_error').innerHTML = ''; } <!--***************************************************************************************************************--> if (!form2.email.value || !form2.email_conf.value) { document.getElementById('email_error').innerHTML = 'You must enter a valid email and confirm it.'; valid = false; } else if (form2.email.value != form2.email_conf.value) { document.getElementById('email_error').innerHTML = 'Emails do not match.'; valid = false; } else { document.getElementById('email_error').innerHTML = ''; } <!--****************************************************************************************************************--> if (!form2.agree.checked) { document.getElementById('agree_error').innerHTML = 'You must agree to the terms.'; valid = false; } else { document.getElementById('email_error').innerHTML = ''; } return valid; } </script>
-
sorry,, didn't understand what you wanted.
-
<?php $sql = "INSERT INTO demo_users(name, company, address, city, state, zip, phone, email)VALUES('$name', '$company', '$address', '$city', '$state', '$zip', '$phone', '$email')"; ?>
-
I am having a problem with a text box on my site. The text box is where I enter in a password,, so when I type something,,, it is just a bunch of black dots.... How would I go about having the initial value of that text box say 'Password' .. When I set the initial value to password,, it shows black dots,, only cause the type of the box is set to password.... What is the way around this?
-
thanks for the help,, but still no images.
-
proper size border for the picture, and also has the proper spacing between the borders, but no pictures, just a little red x in the upper corner of the border
-
Picture not displaying, little red x instead. Thought I had this one, guess not.
<?php $imgRealPath = "userimages/"; foreach(glob("$imgRealPath/{*.jpg,*.png,*.gif}", GLOB_BRACE) as $fname) { echo '<img src=\"" . $imgWebPath . "/" . baseName($fname) . "\" width="150" border="1"><br/><br/>'; } ?>
-
What about if I wanted to echo all the pictures from that directory?
-
header('Content-Type: image/png');
I added this line to the top of the php page with the echo statment you showed me. But there is just a little red x.
$newname="userimages/".$image_name;
echo '<img src="$newname">';
There is more code,, just showing what I am trying to echo.
And is it possible to include png, jpg, and gif all in one header content?
-
I have a couple images in a directory on my server. Could I just use an echo statement to display them somehow?
-
So are you saying that every time someone uploads a picture, i need to edit that php file? I hope not.
-
storing them I do know about. What I want to do I can't find anywhere. So thanks.
-
There are different types of files in the db.... gif, bmp, png, etc. So would this line be changed or removed?
header('Content-type:image/x-png');
<img src="image.php?id=12345" /> <---|
Could you explain the line above please---^
-
i found this little bit of code
<?php <html> 2 <head> 3 <title>My page title</title> 4 </head> 5 <body> 6 7 <img height="125" width="125" alt="Flower" src="flower01.jpg" /> 8 9 </body> 10</html> ?>
Each picture will need a page like this, and then echo out the php page on my search results page????? How can this be done with all the images in the database?
-
bump ttt
-
Can that be done on the fly(by itself). People will be uploading there picture, picture name, and description all day, every day. So when they upload, it is automatically given a page of its own. I'm still a little confused.
-
by the way, this is not my script, i was just wondering how good it worked so I could get an idea of search engines. I tried the header code at the top of the page and all it shows is a little box with an x in the middle. And all the other content on the page was missing.
<?php header('Content-type:image/x-png'); include "upload_db_info.php"; // Get the search variable from URL $var = @$_GET['q'] ; $trimmed = trim($var); //trim whitespace from the stored variable // rows to return $limit=10; // check for an empty string and display a message. if ($trimmed == "") { echo "<p>Please enter a search...</p>"; exit; } // check for a search parameter if (!isset($var)) { echo "<p>We dont seem to have a search parameter!</p>"; exit; } //connect to your database ** EDIT REQUIRED HERE ** mysql_connect("----","-----","-------"); //(host, username, password) //specify database ** EDIT REQUIRED HERE ** mysql_select_db("-------") or die("Unable to select database"); //select which database we're using // Build SQL Query $query = "select * from $table_name where name like \"%$trimmed%\" order by name"; // EDIT HERE and specify your table and field names for the SQL query $numresults=mysql_query($query); $numrows=mysql_num_rows($numresults); // If we have no results, offer a google search as an alternative if ($numrows == 0) { echo "<h4>Results</h4>"; echo "<p>Sorry, your search: "" . $trimmed . "" returned zero results</p>"; // google echo "<p><a href=\"http://www.google.com/search?q=" . $trimmed . "\" target=\"_blank\" title=\"Look up " . $trimmed . " on Google\">Click here</a> to try the search on google</p>"; } // next determine if s has been passed to script, if not use 0 if (empty($s)) { $s=0; } // get results $query .= " limit $s,$limit"; $result = mysql_query($query) or die("Couldn't execute query"); // display what the person searched for echo "<p>You searched for: "" . $var . ""</p>"; // begin to show results set echo "Results"; $count = 1 + $s ; // now you can display the results returned while ($row= mysql_fetch_array($result)) { $title = $row["content"]; echo "$count.) $title" ; $count++ ; } $currPage = (($s/$limit) + 1); //break before paging echo "<br />"; // next we need to do the links to other results if ($s>=1) { // bypass PREV link if s is 0 $prevs=($s-$limit); print " <a href=\"$PHP_SELF?s=$prevs&q=$var\"><< Prev 10</a>  "; } // calculate number of pages needing links $pages=intval($numrows/$limit); // $pages now contains int of pages needed unless there is a remainder from division if ($numrows%$limit) { // has remainder so add one page $pages++; } // check to see if last page if (!((($s+$limit)/$limit)==$pages) && $pages!=1) { // not last page so give NEXT link $news=$s+$limit; echo " <a href=\"$PHP_SELF?s=$news&q=$var\">Next 10 >></a>"; } $a = $s + ($limit) ; if ($a > $numrows) { $a = $numrows ; } $b = $s + 1 ; echo "<p>Showing results $b to $a of $numrows</p>"; ?>
-
I will post the code here in a little while. The images are bmp, png, jpg and gif. I was told that you cannot display all those types on one page, but I find that hard to believe. I will try the header now.
-
php mysql search engine displays the blob image like this....what is going on?
‡ÿêB™\€„Àt‘8K€@zŽB¦@F€˜&S `ËcbãP-`'æÓ€ø™{[”! ‘ eˆDh;¬ÏVŠEX0fKÄ9Ø-0IWfH°·ÀÎ ² 0Qˆ…){`È##x„™FòW<ñ+®ç*x™²<¹$9E[-qWW.(ÎI+6aaš@.Ây™24àóÌ ‘àƒóýxήÎÎ6Ž¶_-ê¿ÿ"bbãþåÏ«p@át~Ñþ,/³€;€mþ¢%îh^ u÷‹f²@µ éÚWópø~<ß5°j>{‘-¨]cöK'XtÀâ÷ò»oÁÔ(€hƒáÏwÿï?ýG %€fI’q^D$.Tʳ?ÇD *°AôÁ,ÀÁÜÁ ü`6„B$ÄÂBB d€r`)¬‚B(†Í°*`/Ô@4ÀQh†“p.ÂU¸=púažÁ(¼ AÈa!ÚˆbŠX#Ž™…ø!ÁH‹$ ɈQ"K‘5H1RŠT UHò=r9‡\Fº‘;È2‚ü†¼G1”²Q=Ô µC¹¨7„F¢ Ðdt1š ›Ðr´=Œ6¡çЫhÚ>CÇ0Àè3Äl0.ÆÃB±8, “c˱"¬ «Æ°V¬»‰õcϱwEÀ 6wB aAHXLXNØH¨ $4Ú 7 „QÂ'"“¨K´&ºùÄb21‡XH,#Ö/{ˆCÄ7$‰C2'¹I±¤TÒÒFÒnR#é,©›4H#“ÉÚdk²9”, +È…ääÃä3ää!ò[ b@q¤øSâ(RÊjJåå4åe˜2AU£šRݨ¡T5ZB¡¶R¯Q‡
[SOLVED] password text boxes and initial values
in PHP Coding Help
Posted
Thanks for the info. In the javascript section,,, still having trouble with the checkbox validation... If you have time,, I would greatly appreciate it.