StudioPress Community Forums

StudioPress Community Forums (http://www.studiopress.com/support/index.php)
-   General Discussion (http://www.studiopress.com/support/forumdisplay.php?f=7)
-   -   Issues with PHP mySQL and Lifestyle theme (http://www.studiopress.com/support/showthread.php?t=406)

mds840 11-06-2008 09:11 AM

Issues with PHP mySQL and Lifestyle theme
 
Its hard to explain, so I will do my best.

I have a mySQL DB that I have populated with a contact list, on a WP page I run some PHP code to extract the data using either a form or I have also tried to just hard code the search criteria.

When I put the PHP code in using the Write > Form, when the list displays it displays 2 blank lines for each positive search result before it displays the actual data.

If I hard code the page: ie page_find.php after the search results are compiled the page will redirect to the Home Page.

I have basically the same thing working on another site using the Revolution City theme and it works fine.

Any ideas?

Paul 11-06-2008 06:47 PM

Re: Issues with PHP mySQL and Lifestyle theme
 
Can you post a link so we can see what's happening?

mds840 11-06-2008 08:09 PM

Re: Issues with PHP mySQL and Lifestyle theme
 
It is marginally not work safe depending on the rules, there are no nude pics or pics of any people, just links that may not be safe to click

Here is the link to the part that is going back to the home page after making the criteria choices:
http://www.mysexyrep.dreamhosters.com/find-advisor/

Here is the link to where it is putting in extra spaces, I added a print test to verify where it is where the extra space is coming from.
http://www.mysexyrep.dreamhosters.com/bp/

Paul 11-06-2008 08:18 PM

Re: Issues with PHP mySQL and Lifestyle theme
 
The reason it's redirecting to your homepage is because that's where the form is pointing...

<form action="/index.php" method="POST">

For the spaces you would really need to check the code in the script you're using - can't really help with that.

mds840 11-06-2008 08:23 PM

Re: Issues with PHP mySQL and Lifestyle theme
 
This is my <Form> code:

Code:

<form action="<?= $PHP_SELF ?>" method="POST">

Paul 11-06-2008 08:26 PM

Re: Issues with PHP mySQL and Lifestyle theme
 
You probably need to change <?= $PHP_SELF ?> so that it's pointing straight to the script you're using.

mds840 11-06-2008 08:32 PM

Re: Issues with PHP mySQL and Lifestyle theme
 
Just weird that the same code works fine here:

http://www.bedroomdivas.com/find-a-diva/

Paul 11-06-2008 08:46 PM

Re: Issues with PHP mySQL and Lifestyle theme
 
When you view the source of that page it's slightly different...

<form action="" method="POST">

Strange, because without anything in there I can't see how the script knows what to do.

Sorry, I'm not a programmer and can't offer much help with this.

mds840 11-06-2008 09:14 PM

Re: Issues with PHP mySQL and Lifestyle theme
 
You may not be a programmer but you fixed the issue. You saw what I didn't see, that was it, I took the php statement out and just put in the "" and it works like a champ.

Thanks

Paul 11-06-2008 09:28 PM

Re: Issues with PHP mySQL and Lifestyle theme
 
Ah, good stuff :)

If you take a look at the part of the script that generates the html for the search results you might be able to spot what's inserting the extra spaces too.

mds840 11-06-2008 09:30 PM

Re: Issues with PHP mySQL and Lifestyle theme
 
Thanks for the help and the advice on what to look for to clean up the other issue, I will try that. Thanks again, that was 2 weeks of headaches you solved for me.

Paul 11-06-2008 09:34 PM

Re: Issues with PHP mySQL and Lifestyle theme
 
Good luck with the other thing - hope you get it fixed!


All times are GMT -5. The time now is 08:20 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.