PHP - Browser Address Bar Not Showing Full Url
I use this code to open the contents of my Menu Links inside my <div id="main"> so I do not need to reload the whole page each time:
Similar TutorialsOk I am very new to php so please excuse my lack of knowledge. I have a simple contact form that I have placed onto one of my sites. The form works correctly in that it get sent to the correct address without any problems. The issue I am having is with the 'From' header. It will not show the senders email address as I would like. Instead it seems to be showing the server address. I have been 'playing' with the code for 2 days now and I still cannot get it to work. Any suggestions would be greatfully received. Regards. Code: [Select] <?php if(!$_POST) exit; $email = $_POST['Email']; $name = $_POST['Name']; $telephone = $_POST['Telephone']; $comments = $_POST['Comments']; //$error[] = preg_match('/\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b/i', $_POST['email']) ? '' : 'INVALID EMAIL ADDRESS'; if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$email )){ $error.="Invalid email address entered"; $errors=1; } if($errors==1) echo $error; else{ $values = array ('Name','Email','Telephone','Comments'); $required = array('Name','Email','Telephone','Comments'); $your_email = "**********************"; $email_name = "Message From your Website:"; foreach($values as $key => $value){ if(in_array($value,$required)){ if ($key != 'Name' && $key != 'Comments' && $key != 'Telephone') { if( empty($_POST[$value]) ) { echo 'Please go back and complete all fields, thank you.'; exit; } } $email_content .= $value.': '.$_POST[$value]."\n"; } } if(@mail($your_email,$email_name,$email_content)) { echo 'Thank you for your message, we will be in touch shortly'; } else { echo 'ERROR!'; } } $headers = "From: $email\r\n"."Reply-To: $email\r\n".'X-Mailer: PHP/' . phpversion(); @mail($your_email,$name,$email,$telephone,$comments,$headers); ?> Is there anything to worry if I see no SSL warning in my browser's address bar when I am in the logging credentials form?
You: As a PHP expert, you find the prospect of building yet another brochure-ware website distressing; you want to get your hands dirty building an advanced, MVC based application in a fun and supportive environment where you will be constantly challenged, always learning and delivering a product used by millions of people every day.
Our company was founded and is managed by developers who wrote the original software the company was built upon; the technical team are the core of our business. As a member of that team, it will be you who decides upon the on-going development of our technical stack as well as the product itself. You will of course have complete control over your workstation.
Our stack:
Qualifications:
A passion for programming, solving problems and building software customers love.
Experience building web-based applications as distinct from brochure-ware websites.
An expert in OOP/MVC/ORM programming techniques and PHP (v5.3+) frameworks. We happen to use Symfony2 but any relevant experience is fine.
You can bend MySQL to your will.
Solid front-end development experience with XHTML, CSS, and Javascript. Our stack includes AngularJS, CoffeeScript, jQuery and LESS.
An appreciation for a beautiful GUI and excellent user experience.
Expectation of a fast moving, agile environment. We ship code to customers daily – we’d expect you contribute from day 1.
You can validate your skills for example with source code samples, a github profile, contributions to an open source project, developer blog, stackoverflow answers etc.
What you will do:
Design (with help) and develop new channels for our software. In particular we are looking at apps using twilio (for voice/sms), facebook and twitter as well as a web based screensharing tool.
Integrate our software into other 3rd party applications. This could both be via APIs (salesforce, jira, 37signals) or through digging directly into the source code (sugarCRM, xenforo etc).
Continue improve and refine our existing channels and product. We are never satisfied and always looking for that small improvement, refactor or redesign that can increase usability, speed and functionality for our customers.
Work on our backend systems including internal developer tools and deployment processes, our SaaS application stack or the tools we have to manage our business.
Work on our mobile apps, built using our API / HTML5 and PhoneGap
About us:
Our principle product is DeskPRO, the helpdesk software platform. We make it easy for organisations (companies – large and small, charities, public sector organisations) to communicate with their users via email, twitter, facebook, SMS, web forms, live chat (text and voice) as well as providing publishing self-help tools, sales management, co-working tools and community based question and answers. DeskPRO is a platform where customers install the helpdesk applications they need to manage their business.
We sell this software to a range of organisations including large companies (e.g. Tumblr, Xerox, T-mobile, Fujitsu, Valve Software and AT&T) universities and the public sector all the way through to small family businesses. We have a dual license model; selling licenses to software installed on our clients’ servers (we don’t encrypt the code – so your code will get read!) and offering a fully managed SaaS solution. Millions of people use our software every day and a lot of agents spend their whole working day using it constantly.
What we offer:
Competitive salary based upon experience.
Friendly work environment at the Innovation Warehouse in Farringdon: http://theiw.org/.
30" monitor and control over your workstation setup. No corporate bureaucracy here.
A mixture of autonomy over your role and real responsibilities to the team and business.
Varied work. The DeskPRO product is large with lots of modules and technologies.
Review our source code before even applying; just ask and we will add you to our github account. Never accept a job until you have seen the code you will be working with.
We plan to have a lot of fun on this journey – please bring a sense of humour.
Apply:
Please send your CV and either a link to your online profile, github account or some sample source code to: jobs@deskpro.com
I need to set up a method for a user to be able to upload a pdf that should then be readable in the browser but I want to make it work a bit like Google Patents. Basically the rest of the users shouldn't be able to grab the content. It should be read only so as not to be passed around for free. It looks like Google is scanning each page and then running it through a reader to get the text. It then also seems to find the position of all the text so it can search the image for particular words and highlight them(cool js). Any way has anyone seen a php/ js version of this concept that I can get some hints from? Actually any language is ok if it works well. Tx I have a form with PHP validation and also a mysqli query checking for duplicates in the database for mailing address and email address in mysql.
It works fine but the customers are adding spaces in the mailing address for example 111 mailing address A V E, 1 1 1 ma iling address A V E etc. and my sql query doesn't see that as an address that's a duplicate.
Their alslo adding email address like my@emailaddress.com and m.y@emailaddress.com, m.y.2@emailaddress.com etc to bypass that comparision also.
Is there anyway to stop this from happening?
I am pretty new to PHP and am trying to create a simple (so I assumed) page to takes data from one html page(works fine) and updates a MYSQL Database. I am getting no error message, but the connect string down to the end of the body section is showing up as plain text in my browser window. I do not know how to correct this. I have tried using two different types of connect strings and have verified my names from the HTML page are the same as listed within the php page. Suggestions on what I need to look for to correct would be great. I have looked online, but so far all I am getting is how to connect, or how to create a comment, so I thought I would try here. Thank you for any assistance I may get!! - Amy - Code: [Select] <body><font color="006600"> <div style="background-color:#f9f9dd;"> <fieldset> <h1>Asset Entry Results</h1> <?php // create short variable names $tag=$_POST['tag']; $serial=$_POST['serial']; $category=$_POST['category']; $status=$_POST['status']; $branch=$_POST['branch']; $comments=$_POST['comments']; if (!$tag || !$serial || !$category || !$status || !$branch) { echo "You have not entered all the required details.<br />" ."Please go back and try again."; exit; } if (!get_magic_quotes_gpc()) { $tag = addslashes($tag); $serial = addslashes($serial); $category = addslashes($category); $status = addslashes($status); $branch = addslashes($branch); $comments = addslashes($comments); } //@ $db = new mysqli('localhost', 'id', 'pw', 'inventory'); $db = DBI->connect("dbi:mysql:inventory:localhost","id","pw") or die("couldnt connect to database"); $query = "insert into assets values ('".$serial."', '".$tag."', '".$branch."', '".$status."', '".$category."', '".$comments."')"; $result = $db->query($query); if ($result) { echo $db->affected_rows." asset inserted into Inventory."; } else { echo "An error has occurred. The item was not added."; } $db->close(); ?> </fieldset> </div> </body> I want to build a CMS system using php cake. I want pages to be created dynamically rather than have a set of static pages calling data dynamically. Is this going to be a complex operation using php cake? I am trying to include my full url on my site. example /index.php?page=demo
On my local server this bit of code worked fine.
$active = "$_SERVER[REQUEST_URI]";
however on my live server it returns blank, i think maybe due to the fact that its a windows server ?
php self works, but only returns index.php and not the full ?page=demo url
$active = ($_SERVER['PHP_SELF']);
does anyone know how i can work around this?
Thanks
Edited by cloudll, 04 December 2014 - 02:37 PM. I'm looking for a way to get the full url of the current page. something like $_SERVER['REQUEST_URI'] but the full thing. request uri doesn't work well for my situation, because my script is in a subdirectory of a domain. http://localhost/script. When I use request uri, it also includes "/script", which it should. Is there anyway to request the full URL? Hi, I need to send automated HTML emails with PHP for my web-server. I have SMTP with Postfix and Sendmail. When i send an email, it just goes to the spam folder of the mail client (tried with GMAIL as well as Microsoft outlook). Could i have the code for sending emails so they don't go to the spam folder. With full headers, etc. Thanks a lot, Jack Hi all, I have a database with some timestamps (in seconds) in it. Now I want to reverse it to normal readable time and date formats. Will someone tell me how please. Thnx Ryflex I am trying to get information from a website and these information are seperated by <br> Quote Samsung ML-3310ND <br> AC Cable (UK) <br> CD/DVD (including Software/ Utilities/ Drivers and User Manuals) <br> Setup Guide <br> Black Toner Cartridge 2000 pages When I import this to the database it becomes Quote Samsung ML-3310NDAC Cable (UK)CD/DVD (including Software/ Utilities/ Drivers and User Manuals) Setup GuideBlack Toner Cartridge 2000 pages How would I get it exactly how it looks. so it doesnt print in one paragraph. this is the code I am using.. Code: [Select] $inbox = $html->find( "#ctl00_placeholderMain_pnlInTheBox" ); if ( isset( $inbox[ 0 ] ) ) { // Tidy it up - remove commas and weird Word chars $box = strip_tags( $inbox[0] ); //$box = substr( $box, strpos( $box, ";" ) + 1 ); $box = strpos($box, ';') !== FALSE ? substr( $box, strpos( $box, ";" ) + 1 ) : $box; $box = str_replace("", "<br>", $box ); } else { $box = "0"; } I'm trying to get a good full text search working but am having some problems. Below is the sql that I am using to perform the search. One of the problems I am having is that the search only seems to be working on full words. Also if I misspell a word such as "seacrh" rather than "search" then no matches are found. Is there a way to return results even for misspelt words? match(author) against('search_phrase ') Thanks for any help. Hello,
How can I create a webpage using HTML and have a div wrapper for the page become FULL SCREEN?
I'm guessing this would be done with Javascript.
Hi guys, I have a very simple add.php to add data to a mySQL db. I have a menu/list drop down as one of my fields on my form and this shows an array of results from another table (ranks of the RAF) within my db. When I click the save button I have it process a INSERT INTO command but all i get inputted into my staff table is the first word... eg if I chose "Pilot Officer" from the list menu and then click save all that would appear in my db is "Pilot". Any clues? I will paste the php below... Code: [Select] <?php include('config.php'); ?> <form action='' method='POST' enctype='multipart/form-data'> <p><b>Rank:</b><br /> <select name="rank" id="rank"> <option selected>Please Select</option> <?php $query = "SELECT * FROM ranks ORDER BY rank ASC"; $result = mysql_query($query); while($row = mysql_fetch_array($result)) { echo "<option value=". $row["rank"] .">". $row["rank"] ."</option>"; } ?> </select> <p><b>Forename:</b><br /> <input name="forename" type="text" id="forename" value="" size="40"> <p><b>Surname:</b><br /><input name='surname' type='text' id="surname" value='' size="40" /> <p><b>Category:</b><br /> <select name="category" id="category"> <option selected>Please Select</option> <?php $query = "SELECT * FROM categories"; $result = mysql_query($query); while($row = mysql_fetch_array($result)) { echo "<option value=". $row["category"] .">". $row["category"] ."</option>"; } ?> </select> <p><b>Email:</b><br /><input name='email' type='text' id="email" value='' size="50" /> <p><b>Mobile:</b><br /> <input name='mobile' type='text' id="mobile" value='' size="40" /> </p> <input type='submit' value='Save' /> <input type='hidden' value='1' name='submitted' /> </form> <?php if (isset($_POST['submitted'])) { $rank = mysql_real_escape_string($_POST['rank']); $forename = mysql_real_escape_string($_POST['forename']); $surname = mysql_real_escape_string($_POST['surname']); $category = mysql_real_escape_string($_POST['category']); $email = mysql_real_escape_string($_POST['email']); $mobile = mysql_real_escape_string($_POST['mobile']); $sql = "INSERT INTO `staff` (`rank` , `forename` , `surname` , `category` , `email` , `mobile` ) VALUES ( '$rank' , '$forename' , '$surname' , '$category' , '$email' , '$mobile')"; mysql_query($sql) or die(mysql_error()); echo (mysql_affected_rows()) ? "Staff Added":"Nothing Added"; } ?> I have a field called full_name and it has John Smith as a value. I want to take John and put it to the first_name field and Smith to the last_name field. How do I do this, knowing that the first and last name are separateed by a space? Here's a query I did that does the same thing when they are separated by a COMMA, but I am not familiar with regular expressions enough to modify it to include space instead :-) $newlastname = $row['full_name']; if (preg_match('/^[^,]+(?=,)/', $row['full_name'], $match)) { $newlastname = $match[0]; } list($newlastname,$newfirstname) = explode(',',$row['full_name']); It's just a simple question... <?php include ('beginning.txt'); ?> Why can't I include the whole url, eg. ... include ('http://www.mywebsite.com/random/beginning.txt') ... ? It just shows a blank page if I type in the whole url name. I would like to include the file beginning.txt into several pages that are under the folder random. And another question... does it matter if I use ' or ". Some php guides say I should use include ('beginning.txt') some say I should use include ("beginning.txt"). I'd like to capture the text of a PHP warning. This is an internal process, no one will ever visit these php pages, so I want to send myself an email if the process fails. Right now, as part of debugging this, I am forcing failures and echoing the content of my email to the page. The first test is to use the wrong password. The following message is put on the page (broken into 3 sections for discussion purposes). A) Warning: mysql_connect() [function.mysql-connect]: B) Access denied for user 'xxx'@'localhost' (using password: YES) C) in E:\php\www\folder\DatabaseConnectionInfo.php on line 8 mysql_error() gives me part B. Access denied for user 'xxx'@'localhost' (using password: YES) How can I get parts A and C ? hello, i have the following code and it is ok. what im trying to do is convert a 2010-09-20 post from a form and have it read out as Monday September 20, 2010. is this possible? Code: [Select] $dateselected="$_POST[Y]-$_POST[M]-$_POST[D]"; echo "<table border='1'>"; echo "<tr><td width='100%' colspan='4' align='center'>$_POST[M]-$_POST[D]-$_POST[Y]</td></tr>"; |