-
Posts
1,200 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by divinedesigns1
-
-
ok so i have been getting this problem for the pass year or so, please be advice it was two issues before and i have resolve 1/2 issues.
my last issues is base on making sure that the format of the image or file matches with those i wish to be uploaded.
// this is the formats$allowed = array('png', 'jpg', 'jpeg', 'gif');// if the format doesnt match display thisif($ptype == $allowed){ $errors[] = 'This format isnt allow</br>Accepted formats are as followed: PNG, JPG, JPEG, GIF';}
i also tried this just to make sure i wasnt doing anything wrong
if($ptype != $allowed){ $errors[] = 'This format isnt allow</br>Accepted formats are as followed: PNG, JPG, JPEG, GIF'; }else($ptype == $allowed){ $errors[] = 'ok'; }
i still ended up with the same issues, which by pass the statement and allowed the format anyway.
AS ALWAYS any tips, hint, or advice will do
- 1
-
If you want to load content without refreshing the page then use ajax.
i find php takes sometime to load, specially when it comes to loading large amount of data
-
If you want to load content without refreshing the page then use ajax.
thanks
-
ok, is there a way i can display this function
function createdit(){ // get connected include "../xxx/xxxxx.php"; echo 'hello';}
without using php, im trying to accomplish a smooth transition once the link is click from the menu, but i dont want the page to reload once that link is clicked.
documents to read is always welcome, tips, hints, etc.
-
All PHP statements need to be separated by semi-colons.
This would fix your problem:
include "../xx/xxxx.php";
Looks like missing semicolon for the include line. Could be it for the error.
talk about no noticing something........thanks guys
-
ok, so im using wamp to do a fast php check whiles i create my scripts.
now i created the entired script and im getting the following error
as you guys tell me all the time, break down the script to make sure i dont have any errors, so im breaking down my codes and havent found any error at all so far. im up to the beginning of the script
<?php // start the session session_start(); // display all errors error_reporting(E_ALL); ini_set('display_errors', '1'); // the connection include "../xx/xxxx.php" // the script for the login if(isset($_POST['submit'])){ }?>
and the above script still giving the same errors, any idea?
-
can someone tell me why everytime i add padding to a div with a width of say 100% or 80% the div expand....i thought padding was suppose to be for within the div and not suppose to expand that div or element.
-
No, Javascript can not open a folder and read the files.
can i use php to pull that info into javascript? or is there another language besides php where i can open and read the files?
-
is there a way to grab all the .mp3 files i have in a folder without having to write them one by one in the script?
also can i do this for the files within the folders also?
-
With innerHTML, you would just put the image's HTML:
var filename = "image.jpg";element.innerHTML = "<img src='" + filename + "'>";
If you want a different method
var img = new Image();img.src = "image.jpg";element.appendChild(img);
thanks
-
how can i go about adding an image in javascript code, if im using innerhtml to display my html text?
-
If conditional validation should only change valid to false if it fails validation, otherwise it may have failed validation in previous if condition, but you have reset to true, meaning previous invalid values will always pass validation check.
oh alrite, talk about confusion lol thats why i like my php, but gotta learn javascript
-
it worked, but question, why did it keep flashing when i have it to valid = true?
-
Try and change your pattern namecheck to the following:
namecheck = /[A-Z,a-z]+s[A-Z,a-z]+/;
That looks for letters, a space, and letters only. For i.e.: John Smith, like how names are. If anything that is entered that is not a match to that, it returns false.if(fnlname.value == ''){ fulname.innerHTML = '<b>full name is missing</b>'; return false;}else{ if(!namecheck.test(fnlname.value)) //if anything doesn't match the pattern above, test() returns false. So in other words, if it is TRUE that test() returns false, enter the if { fulname.innerHTML = '<b>Both Names Required</b>'; return false; }}
If the user entered a pattern match for namecheck/test(), when the script reaches this point:if(namecheck.test(fnlname)){ fulname.innerHTML = '<b>checked</b>'; return false; }
... since test returns true, we should enter this if and set the innerHTML of fulname to <b>checked</b>. Hopefully this was of some help.it was the plus smh /[A-Z,a-z]+s[A-Z,a-z]+/ i should really just stick to this forum and not listen to my professor lol
once again thank you i greatly appreciate it
-
ok so i got that working with the valid variable but the statement that is true still aint working
if(namecheck.test(fnlname.value)){ fulname.innerHTML = '<b>check</b>'; valid = true; }
this suppose to make sure both first and last name is being input and once this is done a check is suppose to be displayed
-
You will have a problem with how you are using return, Because when it reaches a invalid condition and you invoke return false everything stops at that point and none of the other if conditional validations are processed, you need to as i suggested in first topic to set a varible valid to true at beginning, then at EACH if condition validation where it fails set valid to false, then AT END return valid varible value.
that part works
-
SO its global scope variable outside the function and placed after span with id, or using window.onload? yes!
not too sure what you just say, but im not using a window.onload, so with the 'fulname' and innerhtml, im able to output the correct errors for that input
-
For namecheck, try this instead: /[A-Z,a-z]s/;
test() returns true or false. Have for the if: if(namecheck.test(fnlname.value)) instead of if(fnlname == namecheck.test(fnlname))
nope, that didnt do it, im trying to make sure both first and last name is filled out
Where's 'fulname.' coming from? I don't see any document.getElementById("fulname") from last topic.
that is a span with the id of fulname
-
ok, so now im trying to add a check once the field of the form is filled out correctly, but im having problems outputing the "checked"
function check(){ var fnlname, addy, numy, email, city, state, country, zip, namecheck; fnlname = document.getElementById('fnlname'); addy = document.getElementById('addy'); numy = document.getElementById('numy'); email = document.getElementById('email'); city = document.getElementById('city'); state = document.getElementById('state'); country = document.getElementById('country'); zip = document.getElementById('zip'); /*** check to see if 2 sets of words is placed ****/ namecheck = /^[A-Z,a-z][A-Z,a-z]+$/; if(fnlname.value == ''){ fulname.innerHTML = '<b>full name is missing</b>'; return false; }else{ if(!namecheck.test(fnlname)){ fulname.innerHTML = '<b>Both Names Required</b>'; return false; } } /*** if both names are filled in, display a "checked mark" ***/ if(fnlname == namecheck.test(fnlname)){ fulname.innerHTML = '<b>checked</b>'; return false; } if(addy.value == ''){ address.innerHTML = '<b>Address is missing</b>'; return false; }else{ namecheck = /^[A-Z,a-z]+$/; if(!namecheck.test(addy)){ document.getElementById('address').innerHTML = '</b>A full Address is Require</b>'; return false; } } return true; }
any tips or hint or help will do just fine
-
it workssss thank you soooo muchhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
-
Ignore (1) just noticed span, but 2 remains true.
thanks
thanks
-
hey i have been trying to fix this code where the validation for the form can be displayed using innerhtml, this is the issue, it displays but it doesnt stay i just flash when you submit the form
<script language="javascript"> function check(){ var fnlname, addy, numy, comm, namecheck; fnlname = document.getElementById('fnlname'); if(fnlname.value == ''){ document.getElementById("fulname").innerHTML = 'full name is missing'; }else{ namecheck = /^[A-Z,a-z][A-Z,a-z]+$/; if(!namecheck.test(fnlname)){ } } } </script> <div class="forms"> <h2>Contact Us</h2> <form action="" method="post" enctype="multipart/form-data" onsubmit="check()"> <span id="fulname"></span> <input type="text" name="fnlname" id="fnlname" placeholder="First and Last Name"> <input type="text" name="addy" id="addy" placeholder="Address"> <input type="text" name="company" id="comy" placeholder="Company"> <input type="tel" name="numy" id="numy" placeholder="Number"> <textarea id="comm" name="comm" cols="40" rows="10" placeholder="Comment/Questions/Complains"></textarea> <input type="submit" name="submit" value="submit"> </form> </div>
any hint or idea of what im doing wrong?
-
woot woot, i actually figure it out, by making my statement here, i just needed to change one piece of code and rewrite the one important line of code
for($x = 1; $x <= 5; $x++){ echo '<a href="rate.php?id=' . $row['id'] . '&rate=' . $x . '">' . $x . '</a>' . ' '; }
-
I also have no idea what you're talking about. If you only have 1 button then how does someone pick from 5 different ratings?
ok edit what i say
format of file
in PHP
Posted
thanks, didnt know about the jpe