n00bert
Members-
Posts
18 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
n00bert's Achievements
Newbie (1/5)
0
Reputation
-
I'm an idiot... I just noticed I had this running a few lines above all my other code mysql_query("UPDATE ushits_orders SET customer_id='".mysql_insert_id()."', session_id = '0' WHERE session_id='".$session."' "); Sorry I wasted your time guys.
-
yeah, the query works fine... it just seems like it's not concatenating the $strMainbody for that area... idk
-
You could do something like this that I found using google. <? $str = "This is just some text"; // use two spaces for the seperator while (sizeof ($array=explode (" ",$str)) != 1) { // use one space for the glue $str = implode (" ",$array); } echo $str; ?> hope that helps.
-
Yes, I know the subject for this thread is horrible but didn't really know how to sum it up. XD anyway what I am doing here is sending an email invoice to customers.. The problem is that the emails don't contain any products. Here is that section of code for the script. <?php $strMailbody = "<table width=\"600\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"margin:0 auto;\"> <tr> <td><strong>Billing Information</strong></td> <td><strong>Shipping Information</strong></td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td>".$_POST['first_name']." ".$_POST['last_name']."</td> <td>".$_POST['sfirst_name']." ".$_POST['slast_name']."</td> </tr> <tr> <td>".$_POST['address']."</td> <td>".$_POST['saddress']."</td> </tr> <tr> <td>".$_POST['city'].", ".$_POST['state']."</td> <td>".$_POST['scity'].", ".$_POST['sstate']."</td> </tr> <tr> <td>".$_POST['postal']."</td> <td>".$_POST['spostal']."</td> </tr> <tr> <td>".$_POST['country']."</td> <td>".$_POST['scountry']."</td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td><strong>Home Phone:</strong>".format_phone($_POST['hphone'])."</td> <td> </td> </tr> <tr> <td><strong>Cell Phone:</strong>".format_phone($_POST['cphone'])."</td> <td> </td> </tr> <tr> <td><strong>Email:</strong>".$_POST['email']."</td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> </table> <table width=\"600\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"margin:0 auto; padding-top:20px;\"> <tr> <td align=\"center\"><strong>Item</strong></td> <td align=\"center\"><strong>Product Name</strong></td> <td align=\"center\"><strong>Dimensions</strong></td> <td align=\"center\"><strong>Price</strong></td> </tr>"; $cart = mysql_query("SELECT * FROM ushits_orders, ushits_products, ushits_packages WHERE ushits_orders.package_id = ushits_packages.package_id AND ushits_packages.package_product_id = ushits_products.product_id AND ushits_orders.session_id = '".session_id()."' AND ushits_orders.order_step = '1'"); while($row2 = mysql_fetch_assoc($cart)){ $strMailbody .= "<tr> <td align=\"center\"><a href=\"http://www.u-shits.com/beta1/images/customer_images/".$row2['image']."\"><img src=\"http://www.u-shits.com/beta1/images/customer_images/tb_".$row2['image']."\" /></a></td> <td align=\"center\">".$row2['product_name']." (".$row2['package_name'].")"."</td> <td align=\"center\">".$row2['dimensions']."</td> <td align=\"center\">".$row2['package_price']."</td> </tr>"; } $strMailbody .= "</table>"; $strFrom = "no-reply@u-shits.com"; $strTo = $_POST['email']; $strSub = "Your u-shits Invoice"; mail($strTo,$strSub,$strMailbody,"From:$strFrom\r\nReply-to: $strFrom\r\nContent-type: text/html; charset=us-ascii"); ?> here is the code that's not working $cart = mysql_query("SELECT * FROM ushits_orders, ushits_products, ushits_packages WHERE ushits_orders.package_id = ushits_packages.package_id AND ushits_packages.package_product_id = ushits_products.product_id AND ushits_orders.session_id = '".session_id()."' AND ushits_orders.order_step = '1'"); while($row2 = mysql_fetch_assoc($cart)){ $strMailbody .= "<tr> <td align=\"center\"><a href=\"http://www.u-shits.com/beta1/images/customer_images/".$row2['image']."\"><img src=\"http://www.u-shits.com/beta1/images/customer_images/tb_".$row2['image']."\" /></a></td> <td align=\"center\">".$row2['product_name']." (".$row2['package_name'].")"."</td> <td align=\"center\">".$row2['dimensions']."</td> <td align=\"center\">".$row2['package_price']."</td> </tr>"; } that piece of code is not displayed in my emails.. any ideas?
-
Ok, I've disabled register_globals again and now i'm using $_GET['page'] instead of page.. everything works great.. Thanks for all the help folks!
-
ok seven you were correct. I tried to echo $page and I got nothing. So I enabled register_globals in my php.ini and now everything works. Andy thanks you as well for the advice. BTW.. should I not enable register globals? is there a better way around this?
-
ummm I just figured you knew what a switch function was.. my apologies. <?php switch($page){ default: include 'quotes.php'; break; case quotes: include 'quotes.php'; break; case msgs: include 'messages.php'; break; } ?>
-
ok I have been using this switch function with no problems on my old server. Now that I have switched to a new server it no longer works. So i'm almost positive it's a setting in the php.ini or something. It will display the default: just fine but it will not display any of the cases..
-
yeah, I just figured it out but thanks guys.. here is what I used for those who are interested or have the same problem. <?php $pbsvss = fopen("http://".$server."/".$server."/pbsvss.htm", "r"); $contents = stream_get_contents($pbsvss); fclose($pbsvss); $string = str_replace("<a href=","<a href=http://".$server."/".$server."/", $contents); echo $string; ?>
-
yeah, that's what i'm trying to do.. I just thought about it too and i'm gonna have to figure out how to open the file and read it first..Am I right?
-
I have never had to use this function so it's all news to me..But could you tell me what I have wrong in this string of code? <?php str_replace("<a href=","<a href=http://".$server."/".$server."/", include("http://".$server."/".$server."/pbsvss.htm")); ?>
-
how i can solve double quotation (") problem?
n00bert replied to gratsami's topic in PHP Coding Help
I think if you posted your source code it would help people solve your problem. But just off the top of my head I think if you add a \ before the quotes that you want to echo to the page it should work. For example if I wanted to echo "Hello World!" to the page I would use this <?php echo "\"Hello World!\""; ?> -
no that wouldn't work because the page it needs to get is "3" which is actually the viewgallery.php. And viewgallery.php the the file that contains the link.
-
I can't seem to pass my cid variable to my getPage() function. But here I think it will be easier to help if you can see what i'm talking about so here is my function. function getPage(intPage){ var xmlHttp; try{ // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e){ // Internet Explorer try{ xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e){ try{ xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){ window.location="noajax.html"; return false; } } } xmlHttp.onreadystatechange=function(){ if(xmlHttp.readyState==4){ document.getElementById('content').innerHTML=xmlHttp.responseText; }else{ document.getElementById('content').innerHTML='<center><img src="images/loading.gif" alt="Loading" style="border:0px;"/><br />Loading, Please Wait...</center>'; } } switch(intPage){ case 1: xmlHttp.open("GET","news.php",true); xmlHttp.send(null); break; case 2: xmlHttp.open("GET","about.php",true); xmlHttp.send(null); break; case 3: xmlHttp.open("GET","viewgallery.php",true); xmlHttp.send(null); break; case 4: xmlHttp.open("GET","services.php",true); xmlHttp.send(null); break; case 5: xmlHttp.open("GET","contact.php",true); xmlHttp.send(null); break; case 6: xmlHttp.open("GET","parts.php",true); xmlHttp.send(null); break; case 7: default: xmlHttp.open("GET","news.php",true); xmlHttp.send(null); } } and here is the link i'm trying to pass <a href='javascript:getPage(3)?cid=".$row[0]."'>".$row[1]."</a> I'm pretty new to javascript and ajax...too be honest i'm still unsure on what ajax is. sry if i left out any key details. I'm pretty tired right now. So just let me know if you need anything else to help. thanks, n00b
-
ok now that just outputs the $q variable. SELECT gallery_photos.photo_id as photo_id, gallery_photos.photo_filename as filename, gallery_photos.photo_caption as caption, gallery_photos.photo_cateogry as photo_cat, gallery_category.category_id, gallery_category.category_name as category FROM `gallery_photos` LEFT JOIN `gallery_category` ON(gallery_category.category_id = gallery_photos.photo_category) GROUP BY gallery_photos.photo_id ORDER BY gallery_category.category_name I think i'm doing something wrong here. I'm still kinda dumb to this stuff.