
watthehell
Members-
Posts
143 -
Joined
-
Last visited
Never
Everything posted by watthehell
-
Ohh then how to make it come before page refresh... any idea
-
I have kept Session Start, ob_start, ob_end_flush everything but it does not work... Is it problem of echoing a value(which is inside the function itself) before calling the function ?? Dont have the code now but will be posting it later... thnks..
-
hi all.. back again Now this time another problem (really a stupid one i think) I have the function to display calendar <?php function DisplayCalender($id,$month,$year) { //code and stuffs goes here.. theres no problem in it // here i stored the value of date in session $_SESSION['mydate']=$currdate; ?> and In the table part i echoed the $_SESSION value, but what happens is when the page loads the value of session does not come and when i refresh the page it comes. Why is this happening, can someone help me ...
-
**please help** simple php contact us form help
watthehell replied to cmbcorp's topic in PHP Coding Help
Now try this <?php ob_start(); $to = $_REQUEST['sendto']; $from = $_REQUEST['Email']; $name = $_REQUEST['Name']; $company = $_REQUEST['Company']; $phone = $_REQUEST['Phone']; $headers = "From: $from"; $subject = "Counter Intelligence POS - Support Help Desk Form"; $fields = array(); $fields{"Name"} = "Name"; $fields{"Company"} = "Company"; $fields{"Email"} = "Email"; $fields{"Phone"} = "Phone"; $fields{"ciposver"} = "CIPosVersion"; $fields{"ciofficever"} = "CIOfficeVersion"; $fields{"cios"} = "CIOperatingSystems"; $fields{"Message"} = "CIDetailedIssue"; $body = "We have received the following information:\n\n"; foreach($fields as $a => $b) { $body.=sprintf("%20s: %s\n",$b,$_REQUEST[$a]); } $headers2 = "From: [email protected]"; $subject2 = "Thank you for contacting us"; $autoreply = "Thank you for for your query. A support representitive will be in contact with you shortly!."; if($from=='') {print "You have not entered an email, please go back and try again";} if($name=='') {print "You have not entered a name, please go back and try again";} if($phone=='') {print "You have not entered a phone number, please go back and try again";} if($company=='') {print "You have not entered a company name, please go back and try again";} $isfreeofErrors=1; if ($isfreeofErrors==1) { $send = mail($to, $subject, $body, $headers); $send2 = mail($from, $subject2, $autoreply, $headers2); if($send) { header("Location: http://www.counterintelligencepos.com.au/thankyou.html"); } else { echo "We encountered an error sending your mail, please notify [email protected]"; } } else { echo "Something is still wrong."; } ?> -
Does the name field save path to the images ?? Are u saving the path or not ?? Check this <?php //select images from table images(display all thumbnails for a category) $query2 = "SELECT name FROM images"; $result2 = mysql_query($query2); $quantity = mysql_num_rows($result2); $colsPerRow = 8; $i = 0; while($row2 = mysql_fetch_array($result2)){ $ProImg2 = $row2['name']; if ($i % $colsPerRow == 0) { // start a new row echo '<tr>'; // what is this for ??? // $imgLoc2[$i]="mall/smallthumbnail.php?i=http://localhost/photo_album/mall/images/$ProImg2[$i]&w=50&h=50"; ?> <? if($ProImg2!=""){?> <td> <a href="" onmouseover=replaceImage(<?=$ProImg2?>);><IMG style="CURSOR: hand" alt="pink" src="<?=$ProImg2;?>" width="50" height="50" border="0"></A></td> <? } else { ?> <td>No Image Found </td> <? } ?> </table> <? $i += 1; } }?> </table> </tr>
-
**please help** simple php contact us form help
watthehell replied to cmbcorp's topic in PHP Coding Help
If you get Undefined index, so please declare all variables null at the beginning <?php $to = $_REQUEST['sendto']; $from = $_REQUEST['Email']; $name = $_REQUEST['Name']; $company = $_REQUEST['Company']; $phone = $_REQUEST['Phone']; $headers = "From: $from"; $subject = "Counter Intelligence POS - Support Help Desk Form"; $fields = array(); $fields{"Name"} = "Name"; $fields{"Company"} = "Company"; $fields{"Email"} = "Email"; $fields{"Phone"} = "Phone"; $fields{"ciposver"} = "CIPosVersion"; $fields{"ciofficever"} = "CIOfficeVersion"; $fields{"cios"} = "CIOperatingSystems"; $fields{"Message"} = "CIDetailedIssue"; $body = "We have received the following information:\n\n"; foreach($fields as $a => $b) { $body.=sprintf("%20s: %s\n",$b,$_REQUEST[$a]); } $headers2 = "From: [email protected]"; $subject2 = "Thank you for contacting us"; $autoreply = "Thank you for for your query. A support representitive will be in contact with you shortly!."; if($from=='') {print "You have not entered an email, please go back and try again";} if($name=='') {print "You have not entered a name, please go back and try again";} if($phone=='') {print "You have not entered a phone number, please go back and try again";} if($company=='') {print "You have not entered a company name, please go back and try again";} else { $send = mail($to, $subject, $body, $headers); $send2 = mail($from, $subject2, $autoreply, $headers2); if($send) { header("Location: http://www.counterintelligencepos.com.au/thankyou.html"); } else { echo "We encountered an error sending your mail, please notify [email protected]"; } } ?> -
Thanks a lot... it worked..... IT took me whole day but still i couldn't figure out what the problem was... After all Genius is Genius One more question : Why doesn't mysql compare the date like Select * from reservation where mydate=2007-9-14; And in table i have 4 records that matches this record.. Anyway thanks a lot..
-
**please help** simple php contact us form help
watthehell replied to cmbcorp's topic in PHP Coding Help
One extra brace at the last line hope this works <?php $to = $_REQUEST['sendto'] ; $from = $_REQUEST['Email'] ; $name = $_REQUEST['Name'] ; $company = $_REQUEST['Company'] ; $phone = $_REQUEST['Phone'] ; $headers = "From: $from"; $subject = "Counter Intelligence POS - Support Help Desk Form"; $fields = array(); $fields{"Name"} = "Name"; $fields{"Company"} = "Company"; $fields{"Email"} = "Email"; $fields{"Phone"} = "Phone"; $fields{"ciposver"} = "CIPosVersion"; $fields{"ciofficever"} = "CIOfficeVersion"; $fields{"cios"} = "CIOperatingSystems"; $fields{"Message"} = "CIDetailedIssue"; $body = "We have received the following information:\n\n"; foreach($fields as $a => $b) { $body .= sprintf("%20s: %s\n",$b,$_REQUEST[$a]); } $headers2 = "From: [email protected]"; $subject2 = "Thank you for contacting us"; $autoreply = "Thank you for for your query. A support representitive will be in contact with you shortly!."; if($from == '') {print "You have not entered an email, please go back and try again";} else { if($name == '') {print "You have not entered a name, please go back and try again";} else { if($phone == '') {print "You have not entered a phone number, please go back and try again";} else { if($company == '') {print "You have not entered a company name, please go back and try again";} else { $send = mail($to, $subject, $body, $headers); $send2 = mail($from, $subject2, $autoreply, $headers2); if($send) { header( "Location: http://www.counterintelligencepos.com.au/thankyou.html" ); } else { print "We encountered an error sending your mail, please notify [email protected]"; } } ?> -
hi How to compare date in MYSQL, it is not showing any result SELECT * FROM user_reservation WHERE user_reserve_date=2007-09-14; In user_reserve_date field in db there are 4 data 2007-09-14; Yet it is now showing any result thnks...
-
Can you post your Table Structure ??? What is the field name of the image in DB ???
-
hi, CAn anyone guide me on this: I need to check for a user reservation (time and date) and wrote this but it does not seem to work. Any help will be most welcome. <?php // here from--to is user selected time e.g 9 am to 10am if(($from <$to)) { /* checking whether the user selected time overlaps the reserved time this works fine, the problem i am having is while checking for date it does not work..I wrote those 2 queries in one */ $que1= "SELECT * FROM user_reservation WHERE (user_reserve_time_end > $from AND user_reserve_time_start < $to)"; $que_date="SELECT * FROM user_reservation WHERE user_reserve_date LIKE ".$date; $result_date = mysql_query($que_date); $result1 = mysql_query($que1); if (mysql_num_rows($result1)!=0 && mysql_num_rows($result_date)!=0) { $var1=true; $app->error_display_type=2; $app->error("This record overlaps existing time slots"); } else { // inserting value this is working } ?> The main problem is that this condition checks if the time overlaps or not but it does not check for date, it does not allow the user to save same time on different date. thnks...
-
Adjust your code accordingly... <?php $query2 = "SELECT name FROM images"; $result2 = mysql_query($query2); $quantity = mysql_num_rows($result2); $colsPerRow = 8; $i = 0; while($row2 = mysql_fetch_array($result2)){ if ($i % $colsPerRow == 0) { // start a new row echo '<tr>'; ?> <td width="22" height="182"> </td> <td width="40%" valign="top"> <table width="50%" border="0" cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td width="135" height="19" valign="top"><!--DWLayoutEmptyCell--> </td> </tr> <tr> <td height="136" valign="top"> <? if($row2['$ProImg2']!=""){?> <img src="<?=$row2['$ProImg2']?>" alt="" width="135" height="136" border="0" /></td> <? } ?> </table> </td> <? $i += 1; } ?> </tr>
-
Miscellaneous Topics that do not fall into all of the other forums. You can have personal discussions here about the weather, your car, your dog or whatever.. Have fun | | I am having fun...LOL Oops... it is not for post count man...wouldn't live here for too long..maybe till this Christmas or New Year.. Then I'll be a free man
-
Try This <?php //listing results $sql = "SELECT listings.* FROM listings"; $result = mysql_query($sql); $numrows = mysql_num_rows($result); require("header.php"); echo "<table cellpadding ='5'>"; echo "<tr>"; echo "<h1>Available Properties</h1>"; echo "<th>Image</th>"; echo "<th>Item</th>"; echo "<th>Bed/Bath/Garage</th>"; echo "<th>Rent</th>"; echo "<th>Description</th>"; echo "</tr>"; if($numrows == 0) { echo "<tr><td colspan=4>No Items!</td></tr>"; } else { while($row = mysql_fetch_assoc($result)) { $imagesql = "SELECT * FROM images WHERE listing_id = ". $row['id']." LIMIT 1"; $imageresult = mysql_query($imagesql); $imagenumrows = mysql_num_rows($imageresult); echo "<tr>"; if($imagenumrows == 0) { echo "<td>No Image</td>"; } else { $imagerow = mysql_fetch_assoc($imageresult); echo "<td><img src=".$imageresult["content"]." width="100" height="100" border="0" /></td>"; } echo "<td>"; echo "<a href='listingdetails.php?id=" . $row['id'] . "'>" . $row['address'] . "[/url]"; $_SESSION['USERID'] == $row['user_id']; echo "</td>"; $BBGsql = "SELECT * FROM listings WHERE listings.id=" . $row['id'] . ";"; $BBGresult = mysql_query($BBGsql); $BBGrow = mysql_fetch_assoc($BBGresult); $BBGnumrows = mysql_num_rows($BBGresult); echo "<td>"; echo $BBGrow['bed'] . " ⁄ "; echo $BBGrow['bath'] . " ⁄ "; echo $BBGrow['garage']; echo "</td>"; echo "<td>" . $config_currency; echo $BBGrow['rent']; echo "</td>"; echo "<td>"; echo $BBGrow['description']; echo "</td>"; ?>
-
I think PHP name must be changed to : For all the Gurus and Supergurus out there People Hypnotizing Program For the mods Post Hhaving Problems For newBies Personnel Headache Planner L.O.L I think it will be done when PHP 7 will be released.... just kidding This is not meant to be read as offense in anyway...
-
Ya.. thanks man, I now understood crystal clear Now, what happened was when i "bump--ed" my thread, someone wrote, "Hey, what type of question is that ?? "" LOL...need to tell everybody about this... Thanks and cheers.... having a beer, will u join me
-
You may see here... http://httpd.apache.org/docs/1.3/misc/rewriteguide.html Nobody can teach you better than this Apache 1.3 URL Rewriting Guide Originally written by Ralf S. Engelschall <[email protected]> December 1997 Cheers...
-
[SOLVED] Doing a login page,got error Undefined variable
watthehell replied to ohguowei's topic in PHP Coding Help
check this hope it works... <?php $message=""; if ($_POST['submit']=='Submit') { if (!$_POST['UserName'] || $_POST['UserName'] == "" || strlen($_POST['UserName'] > 30 )){ $message= '<p>There is a problem. Did you enter an user name?</p>'; } else{ //open connection to the database mysql_connect("localhost","root","") or die("Failure to cmmunicate with database!!!"); mysql_select_db("User"); $as_UserName = addslashes($POST['UserName']); $as_UserPassword = addslashes($POST['UserPassword']); $as_UserEmail = addslashes($POST['UserEmail']); $tr_UserName = trim($as_UserName); $tr_UserPassword = trim($as_UserPassword); $tr_UserEmail = trim($as_UserEmail); $query ="INSERT INTO USER_INFORMATION (USER_ID, USER_NAME, USER_PASSWORD, USER_EMAIL) VALUES (NULL, '$tr_UserName', '$tr_UserPassword', '$tr_UserEmail')"; $result = mysql_query($query); if (mysql_affected_rows()==1){ $message = "<p>Your information has been recorded. Please login and enjoy the game</p>"; $noform_var=1; } else { error_log(sql_error()); $message = "<p>Something went wrong with your signup attempt. Please email the admin for more information.</p>"; } } //show the form in every case except successful submission if($noform_var!=1) { $thisfile = $_SERVER['PHP_SELF']; $message .= <<< EOMSG; echo "<FORM METHOD=\"post\"> <B>Your Name:<INPUT TYPE=\"TEXT\" SIZE=25 NAME=\"UserName\"> <BR><BR> <B> Your PassWord:<INPUT TYPE=\"TEXT\" SIZE=25 NAME=\"UserPassword\"> <BR><BR> <B> Your Email:<INPUT TYPE=\"TEXT\" SIZE=25 NAME=\"UserEmail\"> <BR><BR> <INPUT TYPE=\"submit\" NAME=\"submit\" VALUE="Submit"> </form>"; } } ?> <html> <head> <STYLE type ="text/css"> <!-- BODY, p {color:black; font-family: verdana;font-size: 10 pt} H! {color:n;acl; fpmt-family: arial; font-size:12 pt} --> </style> <title>Login Page</title> </head> <body> <table border=0 cellpadding=10 witdth=100%> <tr> <td bgcolor="#F0F8FF" align=center valign=top width=17%> </td> <TD bgcolor="#FFFFFF" align=left valign=top width=83%> <h1> Newsletter sign-up form</h1> <?php echo $message; ?> </td> </tr> </table> </body> </html> -
LOL.. i saw the site.. all code is given there.. so what are u waiting for.. downloads the documentation for PHP & MYSQL read it and do it .. it ain't hard. OR download WAMP from http://www.wampserver.com, then do as it is written in the website..
-
[SOLVED] Doing a login page,got error Undefined variable
watthehell replied to ohguowei's topic in PHP Coding Help
The index message is undefined the first time through ! try this it wont come again <?php $message=""; if ($_POST[ 'submit' ] == 'Submit') { if (!$_POST['UserName'] || $_POST['UserName'] == "" || strlen($_POST['UserName'] > 30 )){ $message= '<p>There is a problem. Did you enter an user name?</p>'; } else{ //open connection to the database mysql_connect("localhost","root","") or die("Failure to cmmunicate with database!!!"); mysql_select_db("User"); $as_UserName = addslashes($POST['UserName']); $as_UserPassword = addslashes($POST['UserPassword']); $as_UserEmail = addslashes($POST['UserEmail']); $tr_UserName = trim($as_UserName); $tr_UserPassword = trim($as_UserPassword); $tr_UserEmail = trim($as_UserEmail); $query ="INSERT INTO USER_INFORMATION (USER_ID, USER_NAME, USER_PASSWORD, USER_EMAIL) VALUES (NULL, '$tr_UserName', '$tr_UserPassword', '$tr_UserEmail')"; $result = mysql_query($query); if (mysql_affected_rows()==1){ $message = "<p>Your information has been recorded. Please login and enjoy the game</p>"; $noform_var = 1; } else { error_log(sql_error()); $message = "<p>Something went wrong with your signup attempt. Please email the admin for more information.</p>"; } } //show the form in every case except successful submission if(!$noform_var) { $thisfile = $_SERVER['PHP_SELF']; $message .= <<< EOMSG <FORM METHOD="post" ACTION="$thisfile"> <B>Your Name:<INPUT TYPE="TEXT" SIZE=25 NAME="UserName"> <BR><BR> <B> Your PassWord:<INPUT TYPE="TEXT" SIZE=25 NAME="UserPassword"> <BR><BR> <B> Your Email:<INPUT TYPE="TEXT" SIZE=25 NAME="UserEmail"> <BR><BR> <INPUT TYPE="submit" NAME="submit" VALUE="Submit"> </form> EOMSG; } } ?> <html> <head> <STYLE type ="text/css"> <!-- BODY, p {color:black; font-family: verdana;font-size: 10 pt} H! {color:n;acl; fpmt-family: arial; font-size:12 pt} --> </style> <title>Login Page</title> </head> <body> <table border=0 cellpadding=10 witdth=100%> <tr> <td bgcolor="#F0F8FF" align=center valign=top width=17%> </td> <TD bgcolor="#FFFFFF" align=left valign=top width=83%> <h1> Newsletter sign-up form</h1> <?php echo $message; ?> </td> </tr> </table> </body> </html> -
I think the question got confusing... I didn't understood myself seeing again .. LOL I made this simple... a) User will select a date (e.g: 2007-9-12). It is stored in a variable $date b) Then he will select a time for reservation from list box, e.g I want to reserve from 9:00 am to 10:00 am on 2007-9-12 But what happened is if the user selects 9:00 am to 10:00am on 12th September it gets saved, and when another user wants to save the same time on 13th September it does not allow (from the code i posted above). I think i could not write the SQL query properly, anyone give a quick glance and give some hints.. plz my query without checking for date SELECT * FROM user_reservation WHERE (user_reserve_time_end > $from AND user_reserve_time_start < $to)"; with date SELECT * FROM user_reservation WHERE (user_reserve_time_end > $from AND user_reserve_time_start < $to) AND user_reserve_date=$date";
-
*bump*
-
hi all ... I had read in the PHP guideline that to re post the thread (I or WE) started, we need to use *bump* So, anyone here knows where that BUMP is located, i didn't find it or we need to write *bump* and post as a new reply... I did that also and nothing amazing happened... LOL cheers...
-
hi all... This is about a reservation where the user will select a time FROM (hour and minute) and TO (hour and minute), these values are taken from the list box and the date is as selected by the user the problem i am having is For e.g if the user selects 6 am to 7 am on 13th september 2007 Other user cannot save the same time in the next date i.e 14th, 15th, 16th and so on... I did it like this <?php $fromhr=$_REQUEST['from']; // from list box FROM->Hour $tohr=$_REQUEST['to']; //from list box TO->Hour $frommin=$_REQUEST['fromtime']; //from list box From->min $tomin=$_REQUEST['totime']; // from list box TO->min $date = $user_sel_date; // this is the user selected date saves in date field in db //here i checked for the condition for time overlapping and TO time must not be less than FROM time if(($from <$to)) { /* Here in this query i am having confusion how to check for the date value, user must be allowed to save the same time but for separate dates.. can anyone guide me please in this query*/ $que1= "SELECT * FROM user_reservation WHERE (user_reserve_time_end > $from AND user_reserve_time_start < $to)"; $result1 = mysql_query($que1); if (mysql_num_rows($result1)!=0) { $var1=true; $app->error_display_type=2; $app->error("This record overlaps existing time slots"); } else { $var2=true; $que2="insert into voyance_user_reservation values('','".$curruserid."','".$from."','".$to."','".$date."','','')"; $result2=mysql_query($que2); $app->error_display_type=2; $app->error("Time Reserved Successfuly"); } } else { $var3=true; $app->error_display_type=2; $app->error("Start Time Cannot Be Greater Than Or Equal To The End Time"); } ?> thnks...
-
Suggestions Could you make this site little broad. It takes time to find the thing looking for.. And I can see my password... LOL... even my friend saw it.. Can you keep small Icons near the links... Only suggestions, didn't have time to check,,, will see it later... And from where do we register ???