vkg Posted December 2, 2011 Report Posted December 2, 2011 Salut, am si eu un script , adica acesta:<?php$ftp_server = "Server";$ftp_user_name = "User";$ftp_user_pass = "Parola";$last_modified = filemtime("/var/www/....."); $now = strtotime("now"); $old = $now - $last_modified; if($old > 3600) { $filename = "/var/www/......."; unlink($filename); $local_file = '/var/www/......'; $remote_file = '.................'; // aici pui toata adresa adica cand intrii pe ftp pana la server EX:client12/server12/samp/scriptfiles/loguri/nume.log $conn_id = ftp_connect($ftp_server); $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); if (ftp_get($conn_id, $local_file, $remote_file, FTP_BINARY)) { //echo "Successfully written to $local_file\n"; } else { //echo "There was a problem\n"; }ftp_close($conn_id);} echo "<table class='sample'><tr> <td width='40px' class='title'>ID</td> <td class='title' width='150px'>Admin</td> <td width='200px' class='title'>Nume</td> <td width='150px' class='title'>Motiv</td> <td width='300px' class='title'>Data</td></tr>";$i=1; if(!$file=fopen("var/www/..........","r")) die("Error reading housefile");while (($data=fgetcsv($file,1024, ",")) !== FALSE){ $test = array( "ID" => $i, "Admin" => $data[0], "Nume" => $data[1], "Motiv" => $data[2], "Data" => $data[3], ); echo "<tr>"; foreach($test as $line => $v) { echo "<td><center><b><font size='1' face='Verdana' color='#ffffff'>" .$v. "</center></td>"; echo "</font></b>"; } $i++; echo "</tr>";}echo "</table>";?>Este un cod pentru Ban List de la un server de samp, care sa arate un log pe o pagina HTML intr-un tabel, acum problema sta asa:1. Cum pun acest script intr-o pagina HTML, sau cum fac cu rewrite incat sa aiva designul acela HTML si scriptul acesta.2. Cum fac sa arate un .log in acel tabel, ce trebuie sa trec in loc de acele '...........' , nu prea ma pricep la PHP de aia am postat aici, astept sa vedem , cei care stiu FPT_GET mai bine, poate ma vor ajutaMultumesc. Quote
kostasalexis Posted December 5, 2011 Report Posted December 5, 2011 am si eu o problema cu o pagina html. este vorba despre o pagina a unui magazin de cumparaturi... vreau ca atunci cand , clientul apasa pe add to bag sa il redirectioneze pe o alta pagina pusa de mine . problema este ca in codul html al butonului add to bag nu exista href=".." . am incerat sa modific dar nu merge ACESTA ESTE CODUL BUTONULUI : <ul class="form_navigation cf menu_inline"> <li><input id="btn_add_2_shop_cart" type="image" src="http://media.topman.com/wcsstore/ConsumerDirectStorefrontAssetStore/images/colors/color6/v2/btn_add_to_bag.gif" value="Add to shopping bag" /></li> <li class="replace last"> <!-- ************** START ContinueShopping.jspf ************** --><a id="link_continue_shopping" class="rollover" href="http://www.topman.com/webapp/wcs/stores/servlet/CatalogNavigationSearchResultCmd?beginIndex=0&catalogId=33056&storeId=12555&langId=-1&viewAllFlag=false&sort_field=Relevance&categoryId=207200&parent_categoryId=207169&refinements=category~%5b207228%7c207200%5d&noOfRefinements=1&pageSize=20" title="Continue shopping">Continue shopping</a> <!-- ************** END ContinueShopping.jspf ************** --> </li> </ul> Quote
AhEaD Posted December 5, 2011 Report Posted December 5, 2011 am si eu o problema cu o pagina html. este vorba despre o pagina a unui magazin de cumparaturi... vreau ca atunci cand , clientul apasa pe add to bag sa il redirectioneze pe o alta pagina pusa de mine . problema este ca in codul html al butonului add to bag nu exista href=".." . am incerat sa modific dar nu merge ACESTA ESTE CODUL BUTONULUI : <ul class="form_navigation cf menu_inline"> <li><input id="btn_add_2_shop_cart" type="image" src="http://media.topman.com/wcsstore/ConsumerDirectStorefrontAssetStore/images/colors/color6/v2/btn_add_to_bag.gif" value="Add to shopping bag" /></li> <li class="replace last"> <!-- ************** START ContinueShopping.jspf ************** --><a id="link_continue_shopping" class="rollover" href="http://www.topman.com/webapp/wcs/stores/servlet/CatalogNavigationSearchResultCmd?beginIndex=0&catalogId=33056&storeId=12555&langId=-1&viewAllFlag=false&sort_field=Relevance&categoryId=207200&parent_categoryId=207169&refinements=category~[207228|207200]&noOfRefinements=1&pageSize=20" title="Continue shopping">Continue shopping</a> <!-- ************** END ContinueShopping.jspf ************** --> </li> </ul>Butonul nu e prins intr-un <form > ? Quote
Pugna Posted December 5, 2011 Report Posted December 5, 2011 Vreau sa te ajut, dar nu vreau sa ma chinui sa inteleg ce vrei sa faci. Fii mai explicit si o sa-ti ofer solutia. Salut, am si eu un script , adica acesta:<?php$ftp_server = "Server";$ftp_user_name = "User";$ftp_user_pass = "Parola";$last_modified = filemtime("/var/www/....."); $now = strtotime("now"); $old = $now - $last_modified; if($old > 3600) { $filename = "/var/www/......."; unlink($filename); $local_file = '/var/www/......'; $remote_file = '.................'; // aici pui toata adresa adica cand intrii pe ftp pana la server EX:client12/server12/samp/scriptfiles/loguri/nume.log $conn_id = ftp_connect($ftp_server); $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); if (ftp_get($conn_id, $local_file, $remote_file, FTP_BINARY)) { //echo "Successfully written to $local_file\n"; } else { //echo "There was a problem\n"; }ftp_close($conn_id);} echo "<table class='sample'><tr> <td width='40px' class='title'>ID</td> <td class='title' width='150px'>Admin</td> <td width='200px' class='title'>Nume</td> <td width='150px' class='title'>Motiv</td> <td width='300px' class='title'>Data</td></tr>";$i=1; if(!$file=fopen("var/www/..........","r")) die("Error reading housefile");while (($data=fgetcsv($file,1024, ",")) !== FALSE){ $test = array( "ID" => $i, "Admin" => $data[0], "Nume" => $data[1], "Motiv" => $data[2], "Data" => $data[3], ); echo "<tr>"; foreach($test as $line => $v) { echo "<td><center><b><font size='1' face='Verdana' color='#ffffff'>" .$v. "</center></td>"; echo "</font></b>"; } $i++; echo "</tr>";}echo "</table>";?>Este un cod pentru Ban List de la un server de samp, care sa arate un log pe o pagina HTML intr-un tabel, acum problema sta asa:1. Cum pun acest script intr-o pagina HTML, sau cum fac cu rewrite incat sa aiva designul acela HTML si scriptul acesta.2. Cum fac sa arate un .log in acel tabel, ce trebuie sa trec in loc de acele '...........' , nu prea ma pricep la PHP de aia am postat aici, astept sa vedem , cei care stiu FPT_GET mai bine, poate ma vor ajutaMultumesc. Quote
kostasalexis Posted December 5, 2011 Report Posted December 5, 2011 imi poti da ia id-ul tau pe pm ? ca sa iti dau pagina completa poate iti dai seama ? te rog frumos cam asa ar arata tot codul : <script type="text/javascript"><!-- s.events="prodView,event2" --></script> <ul class="form_navigation cf menu_inline"> <li><input id="btn_add_2_shop_cart" type="image" src="http://media.topman.com/wcsstore/ConsumerDirectStorefrontAssetStore/images/colors/color6/v2/btn_add_to_bag.gif" value="Add to shopping bag" /></li> <li class="replace last"> <!-- ************** START ContinueShopping.jspf ************** --><a id="link_continue_shopping" class="rollover" href="http://www.topman.com/webapp/wcs/stores/servlet/CatalogNavigationSearchResultCmd?beginIndex=0&catalogId=33056&storeId=12555&langId=-1&viewAllFlag=false&sort_field=Relevance&categoryId=207200&parent_categoryId=207169&refinements=category~%5b207228%7c207200%5d&noOfRefinements=1&pageSize=20" title="Continue shopping">Continue shopping</a> <!-- ************** END ContinueShopping.jspf ************** --> </li> </ul> <!-- Schway start --><!-- Schway End--><!-- End - JSP File Name: NewProductDisplaySizeQuantity.jsp --> </form> Quote
vkg Posted December 6, 2011 Author Report Posted December 6, 2011 Eu am rezolvat problema puteti da TC ! Quote
vkg Posted December 7, 2011 Author Report Posted December 7, 2011 Bun am revenit cu inca 2 'probleme' ca nu sunt chiar niste probleme, mai mult niste idei, am si eu scriptul de mai sus, adica acesta:<?php $ftp_server = "Server"; $ftp_user_name = "User"; $ftp_user_pass = "Parola"; $last_modified = filemtime("/var/www/....."); $now = strtotime("now"); $old = $now - $last_modified; if($old > 3600) { $filename = "/var/www/......."; unlink($filename); $local_file = '/var/www/......'; $remote_file = '.................'; // aici pui toata adresa adica cand intrii pe ftp pana la server EX:client12/server12/samp/scriptfiles/loguri/nume.log $conn_id = ftp_connect($ftp_server); $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); if (ftp_get($conn_id, $local_file, $remote_file, FTP_BINARY)) { //echo "Successfully written to $local_file\n"; } else { //echo "There was a problem\n"; } ftp_close($conn_id); } echo "<table class='sample'><tr> <td width='40px' class='title'>ID</td> <td class='title' width='150px'>Admin</td> <td width='200px' class='title'>Nume</td> <td width='150px' class='title'>Motiv</td> <td width='300px' class='title'>Data</td> </tr> "; $i=1; if(!$file=fopen("..........","r")) die("Error reading housefile"); while (($data=fgetcsv($file,1024, ",")) !== FALSE) { $test = array( "ID" => $i, "Admin" => $data[0], "Nume" => $data[1], "Motiv" => $data[2], "Data" => $data[3], ); echo "<tr>"; foreach($test as $line => $v) { echo "<td><center><b><font size='1' face='Verdana' color='#ffffff'>" .$v. "</center></td>"; echo "</font></b>"; } $i++; echo "</tr>"; } echo " </table>"; ?> Toate bune si frumoase, merge perfect, dupa cateva ore, chiar zile de munca, am reusit sa il fac sa il aranjez si sa il pun in functiune, ok, acum am si eu 2 nelamuriri ca sa zic asa:1. Deci scriptul acesta face defapt sa ia datele dintr-un fisier de pe un Game Host (Samp mai precis) si sa le aduca pe alt fisier (Numit de mine) pe un Webhost , de aici datele sunt aratate pe un site intr-un tabel, ce vreau eu sa fac defapt ? Pai as vrea ca datele care le extrage din acel fisier sa nu le arate in tabel cum sunt in fisier (de sus in jos) as vrea sa le ia invers adica cele mai noi date sus si cele mai vechi jos, sper ca m-ati inteles2. Vreau sa pun un script de paginare care la anumite randuri in tabelul acela sa se creeze o noua pagina (Automat bineinteles) sa nu fie fisiere diferite, doar ceva simplu care sa nu treaca dintr-un fisier in altul... Quote
Moderators Dragos Posted December 7, 2011 Moderators Report Posted December 7, 2011 Pentru prima chestie<?php $ftp_server = "Server"; $ftp_user_name = "User"; $ftp_user_pass = "Parola"; $last_modified = filemtime("/var/www/....."); $now = strtotime("now"); $old = $now - $last_modified; if($old > 3600) { $filename = "/var/www/......."; unlink($filename); $local_file = '/var/www/......'; $remote_file = '.................'; // aici pui toata adresa adica cand intrii pe ftp pana la server EX:client12/server12/samp/scriptfiles/loguri/nume.log $conn_id = ftp_connect($ftp_server); $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); if (ftp_get($conn_id, $local_file, $remote_file, FTP_BINARY)) { //echo "Successfully written to $local_file\n"; } else { //echo "There was a problem\n"; } ftp_close($conn_id); } echo "<table class='sample'><tr> <td width='40px' class='title'>ID</td> <td class='title' width='150px'>Admin</td> <td width='200px' class='title'>Nume</td> <td width='150px' class='title'>Motiv</td> <td width='300px' class='title'>Data</td> </tr> "; $i=1; if(!$file=fopen("..........","r")) die("Error reading housefile"); $strings = "";while (($data=fgetcsv($file,1024, ",")) !== FALSE) { $test = array( "ID" => $i, "Admin" => $data[0], "Nume" => $data[1], "Motiv" => $data[2], "Data" => $data[3], ); $stringv = "<tr>"; foreach($test as $line => $v) { $stringv = $stringv . "<td><center><b><font size='1' face='Verdana' color='#ffffff'>" .$v. "</font></b></center></td>"; } $i++; $stringv = $stringv . "</tr>\n"; $strings = $stringv . $strings;} echo $strings . " </table>"; ?> Quote
Serar Posted December 7, 2011 Report Posted December 7, 2011 Pentru prima chestie<?php $ftp_server = "Server"; $ftp_user_name = "User"; $ftp_user_pass = "Parola"; $last_modified = filemtime("/var/www/....."); $now = strtotime("now"); $old = $now - $last_modified; if($old > 3600) { $filename = "/var/www/......."; unlink($filename); $local_file = '/var/www/......'; $remote_file = '.................'; // aici pui toata adresa adica cand intrii pe ftp pana la server EX:client12/server12/samp/scriptfiles/loguri/nume.log $conn_id = ftp_connect($ftp_server); $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); if (ftp_get($conn_id, $local_file, $remote_file, FTP_BINARY)) { //echo "Successfully written to $local_file\n"; } else { //echo "There was a problem\n"; } ftp_close($conn_id); } echo "<table class='sample'><tr> <td width='40px' class='title'>ID</td> <td class='title' width='150px'>Admin</td> <td width='200px' class='title'>Nume</td> <td width='150px' class='title'>Motiv</td> <td width='300px' class='title'>Data</td> </tr> "; $i=1; if(!$file=fopen("..........","r")) die("Error reading housefile"); $strings = "";while (($data=fgetcsv($file,1024, ",")) !== FALSE) { $test = array( "ID" => $i, "Admin" => $data[0], "Nume" => $data[1], "Motiv" => $data[2], "Data" => $data[3], ); $stringv = "<tr>"; foreach($test as $line => $v) { $stringv = $stringv . "<td><center><b><font size='1' face='Verdana' color='#ffffff'>" .$v. "</font></b></center></td>"; } $i++; $stringv = $stringv . "</tr>\n"; $strings = $stringv . $strings;} echo $strings . " </table>"; ?> daca tot ai pus o parte a tabelului pe $strings de ce nu ai pus si prima parte? e un output in plus primul echo + partea cu atribuire $stringv cu tr (use ' '), partea cu fondurile nu are ce cauta se face css Quote
vkg Posted December 7, 2011 Author Report Posted December 7, 2011 Mersi frumos, merge, dar acum as vrea sa stiu cum fac sa arate ID normal, adica acum arata id-urile asa:98979695etcVreau sa le arate normal12345etc .. Quote
Moderators Dragos Posted December 7, 2011 Moderators Report Posted December 7, 2011 (edited) Mersi frumos, merge, dar acum as vrea sa stiu cum fac sa arate ID normal, adica acum arata id-urile asa:98979695etcVreau sa le arate normal12345etc ..Se face cu salvarea intr-un vector cu array_push a liniilor cu <td></td> de la Admin, Nume, Motiv, Data si apoi, cu un for $i de la 0 la count($vector) - 1, se afiseaza $i+1 si $vector[$i] . Paginatia o poti face cu o sesiuni. Edited December 7, 2011 by Dragos Quote
vkg Posted December 8, 2011 Author Report Posted December 8, 2011 Tot nu inteleg... poti fii mai explicit cum fac sa le numeroteze bine ? Arata-mi unde sa modific, mersi Quote
GarryOne Posted December 8, 2011 Report Posted December 8, 2011 <?php$array = array(52=>"php",97=>"c/c++",2=>"python",123=>"perl");print_r($array);// va afisa: //Array ( [52] => php [97] => c/c++ [2] => python [123] => perl )$new_array = array_values($array);print_r($new_array);// va afisa//Array ( [0] => php [1] => c/c++ [2] => python [3] => perl )?> Quote