You dont actually seem to be using any of the POST data.
Or have you not put all your code?
You dont actually seem to be using any of the POST data.
Or have you not put all your code?
I would suggest not using *
but actually refering to the table columns. This is concidered a security risk.
Also note that mysql is not longer maintained, you woul dneed to start looking at MySQLi or PDO. If you are just starting I wuld suggest doing this sooner than later :)
// get value of id that sent from address bar
$id=$_GET['id'];
$sql="SELECT * FROM $tbl_name WHERE id='$id'";
This little bit here, leaves you wide open for attack, as you should sainitise the data to prevent attacks.
To retrive the data and sort by DESC:
ORDER BY id DESC
I hope that helps
What's a portable software? and Is It even legal?
It is legal and illegal.
This one Click Here, is a collection of legal compact Apps available.
There are others, and i have in the past come across portable and cracked apps such as Dreamweaver, Flash etc. If it is under the Open Source license then yes this is all above board.
please supply logout.php
this is indicating you have an undefined function, without the code it is hard to help
@LastMitch
If you take the code you have so far:
<form action="photoimage.php" method="post">
Photo: <input type="" name"" valve=" />
<br />
Caption: <input type="" name"" valve="" />
<br />
</form>
You would name the fields, i try to keep them as obvious as possibly.
<form action="photoimage.php" method="post">
Photo: <input name"photo" valve=" />
<br />
Caption: <input name"caption" valve="" />
<br />
</form>
So once you get to your photoimage.php
you will have a $_POST array available to you:
$_POST['photo']
$_POST['caption']
Then you can use those to add to a DB.
This is a gallery upload script which i used, and modified for my needs:
Click Here
Hope it helps
Can you explain?
How is it not working?
Are you getting an error?
Is anything showing in your log files?
I would suggest speaking to your web host company.
They should have a support ticket system. Sounds like a CPanel config glitch.
Silly question but does the DB jqcalendar
exist on your hosting site?
Did you install, or FTP and import the DB tables?
I would suggest you run it through from the begining
@ vishalonne
not a problem, glad it is resolved :)
Although for testing purposes, i tend use XAMPP for local dev
Thatis an example from PHP.net - this is not from me.t
<?php
$to = '' // email address where to send
$subject = '' // Subject matter captured from form
$message = '' // captured from form
mail($to, $subject, $message); // Sends the message
?>
Sorry i miss read. you would use the "mail" function:
That should help.
--
I hadnt seen the link you posted.
I have never had to do this that way.
The SMTP would be configured by your hosting, so just use the "mail" function from my link to PHP.net
--
Example:
<?php
$to = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
'Reply-To: webmaster@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
?>
This is a copy of the drop down i have used on this site: Click Here
<form id="form" method="POST" action="<?php $_SERVER['PHP_SELF']; ?>">
<select id="sel" name="category">
<option value="Select">Please select a gallery..</option>
<?php
$cxn = mysqli_connect($host,$user,$pword,$db)
or die ("Connection failed");
$query = "SELECT category_id,category_name from gallery_category";
$result = mysqli_query($cxn,$query)
or die ("Query Failed");
while( $row_1 = mysqli_fetch_array( $result ) )
{
@$photo_category_list .="<option value='$row_1[0]'";
if ( $_POST["category"] == $row_1[0]) {
@$photo_category_list .= " selected";
}
@$photo_category_list .=">$row_1[1]</option>\n";
}
echo $photo_category_list
?>
</select>
<input name="Submit" type="submit" value="Change Gallery" >
</form>
is this Windows or Linux based server?
You will need to create a site under SITE> New Site.
Then under this you will "Servers" set your connection to FTP, put in your login details on how you access the domain, switch over to Advanced, set the type of server (PHP/MySQL).
Once saved make sure the tick box is set to "remote"
As pritaeas mentioned some packages havent been maintained for a while. But you will find side branches ofpackages which are being maintained out side of PEAR.net. This can be easily added to your repo
I have used PEAR before, but i though it was being replaced by another version. I cannot remember the name of the darn thing. think it was phasr or something like that
+1 for XAMPP very easy to use.
I have used EasyPHP in the past, but personal preference i choose XAMPP
Does your 'ipnlistener.php'
have an unclosed }
?
Sorry was at work :)
I would suggest you take your $_POST data and extract it:
<?php
$con = mysql_connect("localhost","root","mevooo");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
else
{
$services = $_POST['Services'];
$title = $_POST['title'];
$rootcause = $_POST['RootCause'];
$risk = $_POST['RiskRating'];
$impact = $_POST['impact'];
$efforts = $_POST['Efforts'];
$likelihood = $_POST['likelihood'];
$finding = $_POST['Finding'];
$implic = $_POST['Implication'];
$recom = $_POST['Recommendation'];
mysql_select_db("ers_1", $con);
$sql="INSERT INTO findings (Finding_ID, ServiceType_ID, Title, RootCause_ID, RiskRating_ID, Impact_ID, Efforts_ID, Likelihood_ID, Finding,Implication, Recommendation, Report_ID) VALUES ( 1, '$services','$title','$rootcause','$risk','$impact','$efforts','$likelihood','$finding','$implic','$recom', 1 )";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
else{
echo "1 record added";
}
}
mysql_close($con);
?>
<input type="button" value="HOME" onclick="location='insert_Data.php'">
errrr..... 42?
Would help if you could supply the error
Also i am sure if this would have the affect but your DOCTYPE
is mis spelt
<DCOTYPE html>
<html>
where is your SQL statement?
What uis the content of test.php
?
Your form is incomplete, plus you have a FORM within a FORM. I do not beleive this is viable
how have you tried adding it in before?
do you have any examples?
@pritaeas, many thanks
+1
Can anyone else help out on this?
:) nope didnt work
@blocblue,
The idea would be to idetify the form input that contained @
, which would then be indentified as an email address, which i can then validate using the FILTER_VALIDATE_EMAIL.
Hope that makes sense.
:EDIT:
So i could in theory then use just this (?):
foreach ($_POST as $formIdentifier => $userInput)
{
// Filter
if(!filter_var($userInput, FILTER_VALIDATE_EMAIL))
{
echo "email is invalid";
// Add into badData[] array
# $badData[] ="You have entered an invalid email address";
}
}
ok i have tidied a small part:
foreach ($_POST as $formIdentifier => $userInput)
{
// Filter
if(strtolower($formIdentifier) == "email")
{
if(!filter_var($userInput, FILTER_VALIDATE_EMAIL))
{
echo "email is invalid";
}
}
}
How can i change the "email" to check the variable for any @
?
its all very messy at the moment, so would prefer not to post as yet.
But because form fields are always different this is where i cannot get my head round how to set for this in the class
Hi all,
I am working on a generic form validation class.
However I have hit a stubling block. Form fields will never be the same from user to user.
Is there a work around for this? Would it be easier to use numerical values for field names and use multiple validation functions (minimal duplication then :))?
Any assistance would be greatly appreciated
I can't figure out why the contact form doesn't send me a notification email telling me someone submitted a form.
You need to call in (include/require_once) when the form is submitted, which triggers an email
I don't know how to send a user a message through their email saying that we got their form submitted.
As above
I can't figure out how to put a message in the same window saying "Thanks for Submitting Form" without putting this on another page.
You could use if(!isset())
so if the form is not submitted you display the form, else you show the "Thanks", with a timed re direct(?).
I can't figure out how to make fields required.
Basic HTML fields????
I can't figure out a solution in putting ways in checking for real emails, so I don't get spammed by users sending fake emails (the email form has to have the @ symbol in order for it to work).
I can't figure out how to allow user's to only send form once.
Login some kind of DB table
If you need help to develop this drop me a PM with further details
<?php
if ($second == "")
{
if($first - $third <= 5)
{
echo "<img src='images/img1.png' />";
}
else
{
echo "<img src='images/img3.png' />";
}
}
else
{
if($first - $second <= 5)
{
echo "<img src='images/img1.png' />";
}
else
{
echo "<img src='images/img2.png' />";
}
}
?>
Img 3 will never show as they way you have your logic <=5
& >5
what else is there?
It will be greater or less than or equal to :)
Thanks squidge, working fine as it should now. Thanks a lot
No problems, sorry for the previous error of mine. Been a long day :)
How are you showing this?
<?php
$form = "<form method='post' action='signup-p.php' id='signupform'>
<div class='form'>
<div class='fieldset'>
<input name='signup_form' type='hidden' />
<div class='input'>
<label for='username'>Username</label>
<input type='text' name='user' id='username' value='' />
</div>
<div class='input'>
<label for='email'>E-mail</label>
<input type='text' name='email' id='email' value='' />
</div>
<div class='input'>
<label for='email_confirm'>Confirm E-mail</label>
<input type='text' name='email_confirm' id='email_confirm' value='' />
</div>
<div class='input'>
<label for='password'>Password</label>
<input type='password' name='password' id='password' />
</div>
<div class='input'>
<label for='password_confirm'>Confirm password</label>
<input type='password' name='password_confirm' id='password_confirm' />
</div>
</div>
<div class='button'><strong><input type='submit' class='submit' name='registerbtn' value='Sign up' /></strong></div>
</div>
</form>";
echo $form;
?>
Works without iss or error
$form = "<form method='post' action='signup-p.php' id='signupform'>
sorry missed this one. add an echo:
`$form = echo "<form method='post' action='signup-p.php' id='signupform'>
<form method="post" action="signup-p.php" id="signupform">
<div class="form">
<div class="fieldset">
<input name="signup_form" type="hidden" />
<div class="input">
<label for="username">Username</label>
<input type="text" name="user" id="username" value="" />
</div>
<div class="input">
<label for="email">E-mail</label>
I would suggest changing all the " used in this to '
<?php
$form = "<form method='post' action='signup-p.php' id='signupform'>
<div class='form'>
<div class='fieldset'>
<input name='signup_form' type='hidden' />
<div class='input'>
<label for='username'>Username</label>
<input type='text' name='user' id='username' value='' />
</div>
<div class='input'>
<label for='email'>E-mail</label>
<input type='text' name='email' id='email' value='' />
</div>
<div class='input'>
<label for='email_confirm'>Confirm E-mail</label>
<input type='text' name='email_confirm' id='email_confirm' value='' />
</div>
<div class='input'>
<label for='password'>Password</label>
<input type='password' name='password' id='password' />
</div>
<div class='input'>
<label for='password_confirm'>Confirm password</label>
<input type='password' name='password_confirm' id='password_confirm' />
</div>
</div>
<div class='button'><strong><input type='submit' class='submit' name='registerbtn' value='Sign up' /></strong></div>
</div>
</form>";
?>
You also have not terminated your php usng ;
It would help to know the area you want to change to red.
As i had stated you would use an if statement nested into your existing loops. You will need to validate the data:
for example if $result4 == 'data'
why is it stating not to use array_reverse()?
What is this for?
<table broder="1">
<tr>
<td>Result 1</td>
<td>Result 2</td>
<td>Result 3</td>
<td>Result 4</td>
</tr>
Then step through your while loop.
For changing colour:
if $result4 =='fail'{
do this
}
the column "aphoto"
mine is just plain blob.
yeah my friends also suggest that holding a picture to a database is a drag..
thay say i'll just create a folder where i can store the images then save the file path into mysql but i have no idea on doing this..
thanks for your suggestion.
Have a look at this tut Click Here
what is the column in your DB set to that holds the image?
I think this has to be Long BLOB or Big BLOB.
I would suggest however not hold images in the table, but holding only the file name. Loading an image out of the DB is very heavy on CPU and network
you havent closed the IF statement, you are missing "}"
Is the image stored in the DB?
Is the image displayed if you put the name in directly?
what is the output of var_dump($email)?
Is this information transfering?
You can apply formatting to the email also
<form id="form" name="form" method="post" action="name_of_script.php">
<h1>Contact Us</h1>
<label>Name</label>
<input type="text" name="name" id="name" />
<label> Email</label>
<input type="text" name="email" id="email" />
<label>Comments
</label>
<input type="text" textarea name="comment" id="comment"></textarea>
<button type="submit">Sign-up</button>
<div class="spacer"></div>
</form>
Very basic, but you should get the idea:
<?php
$to = '[YOUR_EMAIL_ADDRESS]';
//Clean data
$name = strip_tags(trim($_POST[name]));
$email = strip_tags(trim($_POST[email]));
$comment = strip_tags(trim($_POST[comment]));
////
$subject = "New form submitted";
$message = $name . "has submitted a form\n";
$message .= "Email address " . $email"\n";
$message .= "Comment: " . $comment;
mail($to,$subject,$message);
?>