-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
<?php $ageTime = mktime(0, 0, 0, 7, 3, 1978); // Get the person's birthday timestamp $t = time(); // Store current time for consistency $age = ($ageTime < 0) ? ( $t + ($ageTime * -1) ) : $t - $ageTime; $year = 60 * 60 * 24 * 365; $ageYears = $age / $year; echo 'You are ' . floor($ageYears) . ' years old.'; ?>
-
have the hold thing in one form.. <html> <body> <form name="form2" action="test1.php" method="post" enctype="multipart/form-data"> <table width="559" border="2" bordercolor="#D6E7F8" cellpadding="1" cellspacing="1"> <tr> <td width="559" valign="top"> <input type="text" name="companyname" size="60"> </td> </tr> <tr> <td valign="top"> <input type="file" name="photo" size="60"> <input type="submit" name="Submit2" value="Test 2"> </td> </tr> <tr> <td valign="top"> <input type="file" name="logo" size="60"> <input type="submit" name="Submit1" value="Test 3"> </td> </tr> <tr> <td valign="top" align="center"> <input type="submit" value="Test 1"> </td> </tr> </table> </form> </body> </html>
-
1. create a form with description. 2. on the action page use $_GET or $_POST (depends on the method) to get the passed value. 3. use the fwrite to write to file. 4. build into the current script you have. any problems post what you have created in addition to the above scripts
-
change if ($street == null) { to if ($street == "NULL") {
-
you could do it with CSS etc but this is more of a HTML issule.. i dont really know why you are using 3 forms! AND having the button for the top one at the bottom..! personally having a form in a form cause problems..
-
OK first off this is a reallllllllly BAD idea.. but if you must then i would suggect using sessions instead.. if you must use a form to pass the data then use POST if you must use get then use urlencode.. personally i would just send the varible and a control word.. ie <input type='hidden' name='UID' value='$userid'> <input type='hidden' name='CONTROL' value='usergallery'> <?php $UID= (int)$_GET['UID']; mysql_connect("blah","blah","blah"); mysql_select_db("blah") or die("Unable to select database"); switch($_GET['CONTROL']) { case "userprofile": $query = "select profile FROM users where userid=$UID"; break; case "usergallery": $query = "select gallerystuff FROM users where userid=$UID"; braak; } $numresults=mysql_query($query); $numrows=mysql_num_rows($numresults); ?>
-
See fwrite example <?php $filename = 'test.txt'; $somecontent = "Add this to the file\n"; // Let's make sure the file exists and is writable first. if (is_writable($filename)) { // In our example we're opening $filename in append mode. // The file pointer is at the bottom of the file hence // that's where $somecontent will go when we fwrite() it. if (!$handle = fopen($filename, 'a')) { echo "Cannot open file ($filename)"; exit; } // Write $somecontent to our opened file. if (fwrite($handle, $somecontent) === FALSE) { echo "Cannot write to file ($filename)"; exit; } echo "Success, wrote ($somecontent) to file ($filename)"; fclose($handle); } else { echo "The file $filename is not writable"; } ?>
-
i assume you wish to select a option from one drop down, then use that value to control the values in the second drop down.. if thats true.. theirs a few ajax example out their..
-
<html> <body> <table width="559" border="2" bordercolor="#D6E7F8" cellpadding="1" cellspacing="1"> <tr> <td width="559" valign="top"> <form name="form1" method="post" action="test1.php"> <input type="text" name="companyname" size="60"> <input type="submit" value="Test 1"> </form> </td> </tr> <tr> <td valign="top"> <form name="form2" action="test2.php" method="post" enctype="multipart/form-data"> <input type="file" name="photo" size="60"> <input type="submit" name="Submit2" value="Test 2"> </form> <form name="form3" action="test3.php" method="post" enctype="multipart/form-data"> <input type="file" name="logo" size="60"> <input type="submit" name="Submit1" value="Test 3"> </form> </td> </tr> </table> </body> </html>
-
some code will help....
-
AND <td valign="top"> <input type="submit" value="Test 1"> </td> is outside the form block
-
your need to get/post them or use AJAX (maybe cookies)
-
can you add var_dump before the <td><a href=directions.php?id=" .$row['id']. ">Map</td> and tell us what it displays.. will help us. var_dump($street); echo "<td><a href=directions.php?id=" .$row['id']. ">Map</td>";
-
try echo $form; or print($form); as for what your doing is no more secure than html.. as all you really doing is getting php to parse a html page!!. a html page would work just as well heres a littke snip of code to play with (change the $access = true; to $access = false; ) <?php $access = true; if($access) { echo "your inn"; }else{ echo "Go away"; } ?>
-
change Print "<td align="right">".$info['profit'] . " </td>"; to Print '<td align="right">'.$info['profit'].' </td>';
-
Ahh yeah i have been in that boat! the problem with the chatroom (from what i see) is if i help someone then a day or two later someone else could have the same problem, but in the forum they can atleast search for the problem and may find the help they need.. (that also why i always read the posts with the subject "help me" last, in addition i have my own stuff to write so just peeking at the questions posted then when i have time i reply.. so the forum works best for me.. Thats my 4pence!
-
change if($_POST[`order`] == 'YES') to if($_POST['order'] == 'YES')
-
so whats the problem ? i don't think being lonely is PHP problem!! :-\
-
you can't use echo then header.. read the pinned post for example test1.php//will work <?php header('Location:http://localhost/logout.php'); ?> test2.php //will fail <?php echo "Hello"; header('Location:http://localhost/logout.php'); ?> as your calling a function i guess you are already outputting data to the screen
-
Thats because the session hasn't timedout! i think your trying to do this the hard way.. what exactly is the 'problem' ?
-
try <?php // Write Session Data $_SESSION['userid'] = $userid; $_SESSION['auth'] = true; //echo 'login sucessful!'; <-- commented out header('Location: userspage.php'); //<--Added ?> may work but without a complete understanding of what your doing its a guess!
-
add a entry on the form and either write the recieve data to a database or text file.. depends how your working.. as i have see that upload script all over the place i am not going to write the code for you but will give you pointers.. what have you do so far ?