|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
from ASP to PHP...
Hey everyone:
I am a newbie to PHP programming for 4 months now and nowadays reading "Beginning PHP4" to switch a news site from ASP to PHP (as i convinced the boss of the company i am working for that PHP is the best server side scripting language on the web now).. so would you help me to prove that? Here is the main and repeated part of the ASP code for our site which retrieving a title, a summary and a small image for a news ---------------------------------------------------------------------------- <% set rsmoheet=server.CreateObject("adodb.recordset") sql=" SELECT TOP 1 news_ent.NEW_ID, NEW_TITLE, new_summary FROM news_ent"&_ " where subtypeid=61 and news_ent.new_id IN (SELECT new_id FROM new_mainsub_rel WHERE subject_id = 1)"&_ " ORDER BY news_ent.new_id DESC" rsmoheet.open sql,con set img=server.CreateObject("adodb.recordset") sql=" select new_image_rel.new_id,image_id from new_image_rel where new_image_rel.new_id=" & rsmoheet("new_id") img.open sql,con %> <td></td> <td valign=bottom dir=rtl><p align=right><a href="showarabi.asp?new_id=<%if not rsmoheet.eof then Response.write rsmoheet("new_id") end if%>"><font face=tahoma size=4 color="#AC0404"><%if not rsmoheet.eof then Response.write rsmoheet("new_title") end if%> </font></a><br><img src="images/pix.gif" width=1 height=30><font face=tahoma size=2 color="#000000"> <%if not rsmoheet.eof then v=rsmoheet("new_summary") if Len(v)>180 then v=left(v,180) Response.Write (v) end if %> </font>.............<a href="showarabi.asp?new_id=<%if not rsmoheet.eof then Response.write rsmoheet("new_id") end if%>"><font face=tahoma size=2 color="#3C53C7"><u>more</u></font></a> </p></td> <td></td> <td></td> <td valign=bottom><br> <img src="../image/<%if not img.EOF then x=img("image_id") ms="small"+cstr(x) Response.Write ms end if%>.jpg" width=95> </td> -------------------------------------------------------------------------------- Note: The connection with the server and the select statement is OK.. Thanks in advance... |
|
#2
|
|||
|
|||
|
Do you want someone to rewrite that in PHP? Maybe you should work on that yourself.
__________________
Adam "Atticus" Plumb "A man doesn't automatically get my respect, he has to get on his knees and beg for it." |
|
#3
|
|||
|
|||
|
or if yer feeling lazy, there's an asp 2 php converter app kicking around on the web somewhere that does what it says on the tin......
do a google search for asp2php and you'll probably turn it up... truth is, having spun through what you gotta convert, it'd be quicker by hand though. |
|
#4
|
|||
|
|||
|
Thanks "podulator", i got the asp2php, i think it will help me insha'Allah in my work...(although you shouldn't say that i am lazy)
i am just a beginner as i mentioned, and i did few projects with PHP, but i didn't retrieve an image before that anyway, thanks again... salam |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > PHP Development > from ASP to PHP... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|