Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

news letter subscription, getting 404

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 10-15-2004, 05:42 AM
  jds580s's Avatar 
jds580s jds580s is offline
 

Advanced Member
  
Join Date: Oct 2004
Posts: 38
 

Default news letter subscription, getting 404

I am editing news.tpl and getting a 404 error when a user trys to subscribe.

Code:
<FORM action="{$xcart_web_dir}/mail/subscribe.php" name="subscribeform"> <INPUT type="hidden" name="redirect" value="{$redirect}"> <table width="400" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="44" class="maintext">Email*</td> <td width="356"><INPUT type="text" name="newsemail" size="45"></td> </tr> <tr> <td></td> <td></td> </tr> <tr> <td></td> <td>{include file="buttons/subscribe_menu.tpl"} <INPUT type="image" src="../images/Button_Submit.gif" border="0" onclick="javascript:document.subscribeform.submit()"> </td> </tr> <tr> <td></td> <td>to unsubscribe please click here</td> </tr> </table> </form>

I left the original submit button in there until everything is working, but it gives the same error. The 404 is looking for the error page
/xcart/mail/error_message.php instead of just in the /xcart folder but I'm not sure exactly where the error is. Any help would be appreciated.
__________________
animator for hire
onthez.com
------------------------
x-cart v4.0.5 Linux
_________________
Reply With Quote
  #2  
Old 10-15-2004, 06:36 AM
  jds580s's Avatar 
jds580s jds580s is offline
 

Advanced Member
  
Join Date: Oct 2004
Posts: 38
 

Default

ok, perhaps this is more code related than template, I'm not sure.

It seems in the file mail/subscribe.php
everything is being processed fine until about 1/2 way into that file.
The logic looks something like

get email from form
if email is valid continue
if email doesn't all ready exist in the database continue
add email to database
send notification email to customer
send notification email to admin

If I plug in an invalid email it works fine and lets me know
if I plug in an existing email it works fine and lets me know
If I enter a new email address it gives the error

Here is the php (this is unmodified code)
Code:
$lists = func_query("SELECT * FROM $sql_tbl[newslists] WHERE avail='Y' AND show_as_news='Y'"); if (is_array($lists)) { foreach ($lists as $list) { db_query("INSERT INTO $sql_tbl[newslist_subscription] (listid, email, since_date) VALUES ('$list[listid]', '$email', '".time()."')"); } } else { func_header_location("/error_message.php?access_denied&id=58"); }

This is what seems to be tripping it up. I'm not sure what the issue is.

Using phpMyAdmin I can see that the table exists and has the one test email I put in there from the admin page.

Thanks!
__________________
animator for hire
onthez.com
------------------------
x-cart v4.0.5 Linux
_________________
Reply With Quote
  #3  
Old 10-15-2004, 06:41 AM
  jds580s's Avatar 
jds580s jds580s is offline
 

Advanced Member
  
Join Date: Oct 2004
Posts: 38
 

Default

Wow I am no php guy at all, I just know a very little, but was able to figure it out.

It was wanting Available = yes and Show as News = yes
In admin I don't want it to show as news so I just needed to delete that from the PHP as well.

Problem resolved!
__________________
animator for hire
onthez.com
------------------------
x-cart v4.0.5 Linux
_________________
Reply With Quote
  #4  
Old 02-11-2005, 03:32 PM
 
Jerrad Jerrad is offline
 

X-Adept
  
Join Date: Nov 2004
Location: The Netherlands
Posts: 484
 

Default

A few months old but exactly what I was looking for!
Got the subscribing working again, thanks to you jds!!
__________________
X-Cart 4.0.12
Heavy modified with paid, free and forum mods.
PHP 5.2.5 | MYSQL 5.0.51a
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 11:58 AM.

   

 
X-Cart forums © 2001-2020