-
Posts
2,527 -
Joined
-
Last visited
Posts posted by DeanWhitehouse
-
-
so if the file was like
//config.inc.php file $db_name = "name"; //etc...
then you could do
$file = fopen("config.inc.php"); echo $db_name;
that should do it i think, not 100% so test it out
-
fread, fwrite, fopen and fclose, but not in that order
-
On my CMS i started i used a file called config.inc.php which just stored variables like the database details.
-
Ok, then how did you write a registration and login script ?
Look at this kinda tutorial which covers login and protected for pages
-
-
Yes, do you actually mean can we write it for you?
To do this check for a session (which is set when logging in) then use a session to get that users details, if the session is not present then tell them they need to log in
-
There is one on the main site about security
-
Ok then run a query to get the details from the database using their id (or whatever you are setting in the session) in the query to get the correct users info
-
Ok, do you have a question for us, if not this is the wrong section.
-
one way would be to use PHP to find every monday between the two times, using string to time function, to improve that i would have it loop through the dates going from the start to the end adding one day at a time until it hits the first monday and from there add 7 days at a time, and record the dates for mondays in an array
-
You should also learn how to name variables with relevant names and write code that can be understood by any programmer, then you will get help quicker
-
Try running mysql_real_escape_string on the var first
-
change
$f = str_replace('_',' ',$f);
echo '<tr><td>'.$f.'</td>';
to
echo '<tr><td>'. str_replace('_',' ',$f).'</td>';
-
try
str_replace('_',' ',($d)
-
-
Yeah put that replace code where you are printing the names
-
Sorry i wrote it wrong
Should be
$sql = mysql_query("SELECT ".implode(' ,',$fieldArr)." FROM dailypricing") or die(mysql_error());
-
Yeah i thought it didn't, that's why his question didn't make sense, therefore i was asking him to put that in to see if it is the problem.
-
Try the code i just said, lol
-
To read a text file do
echo file_get_contents("file.txt");
-
It shouldn't do that, but just in case it is caused by what i think try putting an @ symbol in front of the mail function
-
Ok then try doing
$sql = mysql_query("SELECT ".implode(' ,','_',' ',($fieldArr))." FROM dailypricing") or die(mysql_error());
-
Also use trim to make sure they don't just have spaces
-
change
if($_GET)
to
if(isset($_GET['submit']))
[SOLVED] Member's Area
in PHP Coding Help
Posted
I thought you said you wrote a login script?