starscream.pt
Members-
Posts
19 -
Joined
-
Last visited
Never
Everything posted by starscream.pt
-
yes it works server wise!!! check it out: http://wheeljack.pt.vu (just removed the redirection to the old site so no point clicking) address displayed on the box is the real address! TOPIC SOLVED!! Thank you guys!!
-
i hope this works, i'll tell you why i needed this. my webpage will be redirected from another domain, sometimes a page needs to be copied and all i got on the address bar is the redirection name so ... really hope this url thing works, well it works localy and im happy with it!
-
i did it!!!! this is the correct code, curl.php must be included on top, then to display the link in the form goes like this: <input type="text" name="curl" size="75" readonly="true" value="<?php print $pageURL; ?>" disabled="yes" ></p>
-
yes! that is what i'm after, but somehow i cant get it to work on the field value :\ at least the way you put it there
-
where do i put taht code? ion the curl.php? i used if to set the variable some value otherwise i keep getting variable undifined error
-
Ok i managed to get the url grab working, now, how exactly do i make it appear in the form box? This is waht i made, a separate php file called curl.php which will be included in the index.php curl.php <?php if(!isset($pageURL)) $pageURL ="http://"; $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; ?> index.php <head> <meta http-equiv="Content-Language" content="pt"> </head> <?php include "menu.php"; ?> <?php include "curl.php"; ?> </body> <body bgcolor="#C0C0C0"> <div align="center"> <table border="0" width="70%" height="100%" id="index_table" bgcolor="#B5CCFE" bordercolorlight="#FFFFFF" bordercolor="#FFFFFF" bordercolordark="#FFFFFF"> <tr> <td valign="top"> <form> <p style="margin-top: 0; margin-bottom: 0"> <font face="Verdana" size="2">Current URL: </font> <input type="text" name="curl" size="75" readonly="true" value=$pageURL disabled="yes" ></p> </form> <p style="margin-top: 0; margin-bottom: 0"> </p> <p style="margin-top: 0; margin-bottom: 0"> <font face="Verdana" size="2">This is an index test</font></td> </tr> </table> </div> </html> Thanks in advance!
-
Hello everyone, i want to make form text box which displays the current url, for example, this webpage i'm currently in is: http://www.phpfreaks.com/forums/index.php?action=post;board=1.0 so it should be displayed in the text box as that. Here is the page of my code including the form where it should display. Now, how do i do it?
-
but how exactly do i load it? i removed the ; from the start of the file: ;Windows Extensions ;Note that ODBC support is built in, so no dll is needed for it. ; extension=php_mbstring.dll ;extension=php_bz2.dll ;extension=php_cpdf.dll ;extension=php_curl.dll ;extension=php_dba.dll ;extension=php_dbase.dll ;extension=php_dbx.dll ;extension=php_exif.dll ;extension=php_fdf.dll ;extension=php_filepro.dll extension=php_gd2.dll ;extension=php_gettext.dll ;extension=php_ifx.dll ;extension=php_imap.dll ;extension=php_interbase.dll ;extension=php_ldap.dll ;extension=php_mcrypt.dll ;extension=php_mhash.dll ;extension=php_mime_magic.dll ;extension=php_ming.dll ;extension=php_mssql.dll ;extension=php_msql.dll extension=php_mysql.dll extension=php_mysqli.dll ;extension=php_oci8.dll ;extension=php_openssl.dll ;extension=php_oracle.dll ;extension=php_pdf.dll ;extension=php_pgsql.dll ;extension=php_shmop.dll ;extension=php_snmp.dll ;extension=php_sockets.dll ;extension=php_sybase_ct.dll ;extension=php_tidy.dll ;extension=php_xsl.dll ;extension=php_zip.dll extension=php_pdo.dll extension=php_pdo_sqlite.dll ;extension=php_pdo_firebird.dll ;extension=php_pdo_mssql.dll ;extension=php_pdo_mysql.dll ;extension=php_pdo_oci.dll ;extension=php_pdo_ibm.dll :extension=php_pdo_informix.dll ;extension=php_pdo_oci8.dll ;extension=php_pdo_odbc.dll ;extension=php_pdo_pgsql.dll extension=php_sqlite.dll ;extension=php_pdo_sqlite_external.dll ;extension=php_apc.dll ;extension=php_apd.dll ;extension=php_bcompiler.dll ;extension=php_bitset.dll ;extension=php_blenc.dll ;extension=php_bz2_filter.dll ;extension=php_classkit.dll ;extension=php_crack.dll ;extension=php_cvsclient.dll ;extension=php_db.dll ;extension=php_dio.dll ;extension=php_docblock.dll ;extension=php_domxml.dll ;extension=php_event.dll ;extension=php_ffi.dll ;extension=php_fileinfo.dll ;extension=php_fribidi.dll ;extension=php_gmp.dll ;extension=php_gopher.dll ;extension=php_haru.dll ;extension=php_htscanner.dll ;extension=php_hyperwave.dll ;extension=php_ibm_db2.dll ;extension=php_id3.dll ;extension=php_imagick.dll ;extension=php_ingres.dll ;extension=php_java.dll ;extension=php_lzf.dll ;extension=php_mailparse.dll ;extension=php_maxdb.dll ;extension=php_mcrypt_filter.dll ;extension=php_netools.dll ;extension=php_ntuser.dll ;extension=php_oggvorbis.dll ;extension=php_operator.dll ;extension=php_parsekit.dll ;extension=php_phar.dll ;extension=php_phpdoc.dll ;extension=php_pop3.dll ;extension=php_printer.dll ;extension=php_pspell.dll ;extension=php_radius.dll ;extension=php_rar.dll ;extension=php_runkit.dll ;extension=php_sam.dll ;extension=php_sdo.dll ;extension=php_smtp.dll ;extension=php_soap.dll ;extension=php_ssh2.dll ;extension=php_stats.dll ;extension=php_stem.dll ;extension=php_svn.dll ;extension=php_swish.dll ;extension=php_threads.dll ;extension=php_timezonedb.dll ;extension=php_translit.dll ;extension=php_uploadprogress.dll ;extension=php_win32ps.dll ;extension=php_win32scheduler.dll ;extension=php_win32service.dll ;extension=php_yaz.dll ;extension=php_zlib_filter.dll still giving the same error, and i have exited and loades wamp again :\
-
Hello there again, i'm using a shopping cart called plaincart, everything works perfectly but the image upload, i was told it has something to do with GD not being enabled, i'm running wamp on a local machine, using PHP version : 5.2.4 and the error message is get is: Fatal error: Call to undefined function imagecreatetruecolor() in Z:\wamp\www\plaincart\admin\library\functions.php on line 223 the php code is: <?php /* Check if a session user id exist or not. If not set redirect to login page. If the user session id exist and there's found $_GET['logout'] in the query string logout the user */ function checkUser() { // if the session id is not set, redirect to login page if (!isset($_SESSION['plaincart_user_id'])) { header('Location: ' . WEB_ROOT . 'admin/login.php'); exit; } // the user want to logout if (isset($_GET['logout'])) { doLogout(); } } /* */ function doLogin() { // if we found an error save the error message in this variable $errorMessage = ''; $userName = $_POST['txtUserName']; $password = $_POST['txtPassword']; // first, make sure the username & password are not empty if ($userName == '') { $errorMessage = 'You must enter your username'; } else if ($password == '') { $errorMessage = 'You must enter the password'; } else { // check the database and see if the username and password combo do match $sql = "SELECT user_id FROM tbl_user WHERE user_name = '$userName' AND user_password = md5('$password')"; $result = dbQuery($sql); if (dbNumRows($result) == 1) { $row = dbFetchAssoc($result); $_SESSION['plaincart_user_id'] = $row['user_id']; // log the time when the user last login $sql = "UPDATE tbl_user SET user_last_login = NOW() WHERE user_id = '{$row['user_id']}'"; dbQuery($sql); // now that the user is verified we move on to the next page // if the user had been in the admin pages before we move to // the last page visited if (isset($_SESSION['login_return_url'])) { header('Location: ' . $_SESSION['login_return_url']); exit; } else { header('Location: index.php'); exit; } } else { $errorMessage = 'Wrong username or password'; } } return $errorMessage; } /* Logout a user */ function doLogout() { if (isset($_SESSION['plaincart_user_id'])) { unset($_SESSION['plaincart_user_id']); session_unregister('plaincart_user_id'); } header('Location: login.php'); exit; } /* Generate combo box options containing the categories we have. if $catId is set then that category is selected */ function buildCategoryOptions($catId = 0) { $sql = "SELECT cat_id, cat_parent_id, cat_name FROM tbl_category ORDER BY cat_id"; $result = dbQuery($sql) or die('Cannot get Product. ' . mysql_error()); $categories = array(); while($row = dbFetchArray($result)) { list($id, $parentId, $name) = $row; if ($parentId == 0) { // we create a new array for each top level categories $categories[$id] = array('name' => $name, 'children' => array()); } else { // the child categories are put int the parent category's array $categories[$parentId]['children'][] = array('id' => $id, 'name' => $name); } } // build combo box options $list = ''; foreach ($categories as $key => $value) { $name = $value['name']; $children = $value['children']; $list .= "<optgroup label=\"$name\">"; foreach ($children as $child) { $list .= "<option value=\"{$child['id']}\""; if ($child['id'] == $catId) { $list.= " selected"; } $list .= ">{$child['name']}</option>\r\n"; } $list .= "</optgroup>"; } return $list; } /* If you want to be able to add products to the first level category replace the above function with the one below */ /* function buildCategoryOptions($catId = 0) { $sql = "SELECT cat_id, cat_parent_id, cat_name FROM tbl_category ORDER BY cat_id"; $result = dbQuery($sql) or die('Cannot get Product. ' . mysql_error()); $categories = array(); while($row = dbFetchArray($result)) { list($id, $parentId, $name) = $row; if ($parentId == 0) { // we create a new array for each top level categories $categories[$id] = array('name' => $name, 'children' => array()); } else { // the child categories are put int the parent category's array $categories[$parentId]['children'][] = array('id' => $id, 'name' => $name); } } // build combo box options $list = ''; foreach ($categories as $key => $value) { $name = $value['name']; $children = $value['children']; $list .= "<option value=\"$key\""; if ($key == $catId) { $list.= " selected"; } $list .= ">$name</option>\r\n"; foreach ($children as $child) { $list .= "<option value=\"{$child['id']}\""; if ($child['id'] == $catId) { $list.= " selected"; } $list .= "> {$child['name']}</option>\r\n"; } } return $list; } */ /* Create a thumbnail of $srcFile and save it to $destFile. The thumbnail will be $width pixels. */ function createThumbnail($srcFile, $destFile, $width, $quality = 75) { $thumbnail = ''; if (file_exists($srcFile) && isset($destFile)) { $size = getimagesize($srcFile); $w = number_format($width, 0, ',', ''); $h = number_format(($size[1] / $size[0]) * $width, 0, ',', ''); $thumbnail = copyImage($srcFile, $destFile, $w, $h, $quality); } // return the thumbnail file name on sucess or blank on fail return basename($thumbnail); } /* Copy an image to a destination file. The destination image size will be $w X $h pixels */ function copyImage($srcFile, $destFile, $w, $h, $quality = 75) { $tmpSrc = pathinfo(strtolower($srcFile)); $tmpDest = pathinfo(strtolower($destFile)); $size = getimagesize($srcFile); if ($tmpDest['extension'] == "gif" || $tmpDest['extension'] == "jpg") { $destFile = substr_replace($destFile, 'jpg', -3); $dest = imagecreatetruecolor($w, $h); imageantialias($dest, TRUE); } elseif ($tmpDest['extension'] == "png") { $dest = imagecreatetruecolor($w, $h); imageantialias($dest, TRUE); } else { return false; } switch($size[2]) { case 1: //GIF $src = imagecreatefromgif($srcFile); break; case 2: //JPEG $src = imagecreatefromjpeg($srcFile); break; case 3: //PNG $src = imagecreatefrompng($srcFile); break; default: return false; break; } imagecopyresampled($dest, $src, 0, 0, 0, 0, $w, $h, $size[0], $size[1]); switch($size[2]) { case 1: case 2: imagejpeg($dest,$destFile, $quality); break; case 3: imagepng($dest,$destFile); } return $destFile; } /* Create the paging links */ function getPagingNav($sql, $pageNum, $rowsPerPage, $queryString = '') { $result = mysql_query($sql) or die('Error, query failed. ' . mysql_error()); $row = mysql_fetch_array($result, MYSQL_ASSOC); $numrows = $row['numrows']; // how many pages we have when using paging? $maxPage = ceil($numrows/$rowsPerPage); $self = $_SERVER['PHP_SELF']; // creating 'previous' and 'next' link // plus 'first page' and 'last page' link // print 'previous' link only if we're not // on page one if ($pageNum > 1) { $page = $pageNum - 1; $prev = " <a href=\"$self?page=$page{$queryString}\">[Prev]</a> "; $first = " <a href=\"$self?page=1{$queryString}\">[First Page]</a> "; } else { $prev = ' [Prev] '; // we're on page one, don't enable 'previous' link $first = ' [First Page] '; // nor 'first page' link } // print 'next' link only if we're not // on the last page if ($pageNum < $maxPage) { $page = $pageNum + 1; $next = " <a href=\"$self?page=$page{$queryString}\">[Next]</a> "; $last = " <a href=\"$self?page=$maxPage{$queryString}{$queryString}\">[Last Page]</a> "; } else { $next = ' [Next] '; // we're on the last page, don't enable 'next' link $last = ' [Last Page] '; // nor 'last page' link } // return the page navigation link return $first . $prev . " Showing page <strong>$pageNum</strong> of <strong>$maxPage</strong> pages " . $next . $last; } ?>
-
[SOLVED] can't make the simplest PHP work!!!
starscream.pt replied to starscream.pt's topic in PHP Coding Help
omg finaly * opens bottle of champagne * nothing a classic restart and creating a folder inside www folder wont solve PHP is now running, i was able to say hello to the world and connect to mysql database *gee* that was tuff. Thanks to all of you great helpers that made me understand this better in a matter of hours. Cheers! Merry xmas! -
[SOLVED] can't make the simplest PHP work!!!
starscream.pt replied to starscream.pt's topic in PHP Coding Help
yes, that is why it has to be some configuration on my PC otherwise it would not work with many known sites. -
[SOLVED] can't make the simplest PHP work!!!
starscream.pt replied to starscream.pt's topic in PHP Coding Help
i stoped uniform server and started wamp, seems nicer, started the apache service, server is online php file is in www directory, still not working -
[SOLVED] can't make the simplest PHP work!!!
starscream.pt replied to starscream.pt's topic in PHP Coding Help
i have the uniform server running, still, same problem happens, am i missing anything? @ the password issue, i do not have a password, but have tried with password and different mysql account, nothing works What i'm doing is, running uniform server, writting a php file in notepad (e.g. test.php) with the hello world code and problem is the same, i cant make anything happen, browser is blank or has the ?> -
[SOLVED] can't make the simplest PHP work!!!
starscream.pt replied to starscream.pt's topic in PHP Coding Help
First of all i read what the 3rd poster said twice, than i remembered i have uninstalled uniform server or dont have wamp. second i went outside to relax, now i'll install uniform sever again to text this thing and will let you guys know how it went, thank you for everything so far. -
[SOLVED] can't make the simplest PHP work!!!
starscream.pt replied to starscream.pt's topic in PHP Coding Help
i tried the hello world and it displays blank!! it is seriously driving me nuts, no sorts of white text, just plain blank! -
It's driving me insane! I started learning this stuff 3 days ago, i've learned how to create databases and tables in mysql but then i noticed i could not do a simple submit information to the database with a submit form, so i tried something even EASYER, that is a simple "connected to mysql" message, here is what i ALWAYS get in the browser: ""; ?>" here is the code i'm using: i even tried taking off the "" because they make things go red on adobe dreamweaver, so i also tried this: One thing i notice is that the <?php always show up in red. Mysql is working fine it seems, as i can execute the commands in the console and insert data into tables, but never from a PHP website ITS DRIVING ME NUTS!!!!! i have tried out dozens of examples NONE works!! can you guys help me out?