![](https://forums.phpfreaks.com/uploads/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
fugix
-
Posts
1,483 -
Joined
-
Last visited
Posts posted by fugix
-
-
I know that the following lines of code can be used to prevent errors from being displayed:
<?php error_reporting(0); ini_set('display_errors', 0); ?>
Is there a reason to use one over the other? Is it better to use both?
honestly, that is a good question, one that i would like the answer to as well. It seems to me that both results would be the same, just two different ways of executing it. error_reporting(0) sets the level that you specify for the runtime of the script. While ini_set('displlay_errors', 0) will set the configuration option until the script is finished executing.
-
simple enough, are you having trouble with creating the file as well, or does it create the file but not write to it? Also, do you receive any errors when this script is run?
-
the first part of this code is not necessary..can shorten it to this
$myFile = $_POST['sitename']; $fh = fopen($myFile, 'w') or die("can't open file"); $stringData = "test\n"; fwrite($fh, $stringData); $stringData = "test\n"; fwrite($fh, $stringData); fclose($fh);
also, can you show the form that you use to do this please and any php that pertains
-
i have some other forms in a dropdown menu with different form names
those get passed on and entered into mysql by php, but the date one doesnt get updated, just 00-00-0000
should i post the whole html and php?
yes if you wouldn't mind, so i can see how you are going about this
-
you would want to incorporate the mail() function then
-
thanks for quick response fugix,
however im having troubles still, not sure if i have everything entered correctly though.
i have a form which is being posted by php to mysql
here is my html:
<form name="DATE1" method="post">
<div><select name="day" id="Date1" class="regularfont"><option value="" selected="selected"></option>
<option value="1">01</option>
<option value="2">02</option>
</select> <select name="month" id="Date2" class="regularfont"><option value="" selected="selected"></option>
<option value="1">January</option>
<option value="2">February</option>
</select> <select name="year" id="Date3" class="regularfont"><option value="" selected="selected"></option>
<option value="2014">2014</option>
<option value="2013">2013</option>
on submit it passed on to php
<?php
$Date1 = $_POST['day'] . "-" . $_POST['month'] . "-" . $_POST['year'];
?>
what am i doing wrong ?
well, what is happening when the form is sent?
-
firstly change you select names to "Day" "Month" "Year" accordingly, then you could simply combine the 3 to form a legitimate date to insert into your db. like so
$date = $_POST['day'] . "-" . $_POST['Month'] . "-" . $_POST['Year'];
-
Wait, they're actually using XML with Ajax? Ugh. JSON for the win.
lol, well it works, and they are too busy to re-write, perhaps what they want me for
or to be a sex slave? just saying
-
he is right, so you would have
$insertq = "INSERT INTO `customer_details` (`full_name`) VALUES ('$name')";
-
I believe that it is because you are placing backticks around the variable that you want to insert, instead of this
$insertq = "INSERT INTO `customer_details` (`full_name`) VALUES (`$name`)";
try this
$insertq = "INSERT INTO `customer_details` (`full_name`) VALUES ($name)";
-
firstly, get into the habit of placing your attributes in double quotations, example
these lines
<form method=post name=adauga_etapa> <table cellspacing=1 cellpadding=2 border=1 align=center>
should be
<form method="post" name="adauga_etapa"> <table cellspacing="1" cellpadding="2" border="1" align="center">
this will help you to avoid errors in the future...
also, can you show me an example of what this line
echo $_POST['gazde']." - ".$_POST['oaspeti'];
is echoing when the form is submitted with 2 word strings.
-
okay i noticed two errors in your code..both having to deal with the mysql_error() function.
1. this line
$insert = mysql_query($insertq) or die (mysql_error);
should be
$insert = mysql_query($insertq) or die (mysql_error());
you forgot the parenthesis around your mysql_error() function...which it why it was only printing the string "mysql_error"
2. in your connection page you are missing a parenthesis for the mysql_error() function inside of your trigger_error() function..
$superconnect = mysql_pconnect($hostname_superconnect, $username_superconnect, $password_superconnect) or trigger_error(mysql_error(),
should be
$superconnect = mysql_pconnect($hostname_superconnect, $username_superconnect, $password_superconnect) or trigger_error(mysql_error()),
we will start there...once you change the above, show me what you get
-
i either use bluefish or gedit, leaning more towards gedit now though
-
u r a start mate, it works fine, been a long time havent touched php almost forgotten it, thank you again
no problem at all, if you have any more questions let us know
-
there are a couple of errors that I notice when looking at your code..
1. you are receving the notice for the undefined index because you $_POST['email'] has not been processed. This is probably because you have not submitted the form yet. To get rid of this error simply change this
if(!$email || !$enteredpassword)
to
if(!isset($email) || !$enteredpassword)
the isset() function will check if the index has been set, if it hasn't, it will not give you that notice.
2. you are receiving the mysl_fetch_array() and mysql_num_rows errors because your mysql_query is incorrect. by writing this
$getuser=mysql_query("SELECT * FROM users WHERE $email='email'");
you are setting the column_name to your variable which is not what you want to do...try this instead
$getuser=mysql_query("SELECT * FROM users WHERE email='$email'");
this is assuming that your column_name is email..if you have any more problems let us know
-
also, php.net offers run-through on the basics of the OOP syntax..you might already know most of the inforamtion, however they provide examples that may help you to understand the syntax/theory better http://www.php.net/manual/en/language.oop5.php
-
to asnwer your first question....it looks like it would return a boolean response yes
-
welcome. i can say the same thing about working with graphics.i hate it. but backend web development yeah i will jump on that train.
-
You are missing a double-quote on the end of your DELETE query statement.
You should be using a programming editor with color highlighting (that's how I pinpointed where the problem was - the colors stopped changing because everything after the missing quote was treated as part of that string.)
good catch, missed it....ihbdan if you have further errors let us know
-
firstly, can you show me the line that the error is referring to please
-
firstly, i found your post on another site http://www.touchofdeathforums.com/smf/index.php?topic=62072.0
thought that was interesting...
1. what happens when you add a specific directory..
2. what does your .htaccess look like
-
do you receive any errors if your add debugging...eg
$instrList=mysql_query("select distinct classOfferings.instructorId, instructors.fName, instructors.lName from instructorId AS co INNER JOIN instructors AS i ON instructorId WHERE co.instructorId = i.instructorId order by lName asc") or die(mysql_error());
-
no problem, sorry i couldn't be of more help
-
Creating and writing a file by form
in PHP Coding Help
Posted
okay we are going to add some simple code to check and make sure that the file is writable...try