asanti
-
Posts
13 -
Joined
-
Last visited
Posts posted by asanti
-
-
I'm currently runing an classifieds ads site, Php + Mysql (no frameworks) Basically i have the ads listing page (ads.php) and the ads details page (ad_detail.php)
This is my current .htaccess:
# disable directory browsing
Options All -Indexes
ErrorDocument 400 /error.php
ErrorDocument 401 /error.php
ErrorDocument 403 /error.php
ErrorDocument 404 /error.php
ErrorDocument 500 /error.php
ErrorDocument 502 /error.php
ErrorDocument 504 /error.php
RewriteEngine on
RewriteRule ^(.*)-da([0-9]+)$ ad_detail.php?ad=$2
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
RewriteRule ^([^\.]+)$ $1.php [NC,L]The final result is something like this:
www.mysite.com/this-is-the-ad-detail-da50555 (the number is the ad id)
What i need is to get this:
www.mysite.com/ads/another-ad-detail-da50777
+
What can i do in others urls to show like www.mysite.com/about/ instead of www.mysite.com/about (without the /)
I already tried this but doesn't work:
RewriteEngine on
RewriteBase /
RewriteRule -da([0-9]+)/?$ ad_detail.php?ad=$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{DOCUMENT_ROOT}/$1\.php -f [NC]
RewriteRule ^(.+?)/?$ $1.php [L] -
the thing is that some posted forms to db have \r\n and others don't. This is why i want to remove them in the form process.
-
so it nl2br() would be something like this?
$description = mysqli_real_escape_string($dbc, nl2br($trimmed['description']));
-
I'm currently have this code (part of code):
if (strlen($trimmed['title']) > 3 && strlen($trimmed['title']) < 200) { $title = mysqli_real_escape_string($dbc, $trimmed['title']); } else { echo '<div class="alert alert-danger" id="alerta3"> <button type="button" class="close" data-dismiss="alert">×</button> <center><p>Error</p></center> </div>'; $errors=true; } if (strlen($trimmed['description']) > 3 && strlen($trimmed['description']) < 4000) { $description = mysqli_real_escape_string($dbc, $trimmed['description']); } else { echo '<div class="alert alert-danger" id="alerta4"> <button type="button" class="close" data-dismiss="alert">×</button> <center><p>Error</p></center> </div>'; $errors=true; }
What should i modify to avoid texts with /n/r?
Thanks
-
Hi,
I want to use an external rss in my site but the problem is that i only want to grab feeds that contain certain keywords in the title,
This is what i got so far to display the feed:
<?php $html = ""; $url = "http://www.feedsite.com/conv-rss.asp"; $xml = simplexml_load_file($url); for($i = 0; $i < 5; $i++){ $title = $xml->channel->item[$i]->title; $link = $xml->channel->item[$i]->link; $description = $xml->channel->item[$i]->description; $pubDate = $xml->channel->item[$i]->pubDate; $html .= "<a href='$link'><h3>$title</h3></a>"; $html .= "$description"; $html .= "<br />$pubDate<hr />"; } echo $html; ?>
The feed is a classified jobs but i only need the jobs listed for musicians, keywords could be: bassist, singer, drummer, musician, etc..
Thanks
-
I'm currently running a classified ads site and planning to display my own content from database combined with and external site rss. So here is what i got right now after the db query for the jobs ads (procedural php),
while ($row = mysqli_fetch_array($results, MYSQLI_ASSOC)){
echo '<div class="media margin-none">
<a class="pull-left bg-inverse innerAll text-center" href="#"><img src="'.$foto.'" share_alt="" width="100" height="100"></a>
<div class="media-body innerAll">
<h4 class="media-heading innerT">
<a href="' . $row['title'] .'-da' . $row['id_ad'] . '" class="text-inverse">'. $remuneracion .' ' . substr(ucfirst(strtolower($row['title'])), 0, 53) . '</a> <small class="pull-right label label-default"><i class="fa fa-fw fa-calendar-o"></i> ' . $row['date_created'] . '</small></h4>
<p>' . substr(ucfirst(strtolower($row['description'])), 0, 80) . ' ...</p>';
echo '</div>
</div>
<div class="col-separator-h"></div>';
}
echo pagination($statement,$per_page,$page, $url_filtros, $filtros);
?>it is the while loop that i use to display ads from my database, what could be the best way to display (in this same loop?) other site's rss feed so i can show my content combined with the external rss?
Thanks
-
Also, depending on the number of users you want to send emails to, you should check the possibility to use an external newsletter service. You'll need to pay for it, but it will be more reliable. If you send a lot of email from a single web mail server, you could get 'banned' from gmail, yahoo, etc... And some of your emails could end up in the spam directory more easily than if you use a mailing service. Just my 2 cents
I was going to ask about that , i currently have 2600 users, what service do you recommend me? or by doing what requinix shares its ok?
-
I want to weekly send latest job posts to users according to their skills by the best or most convenient method
Something similar to this http://www.computrabajo.com.ar/bz-nuevo.htm (sorry, it´s in spanish...)
this is how you receive the latest jobs in your email after you subscribe...
-
I have jobs portal where registered users posts new jobs searches
This weekly newsletter will send all the jobs posted in the site (in a week) to the registered users but in a more personalized way: For example, posted jobs looking for designers should be sent to users registered as designers.
what is the best way to do this? any recommendations? Thanks in advance.
-
When you create the selection dropdown for music styles, use
SELECT ms.idstyle , style , id_user FROM music_styles ms LEFT JOIN user_styles us ON ms.id_style = us.id_style AND us.id_user = $user
Those styles with a user id should be marked as "selected"
Thanks Barand, what about the db process?
-
I have this 3 tables
-
users (id_user)
-
music_styles (id_style, style) ex. (1) - (Blues)
-
user_styles (id_user, id_style)
I'm trying to create a form in which the user ($user = $_SESSION['id_user']) chooses through a multiple select the styles of preference to store them in the database using mysqli statements.
If the styles prefered are selected they should be displayed in the select input later, how can i accomplish this?
Thanks.
-
users (id_user)
-
Hi, i'm a beginner on php. I want to create a site for classified ads and users profiles where an user can post an ad and also search for others users.
Thanks for any help!
Urls + Pagination Help
in Javascript Help
Posted
The file that is currently listing all the products (store.php) has this script:
As a result i have the product listed in the listing page. the anchor link for the products to the detail page (detail.php):
This is the script i have in the detail.php page:
Finally, the db query file (db_query.php):
to